Accessing a non TTF/OTF font embedded in Flash CS5 SWF via Flex

Hello,
I'm trying to embed an older Mac font in a Flash Builder application. I need it to be loaded dymanically for size reasons. I am able to do this with TTF and OTF fonts, but I'm having trouble with other formats.
I embedded the font in a CS5 FLA, but I can't seem to locate the font when I load the SWF into Flash Builder.
My function is below. I have it enumerating through the variables in the loaded SWF, but the font I need is not coming up as one of them. I tried, in the FLA, to cast the embedded font to a Class in AS because, but when try to access that variable ("font") after it's loaded, I get null. I also tried setting the embedded font to a Font variable in AS, but I still get null on the other side. Does anyone have any suggestions? Alternate solutions are welcome also.. Thanks!!
        private function loadFonts():void{
            var lc:LoaderContext = new LoaderContext();
            lc.securityDomain = SecurityDomain.currentDomain;
            lc.applicationDomain = ApplicationDomain.currentDomain;
            var ldr:Loader = new Loader();
            ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
            ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            ldr.load(new URLRequest('compatil_bold.swf'),lc);
            function completeHandler(e:Event):void{
                fontLibrary = e.target.applicationDomain.getDefinition('Compatil') as Class;
                var varList:XMLList = flash.utils.describeType(fontLibrary)..variable;
                for (var i:int = 0; i < varList.length(); i++){
                    trace(varList[i].@name+': '+fontLibrary[varList[i].@name]);   
                Font.registerFont(fontLibrary.font);
                //Font.registerFont(fontLibrary.CompatilFactBold);
                trace('font loaded');
                fontsLoaded = true;
            function ioErrorHandler(e:ErrorEvent):void{
                trace(e.text);
in FLA
var font:Class = new CompatilFactBold() as Class;

I got it!
Here is the embedded font in a CS5 FLA:
That's all you have to do in Flash.
Here's the function I have in my Flash Builder AS application:
private function loadFonts():void{
var lc:LoaderContext = new LoaderContext();
lc.securityDomain = SecurityDomain.currentDomain;
lc.applicationDomain = ApplicationDomain.currentDomain;
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
ldr.load(new URLRequest('http://some.other.domain/compatil_bold.swf'),lc);
function completeHandler(e:Event):void{
fontLibrary = e.target.applicationDomain.getDefinition('CompatilFactBold') as Class;
Font.registerFont(fontLibrary);
trace('font loaded');
fontsLoaded = true;
function ioErrorHandler(e:ErrorEvent):void{
trace(e.text);
Then you reference the font by its name when you want to use it. In this case: 'CompatilFact LT Bold.'
update: question is answered.

Similar Messages

  • Font embedding in Flash CS5

    Hi,
    I have 3 swf files: Main, FontLibrary and Graphics.
    Main.swf loads the other two and applies logic.
    Graphics.swf is created in Flash CS5 and contains a dynamic TextField instance, to which I want to apply a font from FontLibrary.swf. To know which font to apply, I apply the same font to textfield when I create it on stage.
    The problem is that the textfField with embedFonts=true searches for glyphs in its own swf file first. I don't want to embed the font in Graphics.swf. I use anti-alias type "Use device fonts". But as size report shows it still embeds the font, with no glyphs though.
    Is there a way to not embed a font into swf file using Flash CS5.5?
    (Buy the way, if I use TLFTextField it doesn't embed the font)
    Or how can I handle the situation from my Main.swf in a way that I get font not from Graphics.swf, but from FontLibrary.swf

    Good tutorial for you:
    http://www.republicofcode.com/tutorials/flash/as3text/
    http://www.republicofcode.com/tutorials/flash/as3css/

  • None of my fonts install into photoshop cs5. why?

    I had my computer repaired a few months ago by Mac Medics and ever since my photoshop will not install fonts. Its photoshop cs5. I have an osx 10.6.8 system. The fonts install fine in all other adobe and microsoft programs. I tried doing what several of the forums online suggested and nothing is working. Am I missing something? I have reinstalled photoshop. I have done the Application Support route, I have emptied caches. I'm trying to fix it myself before i call MMac Medics. Ideas?

    JesseShell wrote:
    Hi Joe. Yes I did that. In fact, yesterday I did it again but I completely uninstalled the whole Creative Suite and disabled it. I reinstalled it. This time I at least found that the Adobe font folder was not empty as it had been before I uninstalled CS. The programs still don't grab the font from my font library like they should but I was at least able to make aliases as before and drop them into the folder. That worked. However, they should be loading directly into the applications.
    Most "well behaved" (designed to Apple standard coding practices) applications use the fonts directly out of OS X's own font library, but Photoshop has some old code that builds and uses its own font library. One of Adobe's contributions to their reputation of being a memory hog. IIRC Photoshop Elements and InDesign both have a much newer code base and use the system font library. Why this is creating a problem for you only Adobe knows for sure.
    JesseShell wrote:
    Another issue I've had is that nearly a dozen times over the last three months I get a grey'd out screen and in 50 different languages it tells me to power my computer off. I need to take it back to Medics. Maybe they can fix both issues. For now, I can work with it. Thanks for all the input.
    That, my friend, is called a full blown kernel panic and those can be a real bear to diagnose unless they are reliably repeatable. While kernel panics can be caused by software problems the most common causes are a bad CPU, a bad logic board, or bad RAM. I hope you either have Applecare or Mac Medics has you covered under a service warranty on their work as a new CPU or logic board can get pricey!

  • How to make the font shown in Flash CS5 ?

    The font can not be shown in Flash CS5,
    I download the Meiryo font from internet, and paste it to the font folder in windows7 control panel , when i re-open the flash cs5, it is not shown yet. who can tell me how to solve this problem?

    Thanks for the tip, I did try this, but it didnt work.  It works for Texting, email and other apps, but not the "Music" or itunes app.  thats the frustrating part.

  • Issues with font in adobe flash cs5

    i have a font that is installed on my system Mac OSX Lion and can view it fine, however i have a fla file that i used the font in and when i look at the drop down box of fonts, this is not showing, i have tried reinstalling the font with no luck what so ever.  Any help here would be greatly appreeicated.         

    Are you using Classic textFields or TLF textFields? In authoring you see the font that you want, you can select that font and use it in a textField during authoring, correct?
    How are you using the font? Is the font in your movie's Library? Are you using the font in a static, input or dynamic textField, if you are using TLF text then is the textField Read Only, Selectable or Editable?
    Are you embedding the font?
    Do you see the text when you Test Movie in authoring?

  • Font not visible in Flash CS5

    Hi,
    I have purchased this font "HY Zhong Hei Simplified Chinese J" and installed on my PC but it is not visible in FLASH CS5
    Please help.
    Thanks,
    Vikrant

    Yes it is listed in other softwares like photoshop and it is also in TTF format.
    Photoshop: Font showing up
    Flash CS5: Font not showing up

  • Ttf-hunky-fonts pkgbuild: bitstream vera with non Eng chars

    Saw it, built it, posting it :-)
    I admit it - not all characters are perfect. But this is the first version and author promised to repair it soon. Still, if you want to have Bitstream Vera TTF fonts (originally lacking nonEn chars) with additional characters ("Baltic, Central European, South European and other languages, including Maori, Welsh and Esperanto") you can try it. It can co-exist with other ttf fonts (including original Bitstream Vera). Font names are Hunky Serif and Hunky Sans.
    ttf-hunky-fonts PKGBUILD
    pkgname=ttf-hunky-fonts
    pkgver=0.1.0
    pkgrel=1
    pkgdesc="Bitstream Vera based TTF fonts with non-English characters"
    url="http://www.yoper.com/ariszlo/hunky.html"
    depends=('x-server')
    install=ttf-hunky-fonts.install
    source=(http://www.yoper.com/ariszlo/packages/SOURCES/hunkyfonts-$pkgver.tar.gz)
    md5sums=('082b8220b2112830f7e418451a2c2f78')
    build() {
    install -d -m755 $startdir/pkg/usr/X11R6/lib/X11/fonts/TTF
    install -m644 $startdir/src/hunkyfonts-$pkgver/TTF/*.ttf
    $startdir/pkg/usr/X11R6/lib/X11/fonts/TTF
    ttf-hunky-fonts.install
    # arg 1: the new package version
    post_install() {
    echo "Rebuilding font cache..."
    /usr/bin/fc-cache
    echo "...done."
    # arg 1: the new package version
    # arg 2: the old package version
    post_upgrade() {
    echo "Rebuilding font cache..."
    /usr/bin/fc-cache
    echo "...done."
    # arg 1: the old package version
    pre_remove() {
    /bin/true
    # arg 1: the old package version
    post_remove() {
    echo "Rebuilding font cache..."
    /usr/bin/fc-cache
    echo "...done."
    op=$1
    shift
    $op $*

    Saw it, built it, posting it :-)
    I admit it - not all characters are perfect. But this is the first version and author promised to repair it soon. Still, if you want to have Bitstream Vera TTF fonts (originally lacking nonEn chars) with additional characters ("Baltic, Central European, South European and other languages, including Maori, Welsh and Esperanto") you can try it. It can co-exist with other ttf fonts (including original Bitstream Vera). Font names are Hunky Serif and Hunky Sans.
    ttf-hunky-fonts PKGBUILD
    pkgname=ttf-hunky-fonts
    pkgver=0.1.0
    pkgrel=1
    pkgdesc="Bitstream Vera based TTF fonts with non-English characters"
    url="http://www.yoper.com/ariszlo/hunky.html"
    depends=('x-server')
    install=ttf-hunky-fonts.install
    source=(http://www.yoper.com/ariszlo/packages/SOURCES/hunkyfonts-$pkgver.tar.gz)
    md5sums=('082b8220b2112830f7e418451a2c2f78')
    build() {
    install -d -m755 $startdir/pkg/usr/X11R6/lib/X11/fonts/TTF
    install -m644 $startdir/src/hunkyfonts-$pkgver/TTF/*.ttf
    $startdir/pkg/usr/X11R6/lib/X11/fonts/TTF
    ttf-hunky-fonts.install
    # arg 1: the new package version
    post_install() {
    echo "Rebuilding font cache..."
    /usr/bin/fc-cache
    echo "...done."
    # arg 1: the new package version
    # arg 2: the old package version
    post_upgrade() {
    echo "Rebuilding font cache..."
    /usr/bin/fc-cache
    echo "...done."
    # arg 1: the old package version
    pre_remove() {
    /bin/true
    # arg 1: the old package version
    post_remove() {
    echo "Rebuilding font cache..."
    /usr/bin/fc-cache
    echo "...done."
    op=$1
    shift
    $op $*

  • External TTF Font Embedding, is this still the way?

    Hey all,
    I'm a typical embedder. I just embed the fonts, register them from another file and be done with it. Though I'm starting to desire to embed some ranges and also use test loading external .ttf files.
    What is the best practice for embedding an external TTF at runtime? Is it still basically like this? Anything more modern? I find most blog posts on the subject range in the 2007 area.

    Thanks I was just curious if it was such an old topic on the net because it never changed syntax. So it remains the same way to this day a few years later.
    I also know you can embed ranges using the font manager in  CS5 or CS5.5 and that's what I'm doing now. I'm just wondering if there's any advantage to embedding external .ttf files. One of which could be naming the font something generic both in the code and the filename itself like font.ttf and being able to change the font externally without recompiling the SWF. I was considering options such as that.
    Thanks for the tip!

  • Full Font embedding in PDF

    A couple of years ago, I set up some Distiller profiles to fully embed fonts into my PDFs. No subsetting allowed.
    Since then, I've been using Indesign's PDF Presets, which used my created profiles, to create these same pdfs. Now that I have an issue that I need to investigate, I checked my PDFs in Acrobat and find that all my fonts are embedded subsets.
    Now when I try to open Distiller 9 it locks up on me and I'm unsure why. Cannot find a key combination to release Distiller's settings that choke it.
    But reading about on these boards, I'm getting the sense that perhaps I cannot fully embed anymore? I've made PDFX 1a, 3a, and 4 and find they are still subsets. These are mostly Type 1 and OTF, with a couple of TTF's mixed in.
    What is best practice so that a PDF that is provided to printer, etc has the full font embedded, provided the permissions for the font is set?
    thanx, sam

    PDF font embedding/subsetting is the current operation - there were just too many issues with indexed fonts with the old PDF export engine (lack of Il8n support, must deploy font files with the PDF, lack of proper barcode support etc).
    The engine will still index fonts if it tries to use font that's unavailable or not subsettable on the runtime system, and defaults to the Java default fonts.
    That's not something I recommend - font substitution to the default Java fonts would play havoc with your report formatting.
    PDF font subsetting is currently the way all current Crystal Reports engine works.
    Sincerely,
    Ted Ueda

  • Font embedding issue

      I'm using Adobe Acrobat 9 Pro.
    The font "Helvetica" will not embed on a PDF document that I have using the "Embed all fonts" pre-flight.  The actual font is 'Arial MT' (which is in my font library) but even the ArialMT fonts here are embedding as type 2 CID fonts:
    Fonts prior to embedding:
    I use the "Embed fonts (even if text is invisible)" preflight, then the fonts look like this:
    I've looked up that "Helvetica" font for purchase and the closest I found was the "HelveticaLTStd-Roman" font (according to the Adobe font cross reference list) so I've purchased and installed the font but it still won't embed.
    Anyone know how can I get this font to embed? Do I need to purchase a different font (Helvetica-Medium)? Or is there something else going on?

    I'm experiencing a related font issue in Illustrator: I'm unable to embed fonts in a PDF using Illustrator CS5.5 (Mac OS X 10.7). An Illustrator message says that their is a licensing restriction that prevents embedding the fonts in the PDF. The original ttf and otf fonts were initially purchased for a Windows machine years ago, and many of them came with Illustrator. I've embedded fonts in a PDF using Illustrator (on the Windows side) without a problem for many years.
    Is this a font installation issue? Since the "installation" process is different for a mac, is it possible the fonts were not "activated" when they were copied to the library/fonts folder? The fonts do appear in the illustrator file, but not the PDF.
    Could this be a Distiller issue? Is Distiller involved when Illustrator saves to a PDF?

  • Load OTF font from file

    I've read in several places, that java 6+ supports OTF fonts, yet I can not find, how one can load an OpenType font frm a file.
    There are numerous examples of how to load TTF fonts, by calling
    Font.createFont(Font.TRUETYPE_FONT, fontFile);but none seems to notice the glaringly obvious problem, that the OPENTYPE_FONT font type constant does not exist.
    So... is it possible? How is it possible?

    As it turns out, the OTF fonts load just fine with Font.TRUETYPE_FONT set as the font type.

  • Can not copy text from pdf with unicode font embedded.

    Hello,
    I have a pdf with unicode font embedded in it. The pdf has no restrictions. When i try to copy some text text fro m pdf and then paste itin word, the text is not the same which i copied from the pdf. it changes.
    I have tried multiple softwares which converts pdf to word or pdf to excel. but none can do my job. what should be the problem? Kindly guide me.
    Thanks & Regards-
    rashmi

    Thanks for your prompt reply.
    As i said i have the font installed on my system. for your reference,
    following is the link to the pdf file. also the second link is the link to
    the fonts used. Kindly help me to sort this issue.
    https://www.yousendit.com/download/T2dkcHBEVEh0QTIwYjhUQw
    https://www.yousendit.com/download/T2dkcHBFQXBrYUJYd3NUQw

  • Embedding and using external fonts in Flash CS5

    I just upgraded to Flash CS5.  Font embedding is entirely different than it was in CS4.  I've been looking for examples online but none seem to show me a solution that matches what I need.
    In the project I'm working on, code changes the font a text box uses based on region and language.  To keep file size down I created separate swf files with the fonts embedded.  That way I only download the font I need.  The way I did this and the code I used in CS4 doesn't seem to work anymore.  Can someone please point me to a tutorial on this.
    Thanks

    OK, maybe you can help me figure out what I'm doing wrong.  Below is the code I'm using.
    LOADING THE FONT
    Font SWFs:
    I'm trying something new with CS5.  To create a swf with the font I need I'm creating a library symbol of the font with all the characters in it.  Titled it "Verdana".  I've also turned on Export for ActionScript and given the font a unique class name (VerdanaFont).  Then of course publish the swf, name it Verdana.swf, and put it in the correct location.  Does doing it this way automatically register the font?
    The Loader code:
    private function LoadFont()
    var fontPath:String = "assets/fonts/Verdana.swf";
    var fontLoader:Loader = new Loader();
    fontLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, createTextBox);
    fontLoader.load(new URLRequest(fontPath));
    The TextBox code:
    private function createTextBox()
    var tf:TextFormat = new TextFormat;
    tf.font = "Verdana";
    tf.align = "left";
    var textBox:TextField = new TextField;
    textBox.embedFonts = true;
    textBox.selectable = false;
    textBox.htmlText = "This is test text";
    textBox.setTextFormat(tf);
    stage.addChild(textBox);

  • Embedding fonts in an existing pdf that does not have the fonts embedded

    Hi,
    I have an existing pdf that fails to open on my ereader.
    So I opened in acrobat x pro to see what might be the cause.
    Selecting "file"--> "properties" -->"font" ( fonts used in this document) I can see that this pdf uses multiple windows trueType fonts and that none of them are embedded in the pdf document.
    Now my ereader is linux bases, so I am guessing this might be a problem.
    Being an ereader I didn' give me much to go on.
    So i would like to embed all the fonts listed in this list into the pdf file and save it again with the fonts embedded.
    I went to "file"-->"save as optimized pdf" -->"font"
    But there both lists embedded and unembedded fonts are empty.
    Why is this and how can I embed the fonts shown in the document properties into the pdf?
    They seem standard windows fonts like e.g.  ArialNarrow

    I just looked a bit furder and actually checked wether the fonts existed and found the following:
    I am using windows vista.
    The fonts mentioned in the properties of the pdf actually exist in the windows installed fonts but
    in windows they are no longer TrueType but OpenType.
    So I am guessing this might be the reason they are not in the list of unembedded fonts in the optimizer window.
    Is there an easy way to say to acrobat to replace one font ( not found on this computer) with another font that does exist and also to embed that font in the pdf document?

  • Font Embedding Question in PDF exported from PageMaker v7

    I am having difficulty embedding the majority of my fonts in PDFs exported from PageMaker v7. When exporting to PDFs, a "cannot embed font" error is generated.
    Technical Details:
    The fonts I have are ALL LEGAL, and were purchased with complete licenses when required.
    The fonts properties show them to be completely embedable, with no restrictions in terms of installation, etc.
    The fonts can be placed and embedded in PDFs from all other programs I've attempted this with (Illustrator, Acrobat, MSWord, WordPerfect, etc.).
    Disclaimer:
    Yes, I know PageMaker is old, and yes, I am in the process of upgrading to Creative Sutie (although, as an aside, it is extremely disappointing that even a token discount is not offered to those who have purchased every Adobe and MacroMedia software package in the past, but I digress...). However, several of my clients require PageMaker files (for a variety of reasons I won't go into here).
    Thank you in advance for any advice on what might be the underlying problem.

    When generating PDF output from Pagemaker, I've used 2 methods:
    1. File>Export>PDF
    This method works fine for a limited number of fonts (AGaramond for example), which is why I started this post. Bob Levine had suggested using Distiller instead.
    2. File>Printer Styles>Acrobat
    I usually used this method when an offset printer requires crop marks, since the other method does not provide an option for crop marks.
    This opens a window with numerous options, the pertinent ones to my question are:
    Printer: New 2002 PPD for Adobe PS Driver on file
    PPD: Adobe PDF 3015.102
    Postscript: Download Fonts (3 options):
         None
         True Type and Type 1
         True Type Only
    When I choose download "True Type and Type 1", I get the same "cannot embed font" error if I use most of my fonts (with the exception of a few that work).
    When I choose NONE for the option, the PS file is generated without errors.
    Once the .ps file is generated, I then use Distiller 4 to open the file and output PDF file.
    If I used "True Type and Type 1" for download font option, and the font does not generate an error, the PDF file is fine.
    If I used "NONE" for download font option, when I open the PDF, it indicates that the fonts are embedded. However, since I do not download the font, I am nervous that this might cause problems when I go to an offset printer.
    I do not print to a file using a printer driver (for example Linotype, Acrobat, etc.). The 2 processes I've used seem to be independent of what the default printer is on the operating system (XP).
    Thanks!

Maybe you are looking for

  • CRM server connecting to NON-R/3 servers & R/3 Servers

    HI Experts, Please explain how the r/3 sysytem & CRm system are connected , how the crm system & Non -r/3 SYSTEMS are connected. the above mentioned are connected mainly by SOAP ( Simple object Access Proctocol). Please explain the conecpt for the ab

  • Can any '6700 Classic' owners help me please

    I would appreciate any help from 6700 classic owners please to my post from the 28th June (link below) Thanks /t5/Other-Nokia-Phones/6700-Classic-Which-buttons-need-to-be-pressed-for-PC-Suite/td-p/714049 History: Always Nokia since 1994 including Nok

  • EC Sales List - EU codes4 and 5

    HI SAP experts! i´m trying to understand how  EC Sales List (Poland, Hungary, and Czech Republic (T-code :RFEULIST) works. i read some notes which  tell me about customize vat code with  "EU code" 4 and 5 but when a use this codes they are never  bee

  • Assign task with use a document variable

    Hi,   if i'm assigning a pdf document in assign task operation with use a document variable instead of application asset, I see the same old blank form after user submits the form. what ever typed in the form is not seen in the output variable assign

  • Microsoft Office 2007 - Installation

    Hello All I would like to know what are the exact component that needs to be tested, when I install MS Office 2007. Would there any impact on BI side, I mean BEX, WAD etc.. All these tools would work as normal ?, or is there any additional patches th