Page 1 of 1

#PB_Font_HighQuality doesnt seem to work

Posted: Fri Jan 15, 2016 4:49 pm
by Keya
i tried the following code to test the difference between DrawText() and DrawVectorText(), with and without using the #PB_Font_HighQuality LoadFont() flag...

I tested on WinXP-32 and Win7-64, and i tested with and without ClearType on, and i tested it with several different fonts - Arial, Times New Roman, Courier New, and i zoomed in with Photoshop for confirmation

but not in any test was there ever a difference, as you can see from the screenshot. So am i missing something here? just my (two) systems perhaps? all four of these texts should be slightly different -
Image

Code: Select all

FontNormal  = LoadFont(#PB_Any, "Arial", 14, #PB_Font_Bold)
FontQuality = LoadFont(#PB_Any, "Arial", 14, #PB_Font_Bold | #PB_Font_HighQuality)
 
OpenWindow(0, 0, 0, 440, 120, "Test #PB_Font_HighQuality", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 0, 0, 440, 120)

Text$ = "The quick brown fox jumped over the lazy dog"

;DRAWTEXT()
If StartDrawing(CanvasOutput(0))
  DrawingMode(#PB_2DDrawing_Transparent)
  DrawingFont(FontID(FontNormal))
  DrawText(5,1,Text$,RGB(0,0,0))
  
  DrawingFont(FontID(FontQuality))
  DrawText(5,31,Text$,RGB(0,0,0))
  StopDrawing()
EndIf            

;DRAWVECTORTEXT()
If StartVectorDrawing(CanvasVectorOutput(0))
  VectorFont(FontID(FontNormal))
  MovePathCursor(5,61)
  DrawVectorText(Text$)
  
  VectorFont(FontID(FontQuality))
  MovePathCursor(5,91)
  DrawVectorText(Text$)
  StopVectorDrawing()
EndIf

Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow

Re: #PB_Font_HighQuality doesnt seem to work

Posted: Sun Jan 17, 2016 7:13 pm
by netmaestro
I think it's pretty much a throwback to the old days when the default presentation for fonts was no anti-alias. Nowadays fonts have improved along with processor power and the technologies used for displaying them, such as ClearType, Silverlight and Retina, so the default presentation is already #PB_Font_HighQuality. I've been looking for this flag to be deprecated for awhile now, imho it's useless in today's computing environment. Work on PureBasic was started decades ago and at the time it was needed.

Re: #PB_Font_HighQuality doesnt seem to work

Posted: Mon Jan 18, 2016 3:04 am
by Keya
ahh, thankyou very much for clarifying. its interesting that it doesnt even work on my old XP32 though so perhaps it's Win9x legacy!
the default presentation is already #PB_Font_HighQuality. I've been looking for this flag to be deprecated for awhile now, imho it's useless in today's computing environment.
Sometimes though i just want those raw pixels without any modifications like ClearType/smoothing, so if the option was kept there for both that'd be great, but either way a bit of clarification in the helpfile would be great

Re: #PB_Font_HighQuality doesnt seem to work

Posted: Mon Jan 18, 2016 3:37 pm
by Shardik
Keya wrote:Sometimes though i just want those raw pixels without any modifications like ClearType/smoothing, ...
For examples on how to display raw text (without anti-aliasing) on MacOS X and Linux, you may take a look into this MacOS X example by Danilo or into this Linux example by me (needs subsystem "gtk2" in PB 5.41!).