image fonts on mac OSX broken?

Archives Forums/MacOS X Discussion/image fonts on mac OSX broken?

Alexandre(Posted 2008) [#1]
Hi

I'm not clear about the loading of image fonts Mac OSX (10.5 Leopard).

I tried this:
Local f:TImageFont=LoadImageFont("/Library/Fonts/Arial Unicode.ttf",1)

Though the file exists and is interpreted as a Windows TrutType font by the system, f still equals Null after the call, hence indicating inability of BlitzMax to load such fonts.

Thanks in advance for any advice.
Alex


Brucey(Posted 2008) [#2]
As a full app :
Local f:TImageFont=LoadImageFont("/Library/Fonts/Arial Unicode.ttf",1)

If Not f Then
DebugLog "woops"
End If

That runs for me and I get no output - indicating that it loaded okay.

I would guess that if you are using Framework, you are missing an Import of something. Perhaps BRL.FreeTypeFont


Alexandre(Posted 2008) [#3]
Thanks Brucey.

I was not using Framework, so no issue with autoloading of all modules, BRL.FreeTypeFont included.

No, my booboo was forgetting to activate a current Graphics object with a prior call to Graphics or SetGraphics.

A simple test for smooth aliasing on OSX that now works...

Graphics 400,400
font:TImagefont = LoadImageFont ("/Library/Fonts/Arial Unicode.ttf", 36, SMOOTHFONT)
SetImageFont (font)
SetBlend AlphaBlend
SetScale 0.5,0.5
DrawText "HELLO WORLD",0,0
Flip
WaitKey ()


Thanks
Alex