[PB 5.72/5.73 x64] DrawRotatedText () problem
Posted: Mon May 01, 2023 12:43 am
Hi,
For my CAD program I want to use a Measurement Tool.
I like to use DrawRotatedText () for this.
but I have some problems ...
1) The quality of the text is very bad if not on a multiple of 90.0 deg.
Even when I use HightQuality when loading the font
LoadFont (0, "Courier New", 10, #PB_Font_HighQuality)
2) If the text is rotated 0.0, 90.0, 180.0, 270.0, the Y position is OK
Else the Y position have an offset other than when using multiples of 90.0 deg.
See images below and testcode.
Q1) How can I optimize/improve the font quality ?
Q2) What can I do for having the same Y position in every rotation ?



[PB 5.72/5.73 x64] Win 8.1/10 / OPENGL
Thanks for testing,
Marc
For my CAD program I want to use a Measurement Tool.
I like to use DrawRotatedText () for this.
but I have some problems ...
1) The quality of the text is very bad if not on a multiple of 90.0 deg.
Even when I use HightQuality when loading the font
LoadFont (0, "Courier New", 10, #PB_Font_HighQuality)
2) If the text is rotated 0.0, 90.0, 180.0, 270.0, the Y position is OK
Else the Y position have an offset other than when using multiples of 90.0 deg.
See images below and testcode.
Q1) How can I optimize/improve the font quality ?
Q2) What can I do for having the same Y position in every rotation ?



[PB 5.72/5.73 x64] Win 8.1/10 / OPENGL
Thanks for testing,
Marc
Code: Select all
EnableExplicit
Global Event.i
If InitSprite () = 0
MessageRequester("Error", "Can't open the [SPRITE] system", 0)
End
EndIf
If InitKeyboard () = 0
MessageRequester("Error", "Can't open the [KEYBOARD] system", 0)
End
EndIf
If InitMouse () = 0
MessageRequester("Error", "Can't open the [MOUSE] system", 0)
End
EndIf
LoadFont (0, "Courier New", 10, #PB_Font_HighQuality)
OpenWindow (1, 0, 0, 800, 600, "Test", #PB_Window_SystemMenu) ; | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget)
OpenWindowedScreen ( WindowID (1), 0, 0, 800, 600, 0, 0, 0, #PB_Screen_NoSynchronization)
Repeat
Event = WaitWindowEvent ()
Select Event
EndSelect
ExamineKeyboard ()
ExamineMouse ()
ClearScreen ($000000)
StartDrawing ( ScreenOutput ())
DrawingMode (#PB_2DDrawing_Default)
LineXY (200, 300, 400, 300, $FFE0E000)
LineXY (200, 300, 400, 100, $FFE0E000)
LineXY (200, 300, 200, 100, $FFE0E000)
LineXY (200, 300, 400, 500, $FFE0E000)
LineXY (200, 300, 200, 500, $FFE0E000)
DrawingMode (#PB_2DDrawing_Transparent | #PB_2DDrawing_AlphaBlend)
DrawingFont ( FontID (0))
DrawRotatedText (200, 300, " Test Rotated Text - 0.0 deg", 0.0, $FFE0E0E0)
DrawRotatedText (200, 300, " Test Rotated Text - 45.0 deg", 45.0, $FFE0E0E0)
DrawRotatedText (200, 300, " Test Rotated Text - 90.0 deg", 90.0, $FFE0E0E0)
DrawRotatedText (200, 300, " Test Rotated Text - 315.0 deg", 315.0, $FFE0E0E0)
DrawRotatedText (200, 300, " Test Rotated Text - 270.0 deg", 270.0, $FFE0E0E0)
StopDrawing ()
FlipBuffers ()
Delay (1)
Until KeyboardPushed (#PB_Key_Escape) Or Event = #PB_Event_CloseWindow
End
