Windows font (Tahoma) problems

BlitzMax Forums/BlitzMax Beginners Area/Windows font (Tahoma) problems

iprice(Posted 2008) [#1]
I'm able to load in a Windows font into my Max app, but the resulting text doesn't appear the same as it would in a windows menu - the kerning is wrong and the font image is slightly different

For instance -

Graphics 800,600,0,60

Global font=LoadImageFont("C:/windows/fonts/tahoma.ttf",11)

SetImageFont font

While Not KeyHit(KEY_ESCAPE)

SetColor 236,233,216
DrawRect 0,0,800,19

SetColor 255,255,255
DrawLine 0,19,800,19

SetColor 172,168,153
DrawLine 0,20,800,20

SetColor 0,0,0

DrawText "File    Edit    Program   Help",6,2

Flip

Cls

Wend

End


Run this and compare it to the the Max menu and there are lots of differences. It doesn't matter what graphics driver is set or if you use SMOOTHFONT etc. it always appears differently.

Without using bitmpas, is there a way of making the text look more like the Windows version? This is just something that came up and although unimportant in the grand scheme of things, it interested me.


Brucey(Posted 2008) [#2]
How about adding :

SetBlend ALPHABLEND

And see if that helps at all.


iprice(Posted 2008) [#3]
It's a bit smoother, but the kerning is still all wrong.

Not to worry.

Thanks Brucey.


JazzieB(Posted 2008) [#4]
I don't think there is any kerning with ImageFonts.


iprice(Posted 2008) [#5]
There is basic kerning - look at the difference in size/position between a W and an I. Perhaps this is as good as it gets.

Like I said, it's just something that came up that I was interested in.


Kistjes(Posted 2008) [#6]
You use the wrong font.
Graphics 800,600,0,60

Global font=LoadImageFont("C:/windows/fonts/sserife.fon",14,0)

SetImageFont font
SetBlend(ALPHABLEND)
While Not KeyHit(KEY_ESCAPE)

SetColor 236,233,216
DrawRect 0,0,800,19

SetColor 255,255,255
DrawLine 0,19,800,19

SetColor 172,168,153
DrawLine 0,20,800,20

SetColor 0,0,0

DrawText "File    Edit    Program   Help",6,2

Flip

Cls

Wend

End



iprice(Posted 2008) [#7]
You are indeed correct. Info over the internet pointed to Tahoma for Windows XP dialogues/menus etc. They certainly look very similar. You just can't believe anything on the net :P

Thankyou Kistjes. :)