incbin font
BlitzMax Forums/BlitzMax Beginners Area/incbin font
| ||
Hi, I'm running Blitzmax 1.09 under OSX Tiger and I cannot get incbin working with fonts. My code is: Incbin "davefont.ttf" Global newfont=LoadImageFont("incbin::davefont.ttf", 20) Everything works OK, but as soon as I move the executable out of the folder with the font file, the game reverts back to default Blitzmax font (ie it does not seem to be including the font with the executable). I thought this was implemented in 1.06 - have I just written it wrongly? cheers, Dave. |
| ||
The help file includes the example below.According to it, your implementation looks correct. Rem IncBin embeds an external data file in a BlitzMax program that can then be read using the "incbin::" device name. End Rem ' code snippet from demos/firepaint/firepaint.bmx Incbin "stars.png" Local stars=LoadImage( "incbin::stars.png" ) |
| ||
This works for me:Graphics 640,480,0,0 Incbin "c:\windows\fonts\times.ttf" Global newfont:TImageFont = LoadImageFont("incbin::c:\windows\fonts\times.ttf",20) SetImageFont(newfont) While Not KeyDown(KEY_ESCAPE) Cls DrawText "Test", MouseX(), MouseY() Flip Wend End *EDIT* it also worked when I copied times.ttf to the source folder, removed the absolute pathing then moved the resulting exe to another folder. |
| ||
Maybe it's a Macos X tiger issue ? |
| ||
I get the same problem.I include the fonts as follows Incbin "alex.ttf" Incbin "sphere.png" Incbin "turbogirl.ogg" audio=LoadSound ("incbin::turbogirl.ogg") alex=LoadImageFont("incbin::alex.ttf",200) but the compiled app defaults to the basic system font. |
| ||
I'm pretty sure this is a Macos bug. Graphics 640,480,0 Incbin "alex.ttf" Local font:TImageFont=LoadImageFont("incbin::alex.ttf",200 ) SetImageFont font While Not KeyHit( KEY_ESCAPE ) Cls DrawText "This is test",0,0 Flip Wend Works fine when I click on compile and build.However when I move the .app file to another dir it defaults to the system font.If I copy the font to that location it works fine again. |
| ||
I'm pretty sure this is a Macos bug. I don't have a Mac to play with but it's a little weird if it's OSX specific since the code for loading imagefonts and the incbin code doesn't appear to have anything mac specific. |
| ||
I can't get it to work either with Blitz Max 1.10 on Mac OS X 10.4.2 (Tiger). Does anyone know for certain whether it's definitely a Mac OS bug? |
| ||
If it works fine on Windows for everybody and doesn't work for anyone on Mac, than yes, I'd say it smells like a Mac-specific issue. ;) |
| ||
Yeah - incbin'd fonts stopped working in my project with the latest update. They're in a separate folder, so this explains it. Stuck a bug report in about a month ago. Works fine on my Windows box, no font on OSX. |
| ||
Yep IGlass has the same issue, works on Windows not on OSX |
| ||
Thanks guys, it appears that LoadFont (BRL.Font) is returning a Null. I'll do some more investigating tomorrow and see if I can come up with an interim patch. Mac 12" PB G4/1.5GHz/1.25Gb/GeForce FX Go5200/Tiger 10.4.2/Blitz Max 1.10 |