Grunz wrote:I can't find a way to make PB draw smooth = anti-aliased text.
At least not using the sprite & screen stuff. (Did not test gadgets)
I can make it use different fonts/sizes, but they all look ugly under Windows.
Hi Grunz. I could be misunderstanding your point, but is this what you're talking about:
Code: Select all
EnableExplicit
UseJPEGImageDecoder()
UsePNGImageDecoder()
Enumeration
#Window
#Text
#Font
#Sprite
EndEnumeration
Define.s fileFilter, spriteFileName, wFlags.i
LoadFont(#Font, "Arial", 24)
wFlags = #PB_Window_SystemMenu | #PB_Window_ScreenCentered
If InitSprite() And OpenWindow(#Window, 0, 0, 300, 300, "Fonts on Window & Screen", wFlags)
TextGadget (#Text, 20, 10, 280, 30, "ABCDEFGHIJK...")
SetGadgetFont(#Text, FontID(#Font))
If OpenWindowedScreen(WindowID(#Window), 10, 50, 280, 240, 0, 0, 0)
fileFilter = "Graphic Files (BMP JPG PNG)|*.bmp;*.jpg;*.png"
spriteFileName = OpenFileRequester("Select image to use:", "C:\", fileFilter, 0)
If spriteFileName And LoadSprite(#Sprite, spriteFileName)
DisplaySprite(#Sprite, 0, 0)
StartDrawing(ScreenOutput())
DrawingFont(FontID(#Font))
DrawingMode(#PB_2DDrawing_Transparent)
DrawText(10, 10, "ABCDEFGHIJK...", #Black)
StopDrawing()
EndIf
EndIf
EndIf
While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend
The font results are pretty good, both on the window as well as on the screen, which is drawn alongside the displayed sprite. Perhaps this is not what you mean?