7 Replies Latest reply on Apr 7, 2007 7:53 PM by injpix

    Embedded Fonts on Dynamic Label Component

    pjefferies
      I am working on a project that calls for multiple label components to be dynamically rendered based on a selected comboBox selectedItem. The comboBox is a choice of fonts available to the user - all of which are embedded fonts. For some reason, the fonts are not embedding correctly for systems that do not have the font on the system.

      I have added the fonts to the library and selected "Export to ActionScript" as well as "Export in First Frame" (although I want to preload these later once this issue is resolved). In my steps to simplify and solve, I created a basic movie with a label on the stage with an instance name of "label0".

      In my Actions frame, I use the following code:
      label0.text = "This is a font test";
      label0.setStyle("fontFamily", "Vivaldi");
      label0.setStyle("fontSize", "40");
      label0.setStyle("embedFonts", "true");

      I have seen examples on the web where someone uses label0.embedFonts = true; but that doesn't seem to work either. I have also tried various fonts to verify the font will embed.

      Thinking I may not be embedding it correctly, I checked the bandwidth profiler and variables list and the size goes up after I try to embed the font as well as the label0 variables correctly show embedFonts = true as well as the fontFamily is set to Vivaldi (sample).

      Many people have used Dynamic Text Fields but I need to use a Label so I can use the autoSize feature as users are allowed to choose their own font size (between 10pt and 40pt). The label component seems to be the right option for me with the exception of the font selection. To be safe, I added a dynamic text field and embedded the fonts there as well and hid it off stage. When viewing it on another system, the dynamic text field worked (poorly) but it showed the font. The label did not show the correct font.

      Any help would be greatly appreciated.

      Thanks