LoadFont() #PB_Font_LowQuality

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

LoadFont() #PB_Font_LowQuality

Post 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.
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post 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:
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

I really don't know. I hope so. :roll:
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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... ;)
oh... and have a nice day.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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


Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Thank you! :D
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

Well I done been told! 8)
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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?
oh... and have a nice day.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: LoadFont() #PB_Font_LowQuality

Post 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.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
oakvalley
User
User
Posts: 77
Joined: Sun Aug 08, 2004 6:34 pm
Location: Norway
Contact:

Re: LoadFont() #PB_Font_LowQuality

Post 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.
Regards Stone Oakvalley
Currently @ PB 5.70
Post Reply