custom fonts don't load properly

Thanks for the info. I’m using 2 custom fonts and I also had a problem to load the second one, but after some experiments with the family name after # sign - it works. I marked which name after # worked for me with each font. Maybe the font that you can’t load would load with the other name? Notice in the upper font name there are differences with spaces and underlines, so it’s not in the same place as the names that worked for the second font.

fvz9xe.jpg

Oh interesting.  I was using the font name displayed under the Print and Install buttons.  I didn’t think of trying the other names.  Just another reason to parse it out of the font file myself.  It’s a future TODO item I’ve written for myself.

Joshua, 

There’s another issue with the new CoronaCards build (2369). I can display custom fonts once but when I update the handler’s text value with a new string - the object disappears and the text is not visible anymore. I checked and downgraded to 2357 - the problem didn’t occur so something happened in the new version.

UPDATE: when I tried to update text with a 10ms timer - I usually get the text value updated, not always though. 

Hmm… I think it’s because Microsoft’s text render is failing to get a hold of the rendering thread because Corona dominates it while in 60 FPS mode.  I bet you it would be 100% reliable at 30 FPS.  *sigh*

I’ll dig into this after we finish the Native/Lua bridge feature.  I have a pretty good idea on how to solve this issue, but unfortunately it would involve increasing the time to create/update text… at least for 60 FPS apps.  It involves aborting our usage of the rendering thread temporarily and relinquishing control of it to Microsoft’s XAML framework to do text rendering, which is GPU bound too.

You’re right! I’ve just made a 30fps build and it worked fine. And yes, let’s keep the bridge as the priority for now. 

Just letting know about this issue for future.

Any updates to custom fonts? Ive been trying to implement this using the above but its not working. I also looked at this:

http://abnady.wordpress.com/2013/12/17/adding-custom-fonts-to-windows-store-app/

We’ve added custom font support about 2 months ago.  You need to put the font files under your Corona project directory (ie: Assets\Corona) just like you would for Android and iOS.  And you need to specify both the font file name and its font family name (separated by a # sign) as I’ve posted here…

   http://forums.coronalabs.com/topic/49040-custom-fonts-dont-load-properly/?p=253994

Just note that there are some font file formats that WP8 will refuse to load.  We think it’s due to licensing/royalty issues.  If the font file you’re trying to load doesn’t work, then try another font file.  I recommend that you grab a font that you’ll know for sure will work for testing purposes, like Arial or Comic Sans from your system’s “C:\Windows\Fonts” directory.

Yeah I did try that. Illl try a few others. 

At least I Know it works

Maybe this will help you.  A good way to find out the font family name of your font file is to double click on it in Windows.  A window will popup showing you the “Font name:” at the top let corner, although that might not always be the font family name as whammy has noted in his screenshot up above.  You may have to try the other font names displayed in the window as well, like what is shown in the title bar.

Sorry… I wish this was a bit easier, but we’re actually following the font naming conventions dictated by Microsoft’s WPF/XAML framework.  Meaning that it’s not any better for .NET developers either.  I suppose a simpler means would be for us to parse for the font family name in the file ourselves, but since text rendering is so slow on WP8, there hasn’t been a lot of motivation to put any more time into this on our end.

The text updating issue for 60 FPS apps has been resolved in build #2398, which should be made available later today.  Probably doesn’t apply to you anymore since you’ve switched to bitmap fonts, but I just wanted to post that it’s solved in case it has affected anyone else.

Nope it doesn’t but thanks for letting me know. I might use custom fonts in my future projects.

BTW: I’m still waiting for the second QA review. This time it takes a little bit longer.

This thread was great. I got my custom font working on my windows phone 8.1 app! 

Glad you got it working spacewolf!  And welcome to WP8 development too.  :slight_smile:

I was trying to get this to work for a good while with no luck.

Custom fonts worked with arial.ttf and Comic Sans MS.ttf but failed with all my less Microsoft-y custom fonts.

Right-clicking the font, selecting properties and setting “Build Action” to “content” fixed the problem. 

I used a free program, FontForge, to the get the font family name.

Any updates to custom fonts? Ive been trying to implement this using the above but its not working. I also looked at this:

http://abnady.wordpress.com/2013/12/17/adding-custom-fonts-to-windows-store-app/

We’ve added custom font support about 2 months ago.  You need to put the font files under your Corona project directory (ie: Assets\Corona) just like you would for Android and iOS.  And you need to specify both the font file name and its font family name (separated by a # sign) as I’ve posted here…

   http://forums.coronalabs.com/topic/49040-custom-fonts-dont-load-properly/?p=253994

Just note that there are some font file formats that WP8 will refuse to load.  We think it’s due to licensing/royalty issues.  If the font file you’re trying to load doesn’t work, then try another font file.  I recommend that you grab a font that you’ll know for sure will work for testing purposes, like Arial or Comic Sans from your system’s “C:\Windows\Fonts” directory.

Yeah I did try that. Illl try a few others. 

At least I Know it works

Maybe this will help you.  A good way to find out the font family name of your font file is to double click on it in Windows.  A window will popup showing you the “Font name:” at the top let corner, although that might not always be the font family name as whammy has noted in his screenshot up above.  You may have to try the other font names displayed in the window as well, like what is shown in the title bar.

Sorry… I wish this was a bit easier, but we’re actually following the font naming conventions dictated by Microsoft’s WPF/XAML framework.  Meaning that it’s not any better for .NET developers either.  I suppose a simpler means would be for us to parse for the font family name in the file ourselves, but since text rendering is so slow on WP8, there hasn’t been a lot of motivation to put any more time into this on our end.

This thread was great. I got my custom font working on my windows phone 8.1 app! 

Glad you got it working spacewolf!  And welcome to WP8 development too.  :slight_smile: