Why does this happen? (fonts)

BlitzMax Forums/BlitzMax Programming/Why does this happen? (fonts)

Who was John Galt?(Posted 2007) [#1]
Running the code below, use Q and A keys to change the width of the font. When the font gets down to a certain width, it's vertical resolution jumps from normal to bloktastic. Is this a bug?

Graphics 800,600,32,60
font:TimageFont=LoadImageFont("Jedi Normal.ttf",48)
SetImageFont(font)
SetBlend ALPHABLEND
sx#=1.0
Repeat
	Cls
	If KeyDown(KEY_Q) sx:+0.001
	If KeyDown(KEY_A) sx:-0.001
	SetScale sx,1.0
	DrawText "hellooOO!!",100,100
	Flip
Until KeyHit(KEY_ESCAPE)


The font I was using...
<EDIT> Last link wasn't a free one. This is...
www.searchfreefonts.com/fonts/j7.htm
It's the top font on the page.


Vlad(Posted 2007) [#2]
try insert this code for complete testing font load:
font:TimageFont=LoadImageFont("Jedi Normal.ttf",48)
if font = 0
  Notify "font not load"
  end
endif

solution: have to use full path to font as "C:\MyProjects\Media\Jedi Normal.ttf"


Who was John Galt?(Posted 2007) [#3]
Thanks, Vlad, but that's no the problem. The font loads fine... stick that mod in if you need it to get things working your end. Do you not see the problem I mention in my first post?


TaskMaster(Posted 2007) [#4]
I do not have that Jedi font, but with the standard system font, when I held down the a key, the word eventually ended up being printed backwards, I guess sx went negative.

The font never jumped to bloktastic, whatever that means. What does bloktastic mean?


Grey Alien(Posted 2007) [#5]
HAve you tried loading it with the smoothing flag?


Who was John Galt?(Posted 2007) [#6]
Hi guys.

What I mean by blocktastic: Suddenly jumps to a vertical resolution of about 8 pixels instead of the 48 I loaded it at. The horizontal resolution seems un-affected. This is whilst sx is still >0.

I would really appreciate if someone could repeat with the same font (the link's in my original post), and see if they get the same effect.

Grey: Yeah tried the smoothing flag.. same result. SMOOTHFONT is the default anyways according to the docs, but they could be wrong.


TaskMaster(Posted 2007) [#7]
That link takes me to a page to buy the font. No free download that I can see. Sorry, I am not going to buy that font. :)


Who was John Galt?(Posted 2007) [#8]
Sorry mate... I already had the font just found a quick link for it. I didn't realise it was a paid one... it even says FREE in the URL! I promise this was not some confidence skam to get a few pennies out of my fellow Blitzers!

This one is free..
http://www.searchfreefonts.com/fonts/j7.htm

It's the top one on the page.


TaskMaster(Posted 2007) [#9]
OK, got your font and ran it. I still did not see any crazy change in the vertical size of the font.

I am running WinXP if that maybe matters some how...

Editted: No change in vertical size at all...


Who was John Galt?(Posted 2007) [#10]
Thanks for that, TaskMaster.

Just to clarify, the font doesn't get smaller vertically. It just goes blocky in the vertical plane. I guess this doesn't change your answer, so it's something specific to my setup. I'm on XP too.