TextFlow using an embedded font or stylename in span

I am trying to use an embedded font in a TextFlow span element in a TextArea in a custom component and it is not working.    Also can you use a stylename from an ext. stylesheet?  The fontFamily works if I style the TextArea itself with it, and it works as a device font in the span since it is loaded on my computer, but I need to use it as an embedded font since most users will not have it.
Thanks,
John
Below is what I tried:
<s:TextArea>
<s:textFlow>
<s:TextFlow>
<s:p>
<s:span fontFamily="threeDumbFont" fontLookup="embeddedCFF">
Everyone says the cow jumped over the moon
</s:span>
</s:p>
</s:TextFlow>
</s:textFlow>
</s:TextArea>
I have a external styleshteet for the application here is part of it that includes the font:
@font-face {
src:url("assets/fonts/3Dumb.ttf");
fontFamily: 'threeDumbFont';
fontWeight: normal;
fontStyle: normal;
embedAsCFF: true;
.logo {
fontFamily: 'threeDumbFont';
fontLookup: embeddedCFF;
fontSize: 40;
color: #ed1161;

Set fontFamily on the TextArea as well.
The rules are that all fonts in a component must be embedded in the same SWF, and the component itself must be given one of those fonts as the fontFamily (and fontStyle and fontWeight) so it can detect and use the correct SWF for its fonts.  Once you've specified one of the fonts in the SWF, the TextFlow can use any of the fonts in the SWF.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui

Similar Messages

  • [svn:fx-trunk] 8531: If using an embedded font, need to measure the text with it so that if auto-sizing, the correct amount of space is allocated.

    Revision: 8531
    Author:   [email protected]
    Date:     2009-07-13 12:25:57 -0700 (Mon, 13 Jul 2009)
    Log Message:
    If using an embedded font, need to measure the text with it so that if auto-sizing, the correct amount of space is allocated.
    QA Notes:
    Doc Notes: SDK-22205.
    Reviewers: will be Gordon
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22205
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/RichEditableText.as

    Revision: 8531
    Author:   [email protected]
    Date:     2009-07-13 12:25:57 -0700 (Mon, 13 Jul 2009)
    Log Message:
    If using an embedded font, need to measure the text with it so that if auto-sizing, the correct amount of space is allocated.
    QA Notes:
    Doc Notes: SDK-22205.
    Reviewers: will be Gordon
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22205
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/RichEditableText.as

  • [svn:osmf:] 13113: Changing to not use an embedded font by default, and adding instructions on how to use the free 'type writer' bitmap font.

    Revision: 13113
    Revision: 13113
    Author:   [email protected]
    Date:     2009-12-21 01:08:10 -0800 (Mon, 21 Dec 2009)
    Log Message:
    Changing to not use an embedded font by default, and adding instructions on how to use the free 'type writer' bitmap font.
    Modified Paths:
        osmf/trunk/libs/ChromeLibrary/.flexLibProperties
        osmf/trunk/libs/ChromeLibrary/src/org/osmf/chrome/controlbar/widgets/ScrubBar.as
        osmf/trunk/libs/ChromeLibrary/src/org/osmf/chrome/controlbar/widgets/URLInput.as
    Added Paths:
        osmf/trunk/libs/ChromeLibrary/src/org/osmf/chrome/fonts/
        osmf/trunk/libs/ChromeLibrary/src/org/osmf/chrome/fonts/Fonts.as
    Removed Paths:
        osmf/trunk/libs/ChromeLibrary/assets/images/stop_up.png_1

    Your site was built using tables, whose sizes are defined in your site.
    If we look at your first table definition, we can see:
    <table width="861" height="1449" border="3" cellpadding="0" cellspacing="0" bordercolor="#868787">
    Your table has a width of 861 pixels and an overall height of 1449 pixels. Anything you put into that overall box must fit those dimensions, else
    it won't be visible. Anything you add above it will push everything down. You can redefine your sizing to let you edit more inside of the table elements.
    This is why, when you type in more text, things act weird. If you are in Dreamweaver, you must find the right cell to put your text into and then enter
    text there. Unfortunately, this is going to push things around, which were all lined up using tables. And this gets everything offset with respect to
    everything else in your website.
    And that is why everyone is saying, "Start Over!"
    I just inherited a website that has been put together using tables. I'm going to have to expend considerable effort in rewriting the entire design of the
    website because of that. because everything I intend to add to the pages on the site is going to need to be deconstructed in order to get it to work
    properly if I'm adding text and pictures that need to line up with each other.
    You need something done quick and dirty and the only way I can recommend you do that is to use Dreamweaver to show you the tables you have
    and put what you need in a new table that is defined above or below the tables you all ready have defined. Do that and then get back to someone here
    who knows how to make a website correctly to clean up your entire website and make it editable -- which will cost you some money, but it will be
    money well-spent.
    I like to quote this maxim: Good, Fast, Cheap. Pick any two. This works for website design. You can get it fast and cheap, but it won't be good. I
    think you may have chosen that route.

  • Using an Embedded Font in another .swf

    I am encountering a situation with font embedding that hopefully someone out there will know the solution to. This is a slightly boiled-down version of the problem but all the pertinent details are included. Without further ado, here's the situation:
    TLDR Version:  If I have a font embedded and registered with Font.registerFont(), and I attempt to use that font in a .swf that was compiled from an .fla in Flash CS5 that so much as MENTIONS that font, it fails.
    Longer Description:
    The Goal: Embed fonts in 1 .swf, use those fonts in many .swfs. Simple.
    Fonts.swf
    I have 3 .swf files. The first is called Fonts.swf. This was created in Flash CS5. It contains an embedded font( Franklin Gothic Demi ) with characters a-z, A-Z, numerals, and punctuation, etc. Regular, not bold. The font is exported for actionscript and the class is FranklinGothicDemi.
    On the main timeline of Fonts.swf is the code:
    Font.registerFont( FranklinGothicDemi ).
    Application.swf
    The second .swf is Application.swf. The following code snippet is from Application.as:
    [Embed(source="Fonts.swf")]
    private static var EmbeddedFonts:Class;
    initFonts()
    var embedFont:EmbeddedFonts = new EmbeddedFonts();
    embedFont.addEventListener( Event.COMPLETE, function( e:Event ){ traceEmbeddedFonts(); } );
    When traceEmbeddedFonts is called, it verifies that Franklin Gothic Demi is in fact registered.
    UserInterface.swf
    The third .swf file is UserInterface.swf. Fonts are NOT embedded in this file. They are not supposed to be. The project has many .swf files and they should all be using the fonts embedded in Fonts.swf.
    On the main timeline of UserInterface, it calls it's own version of traceEmbeddedFonts(), which again confirms that Franklin Gothic Demi is embedded.
    Inside UserInterface is a TextField we'll call mMainTextField, with some text, say "Main Menu". The font is "Franklin Gothic Demi", the anti-alias style is 'use device fonts.' I have tried other anti-alias styles as well.
    As it turns out, UserInterface.swf is 'embedding' Franklin Gothic Demi, with a character set of a big fat 0 characters. This is taking precedence over the Franklin Gothic Demi font embedded from Fonts.swf. I can side-step this problem by setting mMainTextField to use some other Font while publishing and then using actionscript to change it back to Franklin Gothic Demi when the project is running, but that's not a solution that is friendly to the artists.
    In essence, the question is simple: Why is Flash Embedding and Registering fonts with character sets of size 0, despite the fact that nowhere in UserInterface.swf is there a request to embed fonts, and how do I prevent it from doing so?
    If anyone who sees this has already encountered and solved this problem and shares the solution with me, you will be my favorite person .
    Thanks!
    -J

    You know, I think its just a bug inside Flash Builder Burrito. When I run my app through the emulator it doesn't display correctly but when I run it on my phone it works as it should.

  • Using an embedded font inside of a skinClass?

    I have a font embedded and it works correctly throughout the application... but for some reason I can't get it to work inside a Skin class (base on a button). I tried importing the css file manually and placing the styleName on it but it just doesn't seem to be getting it right (or rather I'm not getting it right).
    Any ideas?

    You know, I think its just a bug inside Flash Builder Burrito. When I run my app through the emulator it doesn't display correctly but when I run it on my phone it works as it should.

  • Possible to use embedded font in TLFTextField, with TextFormat?

    I want to be able to dynamically change the font in a TLFTextField to an embedded font (not a device font).  I'm using Flash CS5.
    The only way I've found a TLFTextField will use an embedded font is if the on-stage TLFTextField has been set to use that font through the Flash UI.  The example code I've found online (Font.registerFont etc) all works fine for a TextField, but not TLFTextField.
    Below is a very simple piece of code that I expected to work.  I have a font (Earwig Factory) embedded in my library (as DF4, linkage "Earwig"), and the isFontCompatible trace call prints "true", but still it is using the device font - if I remove the system font from my machine (or view the SWF on another machine) it falls back to Times New Roman.
    Can anyone give a very simple example of a TLFTextField dynamically selecting an embedded font?  Eventually I would like to store my fonts in a separate SWC / SWF, but for now just working out of the Library would be a good start.
    Thanks,
    Grant
    import flash.text.TextFormat;
    import flash.text.AntiAliasType;
    import flash.text.FontStyle;
    import fl.text.TLFTextField;
    import flash.text.engine.FontLookup;
    var format:TextFormat = new TextFormat();
    format.font = "Earwig Factory"
    trace("Earwig Factory isFontCompatible: " + tf.isFontCompatible("Earwig Factory", FontStyle.REGULAR) );
    tf.defaultTextFormat = format;
    tf.embedFonts = true;
    //tf.antiAliasType = AntiAliasType.ADVANCED;
    tf.setTextFormat(format);
    //tf.textFlow.fontLookup = FontLookup.EMBEDDED_CFF;

    Ok, I have some success - I can get an on-stage TLFTextField to dynamically use an embedded font.  However, this is quite complex, and doesn't use a TextFormat.  And is this seriously the way Adobe intends us to do it - if so perhaps this should be documented better?
    import fl.text.TLFTextField;
    import flashx.textLayout.formats.TextLayoutFormat;
    import flashx.textLayout.elements.TextFlow;
    import flash.text.TextFormat;
    import flash.text.AntiAliasType;
    import flash.text.FontStyle;
    import flash.text.Font;
    import flash.text.engine.FontLookup;
    import flashx.textLayout.edit.ISelectionManager;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.edit.SelectionState;
    var updateTF:TLFTextField = stageTF;
    var applyFont:Font = new Earwig();
    updateTF.embedFonts = true;
    var tlfFormat:TextLayoutFormat = new TextLayoutFormat();
    tlfFormat.fontFamily = applyFont.fontName;
    tlfFormat.fontLookup = FontLookup.EMBEDDED_CFF;
    updateTF.textFlow.invalidateAllFormats();
    updateTF.textFlow.hostFormat = tlfFormat;
    var prevManager:ISelectionManager = updateTF.textFlow.interactionManager;
    var editManager:EditManager = new EditManager();
    var sel:SelectionState = new SelectionState(updateTF.textFlow, 0, updateTF.text.length);
    updateTF.textFlow.interactionManager = editManager;
    editManager.applyLeafFormat(tlfFormat, sel);
    updateTF.textFlow.interactionManager = prevManager;
    updateTF.textFlow.flowComposer.updateAllControllers();

  • 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.

  • Reader does not use or display the embedded fonts

    I have an odd problem with both Reader X and XI. Neither one will use the embedded fonts when opened from an email. I can forward from that PC to any other PC and the fonts will display correctly. The HP is Windows 7 64 bit. I can view the document that was forwarded through it on XP, Win7 Win8 or Ipad and it displays correctly. The "use local fonts" is uncheck but it seems to ignor the change.

    Adobe PDF Plug-In For Firefox and Netscape 10.1.7 ?
    I think you need to add this to the list of applications and the action to take on the type of content. This can also be managed in the about:permissions page. [[Permissions Manager - Give certain websites the ability to store passwords, set cookies and more]]

  • How to use embedded font (CFF) for Flash CS4?

    Hi,
    I am trying to embed "Arial Unicode MS" for use by TLF in my Flash CS4 project. As I googled around, I am using the "Flex SWC" approach, only not having any luck. Here is what I got:
    //Code in Flex ActionScript project:
    package
        public class FontEmbeds
            [Embed(source='C:/Windows/Fonts/ARIALUNI.TTF',
                    fontFamily='ArialUnicodeMS',
                    embedAsCFF='true'
            public const Font1:Class;
    When I am trying to instantiate this class, I have AS code in my Flash main timeline:
    var font:Font = new FontEmbeds_Font1();
    Flash compiler says: "1067: Implicit coercion of a value of type FontEmbeds_Font1 to an unrelated type flash.text:Font."
    Ok. Now after I changed it to:
    var font:FontEmbeds_Font1 = new FontEmbeds_Font1();
    Flash gives 3 errors:
    "VerifyError: Error #1014: Class mx.core::FontAsset could not be found.
    ReferenceError: Error #1065: Variable TextLayout is not defined.
    ReferenceError: Error #1065: Variable MainTimeline is not defined."
    I am assuming I have to create a Font1 object in order to use the embedded font. Is this assumption correct? As I've tried to use the "fontFamily" directly but Flash didn't seem to find the font at all:
    charFormat.fontFamily = "ArialUnicodeMS";
    Thanks.

    Hi Eric,
    Thanks for the info.
    I've tried to use the "fontFamily" directly but Flash didn't seem to  find the font at all:
    charFormat.fontFamily = "ArialUnicodeMS";
    In one fla where I used pure TFL, nothing gets rendered at all in the container Sprite. Flash doesn't throw any errors either. In another fla where I used a ComboBox, etc. along with TFL, it throws an error says it can't compile since "there is no ActionScript found" and I got a screen where all the Flash components were  flickering. After several attempts, Flash crashed.
    Also as a side note, the swc gets generated by Flash Builder Beta 2, at first it was 18mb and the second time I complied it become 9mb and stayed 9mb afterwards. Not sure if that's a concern.
    Geng

  • How to use dynamic loaded embeded font?

    I have loaded fonts.swf on startup. I don't use TextLayout
    Embeded fonts feature. Then i have loaded some xml and assign xml
    to TextLayout. How I can use loaded font for display?

    Are you using Flash CS4 or Flex?
    Check out the following blog post, it contains instructions
    for font embedding that may help you out:
    Embedded
    Font Subsetting Using DefineFont4

  • How to use embedded font

    Hi all,
    I have a flex application where i want to rotate the textarea.I have a mxml file and a .as file.I want to use the embedded font in my application.But I don't know anything.Please advice me details and also how to proceed to create embedded font,how to create the ttf file?I am not using any package and not using library path.
    Please help me.Thanks in advance.

    FangAvatar,
    looks like the same question as the other one we are talking about. The Live docs page
    http://www.adobe.com/livedocs/flex/3/html/help.html?content=fonts_04.html
    has ane xample with rotated labels just oevr half way down the page.
    If you are having trouble navigating with this link, just go to the root
    http://www.adobe.com/livedocs/flex/3/html/help.html
    then in the contents bar on the left open up
    User interfaces
    ...using fonts
    ......using embedded fonts
    the section is just above the heading "Using advanced anti-aliasing"
    Richard

  • Using HTML text with an embedded font in Flex 4

    I have spent a day searching the interwebs and have not found a working example of how to use an embedded font with html formatting.
    Anybody know if it can even be done??

    Should be doable, but all fonts used in the html have to be embedded, and
    one of the fonts should be specified as the fontFamily for the component.

  • Trouble with Preview not using embedded fonts in a PDF

    I have a client I'm working with that is generating PDF reports for various organizations in various languages. They are using an Arial Unicode font but are using different encoding for some of the more unique languages. To ensure the report will be viewable regardless of installed fonts, they are embedding the font.
    Most of the languages are showing up fine in preview, but three languages are giving me trouble. Specifically Greek, Russian and Thai which are using encoding EL8MSWIN1253, CP1251, and TH8TISASCII.
    Basically the question is whether there is some toggle that will tell Preview to use the embedded font? Or something we can put into the PDF (the pdf is created using FPDF) that will allow a user to know which font/encoding they'll need to install in order to properly view the document? (I'm actually trying to figure that out myself...which font I need to install to get preview to view the document properly).
    Thanks in advance for any help.

    Actually, I got that example to work... here are the changes
    I made...
    <mx:htmlText>
    <![CDATA[You can vary the <font size='20'>font
    size</font>,<br><font
    color="#0000FF">color</font>,<br><font
    face="Courier New">face</font>, or<br><font
    size="18"color="#FF00FF"face="Times New Roman">any combination
    of the three.</font>]]>
    </mx:htmlText>
    As I said above, I have found errors in the code of the help
    docs... this is yet another one of them. Usually its spaces in the
    wrong place, or no space at all, or missing ) or ], or a case
    sensitivity issue.
    If you got your custom font to display, that should work...
    but then again.. what should work, doesn't always.

  • Embedded Fonts, how to use in all controls?

    When I embed either external fonts or system fonts they work
    great for say the label control but not for others such as the
    progressBar, on top of this any control that wont use an embedded
    font cant be used in conjunction with an alpha related effect as
    the font will be 100% alpha the entire time. Whats the deal with
    some controls not using the specified embedded font?

    Hi again....
    I must ask again..because I dont think I understand completly how to get speedfan to work in my other profil...( User).
    I installed speed fan as admin and configured it proper according to this forum.....
    It seems to work just fine.......
    Before I logout and switch user I make sure that speedfan is not running and that there is nothing in its autostart.
    I then logout and switch to the other profil.......there I put an speedfan-ikon on its desk....
    When I try to launch speedfan in this profil I get a warning:
    UNABLE TO SAVE TO  C:\program\speedfan\speedfanparams.cfg
    It seems that I only can run speedfan as admin......
    Am sorry to bother u guys again...but u seem to be wise in this matter.....
    I want to be able to run the computer in this other profil, not in admin.
    In this other profil I would like to have speedfan running and showing me the temps of the computer.....
    As I understand its the most secure way to run computers......
    Best regards
    Mr W

  • Embedded fonts with rich editable text

    Hi, I am trying to use my embedded fonts in rich editable text field, but it only works for users that already have that font installed on their system.
    This is what I do.
    I embed fonts like this:
         @font-face {
                src:url("fonts/Cantarell-Regular.ttf");
                fontFamily: Cantarell;
                advancedAntiAliasing: true;
            @font-face {
                src:url("fonts/Cantarell-Bold.ttf");
                fontFamily: Cantarell;
                fontWeight: bold;
                advancedAntiAliasing: true;
    Then in my DropDownList (id=fontPicker) I add a new string entry that references my new font (in this case "Cantarell")
    I have a custom item renderer which makes sure to print out the name of the font using the font itself, so that for example font name "Cantarell" will be printed out using Cantarell font. Code in my custom font item renderer looks like this:
    <s:Label id="labelDisplay"
                 fontFamily="{data}"
                 verticalCenter="0"
                 left="3" right="3" top="6" bottom="4"/>
    And this part works, even if you dont have the font installed on your system, the name of the font is displayed propperly.
    The thing that I want to do is to select some text in my rich editable text field and change the font of the selected text depending on what user selected from the dropdownlist. I added an event which is called once user selects new font type, and it performs following code on the selection in rich editable text:
                   if(fontPicker.selectedIndex == -1){
                        //user did not select anything, we do not change the font
                        text.setFocus();
                        return;
                   //we get the text layout format of the selected text
                    var txtLayFmt:TextLayoutFormat = text.getFormatOfRange(null,text.selectionAnchorPosition,text.selectionActivePosition);
                   //we change fontFamily of the selected text to the font that we just picked
                    txtLayFmt.fontFamily = fontPicker.selectedItem;
                    // I even tryed to add those two following lines without much help
                    //txtLayFmt.fontLookup = FontLookup.EMBEDDED_CFF;
                    //txtLayFmt.renderingMode = RenderingMode.CFF;
                   // we update our selected text with new font
                    text.setFormatOfRange(txtLayFmt,text.selectionAnchorPosition,text.selectionActivePosition );
                    text.setFocus();
    This code works perfect if user has the font installed on their system but it does not work if they dont have the font even if I embed the font.
    What I am doing wrong, any suggestions, tips, links?
    Thanks,
    Dal

    Thanks I will take a look at your blogs, maybe I find some explanations.
    Once it comes to my problem, I found a solution, I just needed to add a simple style:
            .mystyle1 {
                 fontFamily:Cantarell;
    and set the styleName of my text to it:
    text.styleName = "mystyle1";
    Afterwards I can dynamically change fonts and sizes of the text selections in my rich editable text field as much as I like.
    Also I need to make sure that I set embed-as-cff: true;
          @font-face {
                src:url("fonts/Cantarell-Bold.ttf");
                fontFamily: Cantarell;
                fontWeight: bold;
                advancedAntiAliasing: true;
                embed-as-cff: true;
    I hope this helps someone.
    And if anyone has explanation to why embedded fonts work only after I change styleName of a text to a random style, please share with me.
    Cheers,
    Dal.

Maybe you are looking for

  • ASSERTION_FAILED with program RGIMOVV0 during XPRA PHASE

    Hello guys, i'm having a problem applying support package EHP3 into an ECC system . some short part of the dump text : Runtime Errors         ASSERTION_FAILED Date and Time          17.09.2009 15:05:51 Short text The ASSERT condition was violated. Ho

  • HT201272 How to restore purchased album from iTunes

    I use iOS 7.1 in my 4s and 3 days ago Music app keep on freezing. Yesterday, after I hard-reset the phone (sleep & home button pressed together), all music is gone. It appeared like I need to download again from iTunes. But today, it's all gone. No l

  • Uploading longtext

    Hi,   I want to upload lontext(purchase order text) by using LSMW.   In my input file, there are 2  longtext for a particular material number.While I am uploading, first lontext is overwritting by second longtext. I am using the program  '/SAPDMC/SAP

  • How to Create Websheet in  database application in Oracle Apex

    I'm making a database to my new web site and now I'm developing a site with Oracle Apex. The aim of my website provide free Oracle, Java, Unix education (videos, tutorials, articles, step-by-step instructions. etc). My questions - I created a databas

  • In credit management how you process Post Dated Cheque or Demand Draft ?

    Haii Friends Please share your ideas to work on this process.