#PB_Font_HighQuality doesnt seem to work

Just starting out? Need help? Post your questions and find answers here.
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

#PB_Font_HighQuality doesnt seem to work

Post 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
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: #PB_Font_HighQuality doesnt seem to work

Post 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.
BERESHEIT
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: #PB_Font_HighQuality doesnt seem to work

Post 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
User avatar
Shardik
Addict
Addict
Posts: 2076
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: #PB_Font_HighQuality doesnt seem to work

Post 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!).
Post Reply