Forum Discussion
Altera_Forum
Honored Contributor
16 years agoTruetype font loading problem
I am trying to load in a truetype font, which is the "lt1-r-omega-serif.ttf" that is in the build. This font is located in "/usr/fonts/truetype/lt1-r-omega-serif.ttf" on the target system.
This is from adding the FreeType 2 fonts in the build with make menuconfig. I have created a simple application to put "hello world" on the screen using this font. the code has the line: font = grcreatefont("/usr/fonts/truetype/lt1-r-omega-serif.ttf",3,null); Compile seems to be fine, but when I run this application on the target system, the following error occurs: fnt_createfont: /usr/fonts/truetype/lt1-r-omega-serif.ttf,3 not found Does anyone know how I can get this routine to find the font? Thanks, Scott4 Replies
- Altera_Forum
Honored Contributor
At the risk of asking a silly question, have you ensured that the TTF file is in your rootfs?
Cheers, - slacker - Altera_Forum
Honored Contributor
Yes, the file is in the file system. It's located in the directory "/usr/fonts/truetype/lt1-r-omega-serif.ttf"
Do you know if I have to set any special permissions for the font file? Any other suggestions of things to look at would be greatly appreciated. - Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE (schaney @ Sep 4 2009, 07:31 AM) <{post_snapback}> (index.php?act=findpost&pid=23746)</div>
--- Quote Start --- Yes, the file is in the file system. It's located in the directory "/usr/fonts/truetype/lt1-r-omega-serif.ttf" Do you know if I have to set any special permissions for the font file? Any other suggestions of things to look at would be greatly appreciated.[/b] --- Quote End --- I had the same problem and I think the solution was to clean the microwin (make clean user/microwin or something like this). I think it worked for me. In my case the system continued giving me the same error (i think hippo said tha it was a code error) but the font was correctly loaded. Sorry for not to be more precise in my answer. I hope it will help you! - Altera_Forum
Honored Contributor
You may skip this warning. I will try to remove it when I got some time. The font is actually created. In case the font file is really missing, the message will be
Nano-X-Freetype2: Can't load font from file "/usr/fonts/truetype/lt1-r-omega-serif.ttf" - 1 - Hippo