Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1021
  • Last Modified:

embedFont = true causes the text to disappear in flash

Hi guys,

I am currently building a dynamic carousel type project in flash. It's run via an XML file. So I am dynamically creating everything including a text field which sits underneath the image. The problem is this. As the text field is dynamic, i need to dynamically set/embed the font (Helvetica). I have create a new font in my library and given it the linkage name fHelvetica.

Below is the code with which I am attempting to set the textfields formatting.

On runtime, the text within the text area does not display if i have embedFont=true. If i set it to false, it does not recognise fHelvetica and just displays in Times New Roman (default).

Any help would be amazing, really in a rush to get this fixed now.
// Style vars
var oFontStyle:Font = new fHelvetica();
var oBoothTitleFormat:TextFormat=new TextFormat();
oBoothTitleFormat.bold=true;
oBoothTitleFormat.font="fHelvetica";
oBoothTitleFormat.size=16;
 
var oText:TextField=oMovie.createTextField("oBoothTitle"+nId,_root.oBoothHolder.getNextHighestDepth(),0,0,0,0);
oText.wordWrap=false;
oText.autoSize=true;
oText.embedFonts=true;
oText.text=_oBoothCache[0][1]//"Test text";
oText.setTextFormat(oBoothTitleFormat);

Open in new window

0
jhaley-telecomtv
Asked:
jhaley-telecomtv
  • 4
  • 2
1 Solution
 
Aneesh ChopraCommented:
Flash is sometime really unpredictable :)

when creating font symbol does not work for any reason.
Just try following method..


1. Create a dynamic textField in FLA before the frame where you need to use the font in script first time.
2. place the dynamic textField out of the stage area so that it should not be visible when application runs.
3. Select the textField and set the font you want to embed, (in your case it is Helvetica)
4. Now embed all required font glyphs into the textField using "embed fonts" button in properties panel.

5. Just compile your application and now all should be working fine

-------------------
Aneesh Chopra
-------------------


0
 
jhaley-telecomtvAuthor Commented:
Thanks Aneesh.

No luck there though.

If I remove embedFonts, the font's show, but not as helvetica, so it's like it is not seeing dHelvetica as a valid font. Yet it is in the flash font list. So when i created the textarea, i could choose "fHelvetica*". I have tried the following aswell to no avail!

oBoothTitleFormat.font="fHelvetica*";

Open in new window

0
 
jhaley-telecomtvAuthor Commented:
Sorry, I meant fHelvetica!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Aneesh ChopraCommented:
sorry, you should remove the your font symbol from library before implementing my earlier suggestion.
and must choose Helvatica from the font list.

I know that by using this approach you might have to change all references to your font symbol.
but this is required and then my suggested solution will work.

0
 
jhaley-telecomtvAuthor Commented:
Ah yes that works! Thankyou. Very frustrating issue. Is there anyway around it? Is it addressed in AS3?
0
 
jhaley-telecomtvAuthor Commented:
Thanks!
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now