Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

New Developer
Posts: 6
Registered: ‎03-06-2011
My Device: Not Specified
Accepted Solution

Embedded fonts stopped working?


I have built a simple app for the playbook. As it was my first time I built off the AIRHelloWorld example. When I was finished I figured I would have to change that name so in my ignorance I created a new project with the correct name, then started coping things over.


When I tested the newly copied over project I found that none of my textboxes were working. After some trouble shooting it ended up being that my embedded fonts (which DID work) were no longer displaying!


I've not tried to fix it for a few HOURS and then tried starting over with the AIRHelloWorld tutorial and trying to re-make the project and make it work with NO LUCK... I'm at my end here! Please help!


I embedded the font like this:


1. I made a new folder in the src dir named "fonts"

2. imported the font from a folder on my desktop into the fonts folder


Then used this code:




[Embed(source='/fonts/FakeReceipt.ttf', fontName="TestFont", mimeType="application/x-font-truetype")]
 public static const TestFontTTFSmiley Frustratedtring;
In my class BEFORE my constructor

Then created a style
outputStyle = new TextFormat();
outputStyle.font = "TestFont";
outputStyle.size = 35;
outputStyle.align = "right";
Then created a textField
outputTextBox = new TextField();
outputTextBox.embedFonts = true
outputTextBox.text = "This is text!";
outputTextBox.width = 150;
outputTextBox.defaultTextFormat = outputStyle;


If embedFonts = true then nothing shows up. If I change it to false then I get text, but obviously without the correct font.


I was SO close to finished and now feel very confused.  I thank you for your help!

Posts: 382
Registered: ‎05-19-2008
My Device: BlackBerry Torch
My Carrier: AT&T

Re: Embedded fonts stopped working?

I use an embedded font in my app which was built using 0.9.3., I'm not at my dev station now to compare code, so I can only say that I haven't seen a change in behavior and its still working fine. I will say that I followed a post by Renaun and it worked flawlessly. search these forums for his post and see if its different.

Check out my book on BlackBerry Development for Java.
And my other really really old book
My Apps: FlashKids
Posts: 192
Registered: ‎09-23-2009
My Device: 9860/PlayBook/Dev Alpha
My Carrier: Plus GSM

Re: Embedded fonts stopped working?

If you are using Burito 4.5 there was a change in embedded fonts (which breaks backward compatibily, the most stupid thing in Air/Flex/etc).


Add this code to Embed tag:

Found my post helpfull? Like it! It solves your trouble? Help others and accept it as solution. Search before asking.
My apps: Secret Cod3s | Should my tablet be banned?
Jakub Nietrzeba
PGS Software S.A.
Your reliable partner in Poland - IT Outsourcing - BlackBerry, iPhone, Web and Standalone applications
New Developer
Posts: 6
Registered: ‎03-06-2011
My Device: Not Specified

Re: Embedded fonts stopped working?

Just to close this out. I figured it all out, much thanks to those that posted.


It was a combination of issues.


The font I was using would not transcode correctly if I added the CFF=false flag.  Eventually I figured out that it was the rendering engine causing problems and going with the old font renderer AND the CFF=false resolved it.



So, for anyone else that runs into a similar issue:


In the project -> properties -> compiler : Additional Compiler 

Add the line :

-managers flash.fonts.AFEFontManager


In the code:


Add , embedAsCFF="false" to the embed tag like so



[Embed(source='/fonts/fontName.ttf', fontName="TestFont", mimeType="application/x-font-truetype", embedAsCFF="false")]
public static const TestFontTTFSmiley Frustratedtring;


New Developer
New Developer
Posts: 17
Registered: ‎07-08-2010
My Device: Bold 9700
My Carrier: Rogers

Re: Embedded fonts stopped working?

Thanks Tacroy,


Mine stopped working too.  Your fix saved me a lot of time.  Thanks!

Posts: 32
Registered: ‎02-02-2011
My Device: Playbook
My Carrier: none

Re: Embedded fonts stopped working?

[ Edited ]

the embed tag described is for Flash Builder only I believe. anyone know how to implement this issue for a Flash Pro user?  please spell it out for a nube. thanks. (i have it embedded in the usual method through the properties window but it is not passing the font to the playbook.)

Dirty Kitchen Cooking Timer