A quoi sert #PB_Font_HighQuality?
Publié : ven. 17/févr./2023 16:19
Sur un Windows 10 x64 à jour avec PB6.01b3, j'ai comparé toutes les solutions de rendu de police (que je connais) et je n'ai pas réussi à voir la moindre différence : elles sont toutes absolument identiques au pixel prêt.
Alors, j'ai quelques questions : est-ce que c'est normal ? Est-ce que c'est une vieille fonctionnalité dépréciée ? Et la plus importante : pourquoi est-ce que DrawVectorText() n'utilise pas ClearType comme les autres approches ? Le rendu des polices sous Windows est déjà vilain, alors ça m'embête de voir ce résultat encore enlaidi.

Code : Tout sélectionner
If OpenWindow(0, 0, 0, 800, 470, "#PB_Font_HighQuality", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 0, 0, 800, 470, #PB_Canvas_Container)
LoadFont(0, "Arial", 20, #PB_Font_HighQuality)
LoadFont(1, "Arial", 20)
If StartVectorDrawing(CanvasVectorOutput(0))
VectorFont(FontID(0))
MovePathCursor(10, 9)
DrawVectorText(~"HighQuality VectorText:\nThe quick brown fox\njumps over the lazy dog")
MovePathCursor(10, 120)
DrawVectorParagraph(~"HighQuality VectorParagraph:\nThe quick brown fox\njumps over the lazy dog",400, 200)
VectorFont(FontID(1))
MovePathCursor(410, 9)
DrawVectorText( ~"LowQuality VectorText:\nThe quick brown fox\njumps over the lazy dog")
MovePathCursor(410, 120)
DrawVectorParagraph( ~"LowQuality VectorParagraph:\nThe quick brown fox\njumps over the lazy dog",400, 200)
StopVectorDrawing()
StartDrawing(CanvasOutput(0))
DrawingMode(#PB_2DDrawing_Transparent)
FrontColor($000000)
DrawingFont(FontID(0))
DrawText(10, 230, "HighQuality RasterText:")
DrawText(10, 263, "The quick brown fox")
DrawText(10, 296, "jumps over the lazy dog")
DrawingFont(FontID(1))
DrawText(410, 230, "LowQuality RasterText:")
DrawText(410, 263, "The quick brown fox")
DrawText(410, 296, "jumps over the lazy dog")
StopDrawing()
TextGadget(1, 10, 345, 400, 200, ~"HighQuality TextGadget:\nThe quick brown fox\njumps over the lazy dog")
SetGadgetColor(1, #PB_Gadget_BackColor, $FFFFFF)
SetGadgetColor(1, #PB_Gadget_FrontColor, $000000)
SetGadgetFont(1, FontID(0))
TextGadget(2, 410, 345, 400, 200, ~"LowQuality TextGadget:\nThe quick brown fox\njumps over the lazy dog")
SetGadgetColor(2, #PB_Gadget_BackColor, $FFFFFF)
SetGadgetColor(2, #PB_Gadget_FrontColor, $000000)
SetGadgetFont(2, FontID(1))
EndIf
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf