Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem lining up same font with different heights.
#2
The best I can figure, without seeing the pixel grid, is the difficulty stems from different characters like a j and an I being at different bottom starting pixels, and when we increase the size, this causes the distortion.

Oh, I had to edit the above post. Messing around with it to see how it looked with and without the _FontHeight, I forgot to put the underscore back when I pasted it in the post. It's correct now.

Anyway, this code may not be the best, but it's getting close to whatever the correct algorithm might be to solve for this problem...

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& * .75), "O"
_Font (f&(2))
fh& = _FontHeight
_PrintString (50, row - fh& * .75), "O"
_Font (f&(3))
fh& = _FontHeight
_PrintString (80, row - fh& * .75), "O"
_Font (f&(4))
fh& = _FontHeight
_PrintString (110, row - fh& * .75), "O"
_Font (f&(5))
fh& = _FontHeight
_PrintString (140, row - fh& * .75), "O"
_Font (f&(6))
fh& = _FontHeight
_PrintString (170, row - fh& * .75), "O"
_Font (f&(1))

Pete
Reply


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



Users browsing this thread: 10 Guest(s)