Page 1 of 1

LoadFont() #PB_Font_LowQuality

Posted: Sat Mar 01, 2008 6:36 am
by Mistrel
I would like to see a #PB_Font_LowQuality flag for LoadFont() that forces the font to render without ClearType or any other form of font smoothing.

Posted: Sat Mar 01, 2008 6:45 am
by Rook Zimbabwe
Is that even possible in the Windows API? I thought if the user of the OS flagged that as ON, it was ON for all applications that use fonts. :shock:

Posted: Sat Mar 01, 2008 7:01 am
by Mistrel
I really don't know. I hope so. :roll:

Posted: Sat Mar 01, 2008 12:11 pm
by Kaeru Gaman
Rook is right.

e.g. Civ3 sais in the manual, you should enable font smoothing.
they wouldn't have done this if they were able to activate it for their game alone.
...and I think the programmers of Sid Meier's team know what they do... ;)

Posted: Sat Mar 01, 2008 12:33 pm
by Trond
Kaeru Gaman wrote:Rook is right.

e.g. Civ3 sais in the manual, you should enable font smoothing.
they wouldn't have done this if they were able to activate it for their game alone.
...and I think the programmers of Sid Meier's team know what they do... ;)
Wanna bet?

Code: Select all

#DEFAULT_QUALITY
#DRAFT_QUALITY
#PROOF_QUALITY
#NONANTIALIASED_QUALITY = 3
#ANTIALIASED_QUALITY = 4
#CLEARTYPE_QUALITY = 5
#CLEARTYPE_NATURAL_QUALITY = 6


OpenWindow(0, 0, 0, 512, 384, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
CreateGadgetList(WindowID(0))

LF.LOGFONT
LF\lfHeight         = 34
LF\lfWidth          = 0
LF\lfEscapement     = 0
LF\lfOrientation    = 0
LF\lfWeight         = #FW_DONTCARE
LF\lfItalic         = 0
LF\lfUnderline      = 0
LF\lfStrikeOut      = 0
LF\lfCharSet        = #DEFAULT_CHARSET
LF\lfOutPrecision   = #OUT_DEFAULT_PRECIS
LF\lfClipPrecision  = #CLIP_DEFAULT_PRECIS
LF\lfQuality        = #NONANTIALIASED_QUALITY
LF\lfPitchAndFamily = #DEFAULT_PITCH | #FF_DONTCARE
PokeS(@LF\lfFaceName[0], "Tahoma")

Font = CreateFontIndirect_(@LF)
Debug Font
TextGadget(0, 10, 10, 300, 30, "Welcome to Pixel Palace")
SetGadgetFont(0, Font)

Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Break
  EndSelect
ForEver



Posted: Sat Mar 01, 2008 10:02 pm
by Mistrel
Thank you! :D

Posted: Sun Mar 02, 2008 7:14 am
by Rook Zimbabwe
Well I done been told! 8)

Posted: Sun Mar 02, 2008 12:53 pm
by Kaeru Gaman
yap, cool thing. 8)

..I wonder if Sid's boys just were too lazy..

does it also work the other way round?
I mean, can you switch smothing on for one app on a system where it's globally off?

Posted: Sun Mar 02, 2008 2:13 pm
by Trond
Kaeru Gaman wrote: does it also work the other way round?
I mean, can you switch smothing on for one app on a system where it's globally off?
Yes.

Re: LoadFont() #PB_Font_LowQuality

Posted: Tue Feb 15, 2011 5:49 pm
by c4s
I have ClearType and anything similar disabled by default because it just hurts my eyes (probably because my tft monitor isn't that good at doing it). Now I just realized that working with smoothed fonts can be tricky, e.g. the following outline example doesn't work very well: http://www.purebasic.fr/english/viewtop ... 12&t=45192
The solution is to load the font without any smoothing and as I can see from Trond's post it luckily isn't that hard to do (at least on Windows).

So I +1 this topic for an official #PB_Font_LowQuality flag that disables any font smoothing regardless of what the users has set on the system. In this context I also request a flag that forces smoothing.


P.S.
I always thought #PB_Font_HighQuality would switch smoothing on and off but it doesn't seem to do anything here.

Re: LoadFont() #PB_Font_LowQuality

Posted: Mon Nov 21, 2016 9:45 am
by oakvalley
Don't know if this happened or not?

But would really like to see an option for DrawText command to force the cleartype off at will (regardless of what user has). To me, cleartype is horrible technology, I can see clearly all those orange and blue pixels. Don't know how Microsoft came to this conclusion, but probably based on available TFT's at the time it was invented. Times have changed, nobody really need ClearType anymore. If so, buy some Apple hardware for that.

In fact, I sent a request to Microsoft demanding to know the eye vision score test of the two chaps inventing and design the ClearType. Never got an answer, haha.
But I guess it was two guys with glasses. I don't wear glasses or know of any color blindness in my eyes, so I don't know how ClearType looks for those people in favour of it, for me an many others they report "blurry", "hurt my eyes" etc.

It's a nightmare to create for instance labels with drawtext in order to print out on Zebra 1-color black prints. Yeah, the blue and orange become noise at the edges, so its really important to get flags for purebasic to force it off at command. I ended up pre-render fonts (kind of sprite sheets) for all characters, I simply draw sprites so I could ensure the text was really single color black on anybody's machine.