I've already tried rendering text using the "CreateFont()" function, however, I am unable to achieve "clear" text.

My text always looks.. blurry.

I would like to achieve clear results as the results of Macromedia Flash's "Bitmap text" option, or even its "Anti-Alias for readability."

Also, does anyone know how I would go about replicating Microsoft Word's text selector?
Basically, I would like to be able to render out text as clear as it appears in text editors when a font is selected, such as notepad and whatnot.

Note: Using Win32 for this.

Edited 6 Years Ago by PixelExchange: n/a

I didn't get your question clearly.

Are you looking how to create system fixed fonts?

HFONT hFont=(HFONT)GetStockObject(SYSTEM_FIXED_FONT)

Is this what you mean by clear text?
http://www.gilsmethod.com/images/htenablecleartypefonts.png

well it's a feature that global to the whole system, may be you try to change the
system properties by sending messages to the root desktop.I don't think you can do
that only for a one application but might be.

It's called subpixel level rendering.
http://en.wikipedia.org/wiki/ClearType

It's a global setting more than a setting that is local to a particular HWND.
^ well I think, not sure.

Edited 6 Years Ago by NicAx64: n/a

My apologies for taking so long to respond.. I've actually found the answer I was looking for.. The problem was.. I was using the CreateFont function with "point sizes, such as 12, 10, for the width and height rather than using the required "logical units" which the CreateFont function needs to display text properly.

Using point sizes with the CreateFont function will give you "blurry" text.. as apposed to the fonts' normal appearance.

I was doing:

CreateFont(12, 12, 0, 0, 0, TRUE, 0, 0, 0, 0, 0, 0, 0, "Times New Roman");

Instead of:

long lfHeight;
lfHeight = MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);
CreateFont(lfHeight, 0, 0, 0, 0, TRUE, 0, 0, 0, 0, 0, 0, 0, "Times New Roman");

However, the standard Createfont() function is not enough for what I want to do. The CreateFont function only allows me to display fonts "normally.." What I am trying to do is display VERY clear looking fonts.. the type of clarity that can ONLY be found on fonts called "True Type" fonts.

I've heard that rendering a "font" into a bitmap... allows for such text clarity.
If it is possible.. can someone please explain how a person would be able to render a font.. into a bitmap?

The program "Macromedia Flash," does EXACTLY what I would like to do. Flash provides SEVERAL formats in which a person can render out text with. Examples include: anti-aliased text, bitmap text, device fonts, etc.. Each format allows for more or less clarity. What I am looking for.. is a means to present text with ULTIMATE clarity.. such that there is just crisp..clean text.. and NO blurryness.

Edited 6 Years Ago by PixelExchange: n/a

This article has been dead for over six months. Start a new discussion instead.