Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem lining up same font with different heights.
#1
Code: (Select All)
$Color:32
Screen _NewImage(1300, 600, 32)
_ScreenMove 20, 0
Cls: _Display
Dim f&(6)
f&(1) = _LoadFont(Environ$("SYSTEMROOT") + "\Fonts\lucon.ttf", 16)
f&(2) = _LoadFont(Environ$("SYSTEMROOT") + "\Fonts\lucon.ttf", 20)
f&(3) = _LoadFont(Environ$("SYSTEMROOT") + "\Fonts\lucon.ttf", 24)
f&(4) = _LoadFont(Environ$("SYSTEMROOT") + "\Fonts\lucon.ttf", 30)
f&(5) = _LoadFont(Environ$("SYSTEMROOT") + "\Fonts\lucon.ttf", 38)
f&(6) = _LoadFont(Environ$("SYSTEMROOT") + "\Fonts\lucon.ttf", 48)
f& = 1: _Font f&(f&)
Line (20, 201)-(200, 201)
row = 200
_Font (f&(1))
fh& = _FontHeight
_PrintString (20, row - fh&), "O"
_Font (f&(2))
fh& = _FontHeight
_PrintString (50, row - fh&), "O"
_Font (f&(3))
fh& = _FontHeight
_PrintString (80, row - fh&), "O"
_Font (f&(4))
fh& = _FontHeight
_PrintString (110, row - fh&), "O"
_Font (f&(5))
fh& = _FontHeight
_PrintString (140, row - fh&), "O"
_Font (f&(6))
fh& = _FontHeight
_PrintString (170, row - fh&), "O"
_Font (f&(1))

I thought subtracting the height of the font from the row would make the bottoms of each character align themselves horizontally on the line. What I noticed is that as the font size is increased, the larger character prints progressively slightly higher, above the line. Is there a remedy for this, and not just with lucon fonts, but others as well?

Pete
Reply


Messages In This Thread
Problem lining up same font with different heights. - by Pete - 08-02-2024, 03:01 PM



Users browsing this thread: 8 Guest(s)