Mx components don't recognize embedded font

I ran into this problem: while spark components render embedded font just fine, the mx components silently fail.
Here is a simple demo code where the first mx:LinkButton simply does not show up.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
   xmlns:s="library://ns.adobe.com/flex/spark"
   xmlns:mx="library://ns.adobe.com/flex/mx"
   minWidth="1024" minHeight="768">
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@font-face {
src: url('/Library/Fonts/Microsoft/Goudy Old Style');
fontFamily: 'GoudyEmbedded';
.embedded {
fontFamily: 'GoudyEmbedded';
color: #FF0000;
fontSize:28;
.nonembedded {
fontFamily: 'Goudy Old Style';
color: #FF0000;
fontSize:28;
</fx:Style>
<mx:LinkButton x="50" y="50" styleName="embedded" label="Just a test - 1234567890" />
<mx:LinkButton x="50" y="150" styleName="nonembedded" label="Just a test - 1234567890" />
</s:Application>

Here are 4 instances of 'Accordion', where you can see how 'headerStyleName' and 'styleName' yield different results.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
   xmlns:s="library://ns.adobe.com/flex/spark"
   xmlns:mx="library://ns.adobe.com/flex/mx"
   minWidth="1024" minHeight="768">
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@font-face {
src: url('/Library/Fonts/Microsoft/Goudy Old Style');
fontFamily: GoudyEmbedded;
.emb {
fontFamily: GoudyEmbedded;
color: #800000;
fontSize: 24;
textAlign: center;
textFieldClass: ClassReference("mx.core.UIFTETextField");
.nonemb {
fontFamily: 'Goudy Old Style';
color: #800000;
fontSize: 24;
textAlign: center;
</fx:Style>
<!-- 'headerStyleName' does render embedded font -->
<mx:Accordion id="acc1" x="10" y="10" width="240" headerStyleName="emb" >
<s:NavigatorContent label="The slanted dash '-'" >
<s:Label x="10" y="50" styleName="emb" text="Just a test - 12345" />
</s:NavigatorContent>
</mx:Accordion>
<!-- just 'styleName' - does NOT render embedded font -->
<mx:Accordion id="acc2" x="260" y="10" width="240" styleName="emb" >
<s:NavigatorContent label="The slanted dash '-'" >
<s:Label x="10" y="50" styleName="emb" text="Just a test - 12345" />
</s:NavigatorContent>
</mx:Accordion>
<!-- non embedded font works -->
<mx:Accordion id="acc3" x="510" y="10" width="240" headerStyleName="nonemb" >
<s:NavigatorContent label="The slanted dash '-'" >
<s:Label x="10" y="50" styleName="emb" text="Just a test - 12345" />
</s:NavigatorContent>
</mx:Accordion>
<!-- non embedded font is rendered but text alignment is ignored-->
<mx:Accordion id="acc4" x="760" y="10" width="240" styleName="nonemb" >
<s:NavigatorContent label="The slanted dash '-'" >
<s:Label x="10" y="50" styleName="emb" text="Just a test - 12345" />
</s:NavigatorContent>
</mx:Accordion>
</s:Application>

Similar Messages

  • Mx Components displaying wrong the embedded Font

    Hi, I'm developing with Adobe Flash Builder 4.5 and I have a problem that the mx components displaying wrong the embedded font which is embedded in a css-file. But spark components have no problems with displaying the embedded font.
    thanks

    See the embedded fonts post on my blog.  The MX components default to a
    different embedded font subsystem.
    Alex Harui
    Flex SDK Team
    Adobe System, Inc.
    http://blogs.adobe.com/aharui

  • Please, Help Embedding Fonts in TextArea , TextInput and Alert Components

    Please, forgive my bad english.
    Here is my problem (using Flash CS3 ActionScript 2).
    I have on the stage :
    • an instance of TextArea with Instance Name :
    message_ta
    • an instance of TextInput with instance Name : name_ti
    • and I have in the library an instance of Alert
    component, with default linkage Identifier : Alert
    for each one of this components I need to embed the same
    font.
    I already created a New Font in the library, choosing the
    font I want to use, giving it name "my_font" and size 8px.
    Now, please, can someone help me to write the actions to
    embed that font (my_font) inside the TextArea, TextInput and Alert
    components ?
    Thank you .

    You're right,my mistake, components don't have a font
    parameter, I was thinking of the textField. In any case you can use
    setStyle.
    1. Import the font(s) that you want to use into your movie's
    Library.
    2. Set each font's Linkage to be exported for Actionscript.
    Set the identifier name as you like
    3. Set your component(s) on the stage.
    4. Name each component instance.
    5. In a frame action space, define the style for each
    component:
    componentName.setStyle("fontFamily","fontName");
    componentName.setStyle("fontSize",12);
    componentName.text = "hello";
    componentName.embedFonts = true;
    There is a section in the online help that lists the various
    style properties that you can set for each component.

  • ASDoc Error: Can't find Embedded Fonts?

    Hello,
    I am working in Flash CS5 Professional.
    On my stage, I have a dynamic TextField (my_txt) that uses a basic font, we'll say Arial. However, I want to format some of the text within the field with a custom font.
    I've embedded the font and exported to ActionScript as per Adobe's documentation, so now there is a Font item in my library named "MyCustomFont".
    The properties of the Font are -
    Class: MyCustomFont
    Base Class: flash.text.Font
    So, I've written a custom class file and I want to format the text, so the AS code within the class looks something like this:
    var my_font:Font = new MyCustomFont();
    var my_fmt:TextFormat = new TextFormat();
    my_fmt.font = my_font.fontName;
    my_txt.setTextFormat(my_fmt, 5, 15);
    This is pretty much like the examples I've seen in Adobe Docs. And, it works swimmingly when I test the movie; however, when I try to document the class using the ASDoc command line tool, I get the error:
    /Path/To/Project/And/The/Classes/SomeClass.as(221): col: 27 Error: Call to a possibly undefined method MyCustomFont.
                var my_font:Font = new MyCustomFont();
                                       ^
    I THINK I understand why ASDoc isn't finding the "method" MyCustomFont... the "method" is actually a Class contained in the Library within the .fla.
    So, is there a special argument I need to write in the ASDoc command line so that it will recognize embedded fonts?
    Or, am I supposed to use an "import" statement in SomeClass to import the embedded fonts somehow?
    Thanks!

    Ahhh...found the answer, do the same thing as I would do for any project that uses the built-in AS3 components (such as FLVPlayback):
    Put the Font items into a new .fla library and export a SWC.
    Then use the "-library-path /Path/to/SWC" argument in the ASDoc command line tool.

  • Using embeded fonts in loaded swf.

    I have a .Swf, which has 3 fonts embedded in it, they are all exported in frame 1 for AS.  This swf loads any number of external .swfs which have dynamically generated textfields inside of them.  This text must be embedded text because effects may be applied to them.  I do not want to embed the three fonts into every external swf, and do not think I should have to.  The font exists in the Loading swf and I have registered the fonts to the global font list.  If I print this list from the loaded swf, all three fonts are present, but when I try to use any of them, my textfiels are empty.
    My question is how do I utilize a font which is embedded in a swf, from a swf which has been loaded into that swf?
    From my external swf, this code:
    [PHP]var embeddedFonts:Array = Font.enumerateFonts(false);
    embeddedFonts.sortOn("fontName", Array.CASEINSENSITIVE);
    trace(embeddedFonts);[/PHP]
    produces the following:
    [PHP][object CenturyBook],[object MyriadProRegular],[object MyriadProItalic][/PHP]
    which are the three fonts that are embedded in the loading swf, So I assume the LOADED swf has access to these fonts.
    When I apply this code to the externally loaded swf:
    [PHP]var FontClass:Class = getDefinitionByName("MyriadProRegular") as Class;
    trace("FontClassInstance -> " + FontClass.toString());
    var linkedFont: Font = new FontClass();
    trace("Font name: " + linkedFont.fontName);
    var textFormat: TextFormat = new TextFormat(linkedFont.fontName, 14);
    //... The next lines set up the text box and apply the format.  I am sure this is done correctly.
    [/PHP]
    I get the following output:
    [PHP]FontClassInstance -> [class MyriadProRegular]
    Font name: Myriad Pro[/PHP]
    which is exactly what I would expect.  Yet, my text box is still blank.  I have embedText = true on the text box, and have applied a string to the "text" property, so it's nothing silly liek that.
    Any help would be appreciated...

    You may also want to look at the various embedded font format issues. Many of the Flex 4 components use a newer embedded font fortmat, which is not the same as the one generally used in Flash. So even if ther Flash font gets registered properly, it still may not work with some of the spark components.
    You should be able to create a swf using Flex that contains fonts embedded in either format, which can then be used in the way you describe, though, since Flex 4 suports both font formats.
    Hopefully, someone else will jump in here if I got some of this wrong.
    -JM

  • Why don't embedded fonts work inside ItemRenderers?

    I'm trying to use an embedded font on a spark label inside an item renderer for a list control and it doesn't work.  Works fine everywhere else.

    So i think i figured out what was going on.  Here is my simplified code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:components="com.rtn.jccFlex.components.*" xmlns:local="*" xmlns:components1="com.ray.components.*">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Style>
            @namespace s "library://ns.adobe.com/flex/spark";
            @namespace mx "library://ns.adobe.com/flex/mx";
            @font-face {
                src: url("/assets/Typewriter.ttf");
                fontFamily: Typewriter;
                embedAsCFF: true;
        </fx:Style>
        <mx:VBox width="100%" height="100%">
            <s:Label fontFamily="Typewriter" text="MY FONT WORKS!!" fontSize="14" />
            <s:Panel width="60%" height="100%" fontSize="18" fontWeight="bold">
                <s:Label fontFamily="Typewriter" text="MY FONT DOESNT WORKS!!" fontSize="14" />               
            </s:Panel>       
        </mx:VBox>
    </s:Application>
    It was looking for the bold version of the font since it inherited it from the parent panel. But the embed by default embeds the "normal" weight.
    In our project someone wrote a common panel component that sets the content of the panel using the "DefaultProperty" and we put our list in there.  So you don't really think about the container that the List and ItemRenderer sit inside, and it was very easy to overlook.
    This was very painful to figure out.
    Thanks for the help guys.

  • [svn:fx-trunk] 13076: It turns out that embedded fonts don' t clip when you shrink the height of a TextField so we' ll use masks in that case

    Revision: 13076
    Revision: 13076
    Author:   [email protected]
    Date:     2009-12-17 14:12:18 -0800 (Thu, 17 Dec 2009)
    Log Message:
    It turns out that embedded fonts don't clip when you shrink the height of a TextField so we'll use masks in that case
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-24561
    Reviewer: Corey
    API Change: No
    Is noteworthy for integration: No
    tests: checkintests mustella/components/DataGrid
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24561
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridBase .as

    Many of your points are totally legitimate.
    This one, however, is not:
    …To put it another way, the design of the site seems to be geared much more towards its regular users than those the site is supposedly trying to "help"…
    The design and management of the forums for more than five years have driven literally dozens of the most valuable contributors and "regulars" away from the forums—permanently.
    The only conclusion a prudent, reasonable person can draw from this state of affairs is that Adobe consciously and deliberately want to kill these forums by attrition—without a the PR hit they would otherwise take if they suddenly just shut them down.

  • HT5361 Mac OS X Mail 4.6 sends emails that other email clients don't recognize as attachments, but as embedded pictures. Mail 6.6 does not have this problem.

    My Mac OS X (with 10.6.8 software) Mail 4.6 sends emails that other email clients don’t recognize as attachments, but as embedded pictures. When I receive emails from others, I do not see whole image either. I did change "rich text" to "plain text" in message format - no results.
    My daughter has Mac (10.8.5) with Mail 6.6, which does not have this problem. Can I install 6.6 instead of 4.6 or do you know other fix?
    Help, please?
    Thanks,
    Andrew

    I've been having the same problem now for several months (at least 3-4 if not more). And the frequency of Mail quitting is increasing, several times in a few hours. And as with you, no particular message pops up before hand or not even the beach-ball spinning first and then quitting.
    I too have been sending Apple the crash reports. However, I have not contacted Apple Support yet. Hoping to find the answer in this forum, but again, no luck.
    If you have found a solution since then, please advise. Or if anyone else out there knows of this issue and can help, that would be greatly appreciated.

  • Poppler based pdf viewers don't seem to honor embedded fonts anymore?

    I apologize if this thread is misplaced. I realize poppler is not in [testing], but since I ride [testing] and recently got the new xorg/mesa update that I believe may have indirectly prompted this breakage, I figured my thread would end up here anyway.
    After a recent upgrade, libpoppler based pdf viewers don't seem to render pdfs with embedded fonts quite right anymore.
    The last time I opened this pdf in evince was two or so weeks ago, and I just now noticed that evince has begun rendering it oddly. Here you can see some comparison screenshots between a ghostscript-based pdf reader (mupdf) and evince:
    Screenshot 1,  Screenshot 2,  Screenshot 3,  Screenshot 4.
    Unfortunately, I've been pulled away from my laptop for the last few weeks, and when I did an -Syyu recently, I had a fairly huge amount of packages to upgrade (making this issue even harder to debug ). If anyone wants to take a look at my pacman log, here's the log from the recent huge upgrade. And yes, I realize ghostscript, evince, poppler/poppler-glib and libspectre are in there.. but when I reverted to their original revisions from /var/cache/pacman/pkg, I still had the same symptoms.
    Sorry if I've overlooked anything glaringly obvious. I'm sleep deprived at the moment... though, if anyone has any suggestions on where to proceed trying to debug this issue from here, I'd really appreciate it... and thanks for taking the time to read this.

    jbsgi wrote:
    Thank you for replying.
    I'm fine with the reader's reader substituting Times for Times New Roman, Helvetica for Arial, etc. As you can see from the pub, precise typography isn't all that important.
    But you have no way to ensure that even those fonts are available on the viewer’s computer. Even if they are, how do you know how the substitution will occur? If I just replace every glyph (letter, numeral, symbol, etc.) in one font with another, but leave the glyphs where they are I might make the text unreadable.
    100 kb is a pitifully small threshold for saving a file for offline viewing. Unless this is meant to be read in Kazakhstan, then I’d ignore this arbitrary file size limit.
    About the hyperlinks issue when distilling a PostScript file: there’s nothing you can do about that, since PostScript files do not support hyperlinks. But you can export a PDF with hyperlinks, then Distill a PostScript file. Open the exported PDF and use Document > Replace Pages. Replace all the pages in the open (exported) PDF with all the pages in the Distilled PDF. Hyperlinks will remain.

  • Embedded fonts not used in all components

    If I use a font by setting the global & Application selector to have that font-family, everything works fine:
         global, Application
             font-family: "Bauhaus 93";   
    Thing is though, some people might not have this font, so I tried to embed it as in:
         @font-face
              src:local("Bauhaus 93");
              fontFamily: Bauhaus
         global, Application
             font-family: Bauhaus;   
    Most text has the desired font, but buttons and some other components still have the default font.  What can I do?

    Check out this thread:
    http://discussions.apple.com/click.jspa?searchID=4541194&messageID=5729015

  • Unable to load embedded fonts in TlF / FlowLeafElement

    dears,
    I use TextFlowUtil.importFromString and FlowLeafElement to make each some text have its own style, every some words have diffirent color, fontFamily, fontSize....etc
    that is done here in the text attribute in this xml tag, and TextFlowUtil.importFromString and FlowLeafElement make taht perfect:
    <TextArea text="&lt;div direction=&quot;rtl&quot;&gt;&#xD;&#xA;  &lt;p textAlign=&quot;right&quot;&gt;&#xD;&#xA;    &lt;span fontFamily=&quot;ttf&quot; fontSize=&quot;16&quot; color=&quot;#FFE000E0&quot; &gt;Welcome to Android Training. Here you'll find a collection of classes that aim to help you build great apps for &lt;/span&gt;&#xD;&#xA;    &lt;span fontFamily=&quot;Arial&quot; fontSize=&quot;16&quot; color=&quot;#FFE000E0&quot; &gt;Android, using best practices in a variety of framework topics.&lt;/span&gt;&#xD;&#xA;  &lt;/p&gt;&#xD;&#xA;  &lt;p&gt;&lt;/p&gt;&#xD;&#xA;  &lt;p textAlign=&quot;right&quot;&gt;&#xD;&#xA;    &lt;span fontFamily=&quot;Arial&quot; fontSize=&quot;16&quot; color=&quot;#FFE00000&quot;&gt;Each class explains the steps required to solve a problem or implement a feature using code snippets and &lt;/span&gt;&#xD;&#xA;    &lt;span fontFamily=&quot;Arial&quot; fontSize=&quot;16&quot; color=&quot;#FFE00000&quot;&gt;sample code for you to use in your apps.&lt;/span&gt;&#xD;&#xA;  &lt;/p&gt;&#xD;&#xA;  &lt;p&gt;&lt;/p&gt;&#xD;&#xA;  &lt;p textAlign=&quot;right&quot;&gt;&#xD;&#xA;    &lt;span fontFamily=&quot;Arial&quot; fontSize=&quot;16&quot; color=&quot;#FF00E000&quot;&gt;What you see now is just the beginning. We plan to add many more classes, expand and refine existing &lt;/span&gt;&#xD;&#xA;    &lt;span fontFamily=&quot;Arial&quot; fontSize=&quot;16&quot; color=&quot;#FF00E000&quot;&gt;classes, and build Training Courses that help you enhance your apps using objective-oriented collections of &lt;/span&gt;&#xD;&#xA;    &lt;span fontFamily=&quot;Arial&quot; fontSize=&quot;16&quot; color=&quot;#FF00E000&quot;&gt;classes.&lt;/span&gt;&#xD;&#xA;  &lt;/p&gt;&#xD;&#xA;&lt;/div&gt;" direction="rtl" styleName=".textAreaTitle" editable="false" selectable="true" scrollable="false" mainReferance="UI.Components.Basics.TextArea" />
    The problem is that i need to embed fonts, by this fontFamily=&quot;Arial&quot; you can set font name which you want, but if i set font name which is embedded it won't work, like : fontFamily=&quot;ttf&quot;
    the embedded code is :
    [Embed(source='/Resources/majallab.ttf',fontName='ttf',mimeType='application/x-font',embed AsCFF='true')]
                                            var font1:Class; //This is only used to compile the code
    I use Flex SDK 4.5,
    what can i do ?
    Thank you in advance,
    amt

    To use embedded fonts in a Flex component, the fontFamily for the component needs to be set to an embedded font that is in the same SWF as the other embedded fonts in the TextFlow.  See my blog for more details
    Alex Harui
    Flex SDK Team
    Adobe Systems, Inc.
    http://blogs.adobe.com/aharui

  • Module not unloading if embedded font was ever used

    So, I have a test app that uses modules with the font embeded. Using ModuleManager I am able to load up the module. Once I call   IModuleInfo.factory.create(), I am then able to setStyle("fontFamily", "BPDiet") and the font does show up. The issue I am now having is that once I have used a font from a module, even if my TextArea is no longer using it (I even tried removing the textArea, and replacing it with a new one), the module will not unload.
    I read through this "What We Know About Unloading Modules" and I think I am not leaving any references around.They are loaded using the load() defaults. There is no code (that is used) in the module. The modules are not being added to the display, so they never receive focus.
    Note that I am unable to run the profiler as suggested in the article as I don't have the premium Flash Builder 4. <grrr>
    Note that the first module that is loaded, I can never get to unload, even if I never used the font embedded in it, but all subsequent modules will unload, if I do not use the embedded font. I can live with the first one being pinned as long as I can unload the others that are not in use.
    Here is the code from one of my modules:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx">
        <fx:Script>
            <![CDATA[
                import spark.components.TextArea;
                [Embed(source='assets/BPDiet.otf',
                        fontName='BPDiet',
                           mimeType='application/x-font')]
                public static var BPDietNormal:Class;
                public function GetSampleTextArea():TextArea {
                    var SampleTextArea:TextArea = new TextArea();
                    SampleTextArea.text = "Test BPDiet please!";
                    SampleTextArea.setStyle("fontFamily", 'BPDiet');
                    return SampleTextArea;           
            ]]>
        </fx:Script>
    </mx:Module>
    And here is the App that is loading and using the modules:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="400" minHeight="400">
        <fx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import mx.core.UIComponent;
                import mx.events.FlexEvent;
                import mx.events.ModuleEvent;
                import mx.managers.SystemManager;
                import mx.modules.IModule;
                import mx.modules.IModuleInfo;
                import mx.modules.Module;
                import mx.modules.ModuleManager;
                import spark.components.TextArea;
                private var _ta:TextArea = null;
                protected var _moduleInfo:IModuleInfo;
                private function LoadFontTextArea(fontSwf:String):void {
                    status.text = "Loading the font pack";
                    _moduleInfo = ModuleManager.getModule(fontSwf);
                    // add some listeners
                    _moduleInfo.addEventListener(ModuleEvent.READY, onModuleReady);
                    _moduleInfo.addEventListener(ModuleEvent.ERROR, moduleLoadErrorHandler);
                    _moduleInfo.addEventListener(ModuleEvent.UNLOAD, moduleUnloadHandler);
                    _moduleInfo.load();
                private function onModuleReady(event:ModuleEvent):void {
                    status.text = "The font pack swf Ready \n" + event.module.url;
                    //All I had todo was create the module, then I could access the embeded font by name
                    var fontMod:* = event.module.factory.create();
                    //_ta = fontMod.GetSampleTextArea();
                    //panelToStuff.addElement(_ta);
                    fontMod = null;
                    //fontNameForSample = event.module.url.replace(".swf", "");
                private function moduleLoadErrorHandler(event:ModuleEvent):void {
                    status.text = "Font Module Load Error. \n" +
                        event.module.url + "\n"+ event.errorText;
                private function moduleUnloadHandler(event:ModuleEvent):void {
                    status.text = "Font Module Unload Event. \n" + event.module.url;
                private function fontChangedHandler():void {
                    unloadCurrentFont();
                    LoadFontTextArea(String(availFonts.selectedItem));
                private function unloadCurrentFont():void {
                    if (_ta != null) {
                        panelToStuff.removeElement(_ta);
                        _ta = null;
                    panelToStuff.removeElement(sampleTextArea);
                    sampleTextArea = null;
                    sampleTextArea = new TextArea();
                    sampleTextArea.id = "sampleTextArea";
                    sampleTextArea.text = "Some text for your viewing pleasure. " + colorForBK.toString(16);
                    panelToStuff.addElement(sampleTextArea);               
                    if (_moduleInfo != null)
                        _moduleInfo.release();
                        //_moduleInfo.unload();
                        _moduleInfo = null;
                    System.gc();
                private function DoNonImportantWork():void {
                    colorForBK -= 0xFAA;
                    if (colorForBK < 0x0) colorForBK = 0xFFFFFF;
                    var foo:* = {prop1: "yea" + colorForBK.toString(), prop2:"boo" + colorForBK.toString()};
                    var hmm:String = foo.prop1 + " " + foo.prop2;
                    regedFonts = new ArrayCollection(Font.enumerateFonts(false));
                [Bindable]
                private var colorForBK:int = 0xFFFFFF;
                [Bindable]
                private var fonts:ArrayCollection =
                    new ArrayCollection(new Array("AlexandriaFLF.swf", "BPDiet.swf", "ChanpagneFont.swf", "KidsFont.swf"));
                [Bindable]
                private var regedFonts:ArrayCollection;
                [Bindable]
                private var fontNameForSample:String = "";
            ]]>
        </fx:Script>
        <s:VGroup id="panelToStuff">
            <s:HGroup>
                <s:Label id="status" text="status area" backgroundColor="{colorForBK}"/>
                <s:VGroup>
                    <s:DropDownList id="availFonts" dataProvider="{fonts}" change="fontChangedHandler()" />
                    <s:Button label="UnLoad" enabled="true" click="unloadCurrentFont()"/>
                    <s:Button label="doSome" enabled="true" click="DoNonImportantWork()"/>
                </s:VGroup>
            </s:HGroup>
            <s:HGroup>
                <s:Button click="fontNameForSample = 'BPDiet';" label="BPDiet"/>
                <s:Button click="fontNameForSample = 'Champagne';" label="Champagne"/>
                <s:Button click="fontNameForSample = 'Kids';" label="Kids"/>
            </s:HGroup>
            <s:Label text="{regedFonts.length} reg'ed"/>
            <s:TextArea id="sampleTextArea" fontFamily="{fontNameForSample}" text="Some Sample text for your viewing"/>
        </s:VGroup>
    </s:Application>
    A couple things to note; I am calling System.rc() in the unloadCurrentFont() method just to speed up seeing the SWF unload in the debug console. The DoNonImportantWork() is there to just cause some events to happen and to create some objects that will need to be GC'ed. It also let me know that the fonts are not getting registered in Font.
    I'm going to have 30 fonts (and more, that designer is busy) that I will need to be able to dynamically load, but right now, loading them with CSS style modules blows up after about 15 because style modules register the font so I cannot unload the CSS swf.

    To help eliminate the question of whether the TextArea is being held by something else, I have removed it from the MXML, and now programatically create it. That did not help.
    So, I got the trial version of Flash Builder 4 installed on another machine in the office so that I can use the profiler. (The profiler is pretty cool by the way).
    After a lot of profiing, I found four paths to the module's FlexModuleFactory.
    Two of those paths go to EmbeddedFontRegistry, whose data is static. I could get into it and remove font entry and free up the moduleFactory from there. This is a hack, that entry in/on EmbeddedFontRegistry.font should have been cleaned up by the code removing the fontFamily from the TextArea. (Note that EmbeddedFontRegistry is marked [ExcludeClass], which I assume means I should not really be messing with it.
    The other two I cannot get to as they are anonymous. They also don't appear to be referenced, as the Object References shows them both as GC root objects. Here is a screen shot:
    I did a search through the sdk code and 'fbs' only shows up as a parameter on the init function of various Marshal support classes, but is not used in the init()
    Anyway, these references to the FlexModuleFactory do not get held if I do not use the embeded font in the module.
    Here is the updated code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="400" minHeight="400">
        <fx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import mx.core.EmbeddedFont;
                import mx.core.EmbeddedFontRegistry;
                import mx.core.IEmbeddedFontRegistry;
                import mx.core.UIComponent;
                import mx.events.FlexEvent;
                import mx.events.ModuleEvent;
                import mx.managers.SystemManager;
                import mx.modules.IModule;
                import mx.modules.IModuleInfo;
                import mx.modules.Module;
                import mx.modules.ModuleManager;
                import spark.components.TextArea;
                private var _ta:TextArea = null;
                protected var _moduleInfo:IModuleInfo;
                private function LoadFontTextArea(fontSwf:String):void {
                    status.text = "Loading the font pack";
                    _moduleInfo = ModuleManager.getModule(fontSwf);
                    // add some listeners
                    _moduleInfo.addEventListener(ModuleEvent.READY, onModuleReady);
                    _moduleInfo.addEventListener(ModuleEvent.ERROR, moduleLoadErrorHandler);
                    _moduleInfo.addEventListener(ModuleEvent.UNLOAD, moduleUnloadHandler);
                    _moduleInfo.load();
                private function onModuleReady(event:ModuleEvent):void {
                    status.text = "The font pack swf Ready \n" + event.module.url;
                    //All I had todo was create the module, then I could access the embeded font by name
                    var fontMod:* = event.module.factory.create();
                    fontMod = null;
                private function moduleLoadErrorHandler(event:ModuleEvent):void {
                    status.text = "Font Module Load Error. \n" +
                        event.module.url + "\n"+ event.errorText;
                private function moduleUnloadHandler(event:ModuleEvent):void {
                    status.text = "Font Module Unload Event. \n" + event.module.url;
                private function fontChangedHandler():void {
                    unloadCurrentFont();
                    LoadFontTextArea(String(availFonts.selectedItem));
                private function unloadCurrentFont():void {
                    if (_ta != null && _moduleInfo != null) {
                        var fontName:String = _ta.getStyle("fontFamily");
                        _ta.setStyle("fontFamily", "");
                        _ta.validateProperties();
                        if (_ta.textDisplay) {
                            _ta.textDisplay.validateProperties();
                        panelToStuff.removeElement(_ta);               
                        _ta = null;
                        //This I should not have to do, but the framework is not doing it
                        var embFontReg:IEmbeddedFontRegistry = EmbeddedFontRegistry.getInstance();
                        var embFonts:Array = embFontReg.getFonts();
                        for each (var curEmbFont:EmbeddedFont in embFonts){
                            if (curEmbFont.fontName == fontName){
                                embFontReg.deregisterFont(curEmbFont, _moduleInfo.factory);
                    if (_moduleInfo != null)
                        _moduleInfo.unload();
                        _moduleInfo = null;
                    System.gc();
                private function AddTA():void {
                    _ta = new TextArea();
                    _ta.text = "Some text for your viewing pleasure. " + colorForBK.toString(16);
                    panelToStuff.addElement(_ta);
                private function DoNonImportantWork():void {
                    colorForBK -= 0xFAA;
                    if (colorForBK < 0x0) colorForBK = 0xFFFFFF;
                    var foo:* = {prop1: "yea" + colorForBK.toString(), prop2:"boo" + colorForBK.toString()};
                    var hmm:String = foo.prop1 + " " + foo.prop2;
                [Bindable]
                private var colorForBK:int = 0xFFFFFF;
                [Bindable]
                private var fonts:ArrayCollection =
                    new ArrayCollection(new Array("AlexandriaFLF.swf", "BPDiet.swf", "ChanpagneFont.swf", "KidsFont.swf"));
            ]]>
        </fx:Script>
        <s:VGroup id="panelToStuff">
            <s:HGroup>
                <s:Label id="status" text="status area" backgroundColor="{colorForBK}"/>
                <s:VGroup>
                    <s:DropDownList id="availFonts" dataProvider="{fonts}" change="fontChangedHandler()" />
                    <s:Button label="UnLoad" enabled="true" click="unloadCurrentFont()"/>
                    <s:Button label="AddTA" enabled="true" click="AddTA()"/>
                    <s:Button label="doSome" enabled="true" click="DoNonImportantWork()"/>
                </s:VGroup>
            </s:HGroup>
            <s:Button click="_ta.setStyle('fontFamily', 'BPDiet');" label="BPDiet"/>
        </s:VGroup>
    </s:Application>
    I really think I've reached the end of what I can do. This really seems like a bug.

  • Fully embedding fonts in PDF

    Hi,
    I had a piece of information but I can't seem to find it anymore so I have to ask ...
    This is about understanding limitations of fully embedding fonts in a PDF (from Indesign Server). Actually it's about one limitation in particular. I know fonts with licensing issues or fonts that are marked "embedded not allowed" will not be embedded. Also, there is a threshold that I need to set.
    So, I recall reading somewhere that Indesign will not fully embed "standard" fonts. Is that correct and what is this standard fonts category?
    Oh, reading through some posts, I noticed lots of people and experts ask why does one need fully embedded fonts. That's a good question and I don't know the root reason but in my case it seems that some regulatory agencies (in the life sciences/pharma domain) require PDFs with fully embedded fonts.
    Many thanks
    Cristian

    On behalf of Adobe:
    (1)     For both InDesign “PDF export” (including InDesign Server) and Illustrator “save as PDF” functions, most but not all of the .joboptions file font embedding options are totally and utterly ignored. The options that are ignored are the Embed all fonts, Embed OpenType fonts, Always embed, and Never embed. Those options are observed by Distiller and the PDFMaker components of Acrobat.
    (2)     These applications will attempt to embed all fonts referenced by the document, regardless of the settings of the .joboptions file. The only reason why a font would not be embedded in a PDF file would be if (a) the font was unavailable (i.e., not installed on the system) or (b) the font's embedding permissions do not permit embedding for at least preview and print privileges. Thus, if you use the so-called Standard .joboptions (strongly not recommended for any graphic arts purposes), even the base 14 fonts (four faces each of Helvetica, Times, and Courier along with Symbol and ITC Zapf Dingbats will be embedded if your document references them.
    (3)     The subset threshold value of 0 (zero) may effectively cause all the glyphs of a font to be embedded in some, but not all cases. This will work for many if not most Type 1 fonts and some smaller TrueType and OpenType CFF fonts. Note that embedding all glyphs in a font is not the same as embedding a full font. For OpenType and TrueType fonts, InDesign and Illustrator never embed all the tables of the font. Such unembedded tables include those used for pair kerning, advanced OpenType features (such as ligatures, alternate representations, contextual alternates, small caps, old style figures, etc.), and extended metrics.
    (4)     There are plenty of bubbameissas out there with regards to the benefits or liabilities of either fully embedding or subset embedding fonts. What is true is that: (a) Acrobat never uses the embedded font for text editing - you must have the font installed on the system in order to do such edits. (b) Subset embedding or not is totally irrelevant to what a RIP does when rendering text, either for PostScript or direct PDF RIPs. Neither subset or full embedding is any more reliable than the other and the specifications of PostScript and PDF do not permit the RIP to replace the embedded font with a font with a similar name - urban legend notwithstanding!!!! (c) Third party plug-ins to Acrobat or applications that claim to allow you to edit PDF files with embedded fonts may be illegally letting you do so if the embedding permissions do not permit embedding for editable embedding or installable embedding - most fonts do not provide such embedding permissions and since the fonts are missing metric information, such editing may be somewhat lacking in quality or features.
    (5)     In fact some very non-tech-savvy organizations have posted requirements for full embedding of fonts in submitted PDF files (I have personally seen one such requirement by some international bureaucracy). They can post such bone-headed requirements based on limited understanding of PDF and PDF workflows, but that doesn't mean that anybody actually provides such PDF files. If in fact you run into such requirements, I would appreciate it if references to same can be forwarded to my attention by private message on these forums.
              - Dov

  • Embedding fonts in Bridge (Photoshop CS5)

    Hi folks!
    I'm sorry for posting but I still have trouble with creating PDF via Bridge.
    I have sveral PSD-Files (CS5 made) using several image- and textlayers.
    Now I want to create multipage-PDF using Bridge that comes with PS CS5.
    Works fine so far but Bridge does not embed those fonts used in the PSD!
    Seems to me Bridge just merges all layers to one pixelbased image and saves it in PDF-format.
    But that's no good deal!
    In CS2 there was a much better solution in PS2 allowing to create multipaged PDF with embedded fonts.
    Is there any chance to embed fonts with Bridge?
    Plz don't tell me to use Acrobat or InDesign because I'm only using PS CS5.
    Thx!

    Which version of Camera Raw do you use (Photoshop > About Plug-In > Camera Raw) and which one is needed for that camera?
    Camera Raw plug-in | Supported cameras

  • Unable to load embedded fonts in Textlayout Framework using SWFContext.

    Hi,
        We are having issues with embedding/renderring fonts in swf.
        Here is the code of the slide1.swf compiled by mxmlc.exe [Adobe Flex Compiler (mxmlc) Version 4.1.0 build 16076] with compiler parameters --  "-static-link-runtime-shared-libraries".
    and checked with  Flash player version 10.1 and 10.2 and 10.3.
        package
            import flash.display.Sprite;
            import flashx.textLayout.compose.ISWFContext;
            public class Slide1 extends Sprite implements ISWFContext
                [Embed(source="C:/WINDOWS/FONTS/CALIBRI.TTF", fontName="Calibri", embedAsCFF = "true", unicodeRange="U+0041,U+0072,U+0069,U+0061,U+006C,U+0020,U+004E,U+006F,U+006D", mimeType="application/x-font")]
                public static const calibri:Class;
                [Embed("slide1/sldBg1.png", mimeType="image/png")]
                public static const bg:Class;
                [Embed("slide1/slide1.xml", mimeType="application/octet-stream")]
                public static const slide:Class;
                public function callInContext(fn:Function, thisArg:Object, argsArray:Array, returns:Boolean=true):*
                    if (returns)
                    return fn.apply(thisArg, argsArray);
                    fn.apply(thisArg, argsArray);
        Using Flex 4.1 SDK:--
            When I load the slide1.swf in ActionScript Project it shows the embedded text.
            But, when I load the slide1.swf in  MX+Spark Flex Project, it gives an error :
            Warning: An ActionScript 1.0/2.0 SWF file has loaded an ActionScript 3.0 SWF; code in the ActionScript 3.0 SWF will not run.
           Error TypeError: Error #1034: Type Coercion failed: cannot convert Slide1@f56fce9 to mx.core.IFlexModuleFactory. !
            Below red colored text is the code where the exception occurs.
            var fontClass:Class = ApplicationDomain.currentDomain.getDefinition("slide1") as Class;
          textFlow.flowComposer.swfContext = new fontClass();
            textFlow.flowComposer.addController(new ContainerController(textContainer, containerWidth, containerHeight));   
            textFlow.flowComposer.updateAllControllers();           
            And, when I load the slide1.swf in Only MX Flex Poject, it shows the embedded Font.
        Using Flex 4.5 SDK:--
            With MX+ Spark and MX only Flex Project we get following errors
            VerifyError: Error #1053: Illegal override of createGeometry in flashx.textLayout.elements.FlowGroupElement.
            VerifyError: Error #1053: Illegal override of canReleaseContentElement in flashx.textLayout.elements.SubParagraphGroupElement.
            VerifyError: Error #1103: Class flashx.textLayout.elements::LinkElement cannot extend final base class.
            VerifyError: Error #1053: Illegal override of display in flashx.textLayout.elements.ContainerFormattedElement.
            VerifyError: Error #1053: Illegal override of canReleaseContentElement in flashx.textLayout.elements.FlowLeafElement.
            VerifyError: Error #1053: Illegal override of addParaTerminator in flashx.textLayout.elements.SpanElement.
            VerifyError: Error #1053: Illegal override of canReleaseContentElement in flashx.textLayout.elements.InlineGraphicElement.
            VerifyError: Error #1053: Illegal override of minPercentValue in flashx.textLayout.property.NumberOrPercentProperty.
            VerifyError: Error #1053: Illegal override of hash in flashx.textLayout.property.EnumStringProperty.
            VerifyError: Error #1053: Illegal override of hash in flashx.textLayout.property.BooleanProperty.
            VerifyError: Error #1053: Illegal override of minValue in flashx.textLayout.property.NumberProperty.
            VerifyError: Error #1014: Class flashx.textLayout.property::NumberProperty could not be found.
            VerifyError: Error #1053: Illegal override of minValue in flashx.textLayout.property.IntProperty.
            VerifyError: Error #1014: Class flashx.textLayout.property::IntProperty could not be found.
            VerifyError: Error #1053: Illegal override of hash in flashx.textLayout.property.UintProperty.
            VerifyError: Error #1014: Class flashx.textLayout.property::UintProperty could not be found.
            VerifyError: Error #1053: Illegal override of hash in flashx.textLayout.property.StringProperty.
            VerifyError: Error #1014: Class flashx.textLayout.property::NumberOrPercentProperty could not be found.
            VerifyError: Error #1053: Illegal override of hash in flashx.textLayout.property.ArrayProperty.
            VerifyError: Error #1103: Class flashx.textLayout.elements::TCYElement cannot extend final base class.
            VerifyError: Error #1053: Illegal override of createTextLine in flashx.textLayout.compose.ComposeState.

    Hi Jin-Huang
              But when I use Simple ASProject with SDK 4.1 then it works fine but when I create Flex project then it give error
    with SWFContext.
    I think it's a issue of swfcontext or AS comunication with Spark components.
    Please let me know if any solution.
    Thanks

Maybe you are looking for

  • Multiple Kernel panics on iMac using OS 10.4.8

    Hi, firts let me aplogize for the long post... In the past week I have experienced 3 kernel panics. not sure why. I could have chalked it up to a sw update had the first one not happen a few hours before the update. The only thing I know of that coul

  • How To Unzip files from Compress Zip Archive Folder?

    Hi Friends, I had compressed my docx files or images files in zip folder last month but unfortunately that folder has corrupted or damaged due to malware infections. But I am not sure about that what reason behind of zip file get corrupt and inaccess

  • Time Machine disk not showing up in Migration Assistant

    I have backed up my Snow Leopard with Time Machine and I'm trying to import my stuff into Lion using Migration Assistant. However, my Time Machine disk is not showing up in Migration Assistant even though it's connected and shows in Finder. Any idea

  • JQuery modal region template in theme 24

    Please provide details how to use the JQuery modal region template in theme 24. I want to create a modal page but I am no expert in jquery or script. I am sure this template should make life easy but unable to find how to use it. Any help greatly app

  • Ye Olde crossdomain.xml

    An App I was working on just went into production on Saturday. We have this setup: A weblogic application server (Server A) running on Machine A (a solaris OS). We have a separate weblogic server located on Machine B. Machine A's weblogic hosts the w