CSS & AS3 Font Embedding

We have an application which is built like so:
Framework SWC
Application SWC
- Sub-application for web
- Sub-application for desktop
- Unit test runner
- etc.
The applications all share a look and feel including fonts. This was easy to achieve with Flex 3 using the trick with placing a defaults.css file at the root of the Flex Library Project. This would apply the CSS in the defaults.css file as the default theme, and font embedding calls in the CSS could refer to font files in the Flex Library Project. It worked great because we are also using a Sprite-based custom label class which embeds its font using AS3.
Now, the CSS font embed lines only work if we also place the fonts in the Sub-application. This means we have to have the fonts copied in every sub-application for the CSS as well as in the SWC for the AS3 embedded label class.
Is there a better way to achieve this in Flex 4, if we want embedded fonts in AS3 as well as Spark components?
Thanks!
Patrick

Flex harUI wrote:
I'm not sure exactly why you can't use Label and RichEditableText.  You
might want to revisit that decision.
If the font is embedded in the main app SWF and is picked up by TextFormat,
then the most common possibility is that somehow other SWFs are being used
to factory the FTETextField.  Maybe since styles are now per-SWF that's what
is going on.
I cannot use Label or RichEditableText because that particular text is being displayed in a completely Sprite-based view. We feel for that portion of the view that it is worth giving up the advantages of UIComponent to get something lighter weight.
The font for the Sprite-based text is embedded in the class for that text field. The font for the UIComponent-based text is embedded using CSS. Is there a way to use a single compiled SWF for both? Would the SWF just be a single class embedding the fonts? That way we could pull it in at runtime. Would that work for the TextFormat as well?
Thanks,
Patrick

Similar Messages

  • AS3 dynamic font embedding bug

    Hi all,
    Is there a known bug for the following case?
    Case:
    A project I'm working on doesn't seem to handle font embedding correctly when the font is added dynamically using actionscript. When I test my movie it does not display the embedded font at all. Curious about this is, that when I create an empty project using the same code and then embed the font and test the movie it displays the font without any problem.
    Sometimes a reboot of the machine I'm working on will suffice to make the embedding work again, but sometimes is not all the time. So I was wondering if there was a memory related bug that causes this behavior. If so, is there any sight on a solution for this bug? It's more than annoying to reboot eight times a day, just to test a movie.
    How did I embed the font:
    1. Create a "New Font" in the Library, set the properties and give it a classname.
    2. Using actionscript to embed the font in a dynamically generated TextField.
    package{
    import flash.display.MovieClip;
    import flash.display.text.Font;
    import flash.display.text.TextFormat;
    import flash.display.text.TextField;
    public class MyClass extends MovieClip{
    var myFont:Font;
    var myTextFormat:TextFormat;
    var myTextField:TextField;
    public function MyClass():void{
    myFont = new Font1();
    myTextFormat = new TextFormat();
    myTextFormat.font = myFont.fontName;
    myTextField = new TextField();
    myTextField.defaultTextFormat = myTextFormat;
    myTextField.embedFonts = true;
    myTextField.text = "Lorem Ipsum...";
    addChild(myTextField);
    Cheers!
    Do

    I don't have Flash IDE on this machine so I cannot say for sure but try to register font:
    public function MyClass():void {
         Font.registerFont(Font1);
         myFont = new Font1();
         // the rest...

  • How do you define which character set gets embedded with a font embedded in the library (i.e. Korean)?

    I have project that uses a shared fonts. The fonts are all
    contained in a single swf ("fonts.swf"), are embedded in that swf's
    library and are set to export for actionscript and runtime sharing.
    The text in the project is dynamic and is loaded in from
    external XML files. The text is formatted via styles contained in a
    CSS object.
    This project needs to be localized into 20 or so different
    languages.
    Everything works great with one exception: I can’t
    figure out how to set which character set gets exported for runtime
    sharing. i.e. I want to create a fonts.swf that contains Korean
    characters, change the XML based text to Korean and have the text
    display correctly.
    I’ve tried changing the language of my OS (WinXP) and
    re-exporting but that doesn’t work correctly. I’ve also
    tried adding substitute font keys to the registry (at:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
    NT\CurrentVersion\FontSubstitutes) as outlined here:
    http://www.quasimondo.com/archives/000211.php
    but the fonts I added did not show up in Flash's font menue.
    I’ve also tried the method outlined here:
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_16275
    to no avail.
    I know there must be a simple solution that will allow me to
    embed language specific character sets for the fonts embedded in
    the library but I have yet to discover what it is.
    Any insight would be greatly appreciated.
    http://www.quasimondo.com/archives/000211.php
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_16275

    Thanks Jim,
    I know that it is easy to specify the language you want to
    use when setting the embed font properties for a specific text
    field but my project has hundreds of text fields and I'm setting
    the font globally by referencing the font symbols in a single swf.
    I have looked at the info you've pointed out but wasn't
    helped by it. What I'd like to be able to do is to tell Flash to
    embed a language specific character-set for the font symbols in the
    library. It currently is only embedding Latin characters even
    though I know the fonts specified contains characters for other
    languages.
    For example. I have a font symbol in the libary named
    "Font1". When I look at its properties I can see it is spcified as
    Tahoma. I know the Tahoma font on my system contains the characters
    for Korean but when I compile the swf it only contains Latin
    characters (gylphs) - this corresponds to the language of my OS (US
    English). I want to know how to tell Flash to embedd the Korean
    language charaters rather than or as well as the Latin characters
    for any given FONT SYMBOL. If I could do that, then, when I enter
    Korean text into my XML files the correct characters will be
    available to Flash. As it is now, the characters are not available
    and thus the text doesn' t display.
    Make sense?
    Many thanks,
    Mike

  • No Font-Embedding using AIR 3.0 in Flash Professional (for iOS Development)

    Hey there,
    we're developing some plain AS3 projects using Flash Professional (to compile) and Flash Builder.
    All is working good with the new AIR 3.0 release and performance is better than with AIR 2.6
    I followed this tutorial and simlar to use AIR 3.0 instead of AIR 2.6:
    http://kb2.adobe.com/cps/908/cpsid_90810.html
    Sadly today we saw a new issue with font embedding. Neither using Flash Professional itself or Embed-Tag in the code itself works. Also we see that the SWF size does not change when adding multiple fonts.
    Anybody has a clue where this issue might be caused? I can think that the way fonts are embedded has changed in AIR 3.0 and it's not working with the "replace AIR 2.6 with AIR X.Y trick".
    Any help welcome.
    Best,
    Cedric

    Hi,
    yes. It works now.
    The problem was the TLFTextField itself. Strangely in debug on my Mac fonts showed of correctly, but on the device not. So I assumed that there was an problem of embedding.
    But after changing setDefaultFormat to setFormat, then setting the tlftextfield.htmlText = ".." and after that doing tlftextfield.textFlow.flowComposer.updateAllControllers(); it works on the device.
    Strange to me, that with active fonts on my Mac it works without updateAllControllers - but on the devices not.
    Thanks for the hints.

  • Using fonts embedded in the main app in Flash swf(s) loaded at runtime

    Hello there,
    My main application has several fonts embedded via CSS:
    @font-face {
    src: url('/Library/Fonts/ACaslonPro-Regular.otf');
    fontFamily: CaslonR;
    unicodeRange: U+0021-U+007E;
    At runtime the main application loads various swf files that were created in Flash CS5.
    I can't figure out how to allow those dynamically loaded external swf files to use the fonts that are already embedded in the main application.
    Of course I can embed the font in each swf in Flash CS5 to begin with, but that doesn't seem like an elegant solution, let alone it significantly increases the file size of every swf.
    Thanks,
    FTQuest

    See the embedded font post on my blog
    Alex Harui
    Flex SDK Team
    Adobe System, Inc.
    http://blogs.adobe.com/aharui

  • 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

  • Font embedding problem PPT plugin Acrobat 9 Pro

    Hi,
    having just updated to Acrobat 9 Pro I encounter a font embedding problem when using the PowerPoint plugin (PPT2007) to create a PDF of my presentation. I am working under Windows 7 (64Bit) and use fonts from Mathematica (Wolfram). The generated PDF shows problems displaying the fonts, indicating that they have not been embedded (although font embedding of these fonts is set in the options). The problem does not occur if I directly print to the PDF printer - here all Mathematica fonts are correctly embedded (but this has other disadvantages since videos/animations are not integrated). The problem seems to be specific to Acrobat 9 since under Acrobat 8 everything worked correctly as well.
    Any ideas/solutions for that issue?
    Thanks & best regards
    Ralf

    Perhaps you may need to upgrade to version 9.2 (Acrobat support of Windows 7 begins at this dot release)?
    Be well...

  • 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 works in 1.8 preview, not in 1.7.2

    Hello,
    I'm currently creating epubs and testing them in ADE. I am embedding Google Webfonts.
    I'm finding that many fonts embedding using @font-face are ignored by ADE 1.7.2. However, ADE 1.8 preview appears to show them as intended. Incidentally, the fonts are always shown correctly on ibooks.
    Could you please let me know what is wrong - is it a bug with ADE 1.7.2, or would there be a reason why it would not 'like' my Webfont TTFs? I've found at least one other user having a similar problem, apparently: http://www.mobileread.com/forums/showpost.php?p=1725479&postcount=7
      @font-face {
      font-family : 'FanwoodItalic';
                                            src: url(fonts/Fanwood/Fanwood-Italic-webfont.ttf);
      font-style: normal;
                        h2 {
      font-family: 'FanwoodItalic';
    Thanks for your help.

    Are the fonts obfuscated? If so, using what method?

  • Font embedding problem in PDFs

    Since upgrading to Leopard from Tiger-
    We are losing fonts embedded into pdfs, either saved through Preview or Adobe Indesign CS3.
    The preview of pdfs, both in the finder windows and in Entourage email attachments are missing fonts too. Sometimes opening them resolves the issue, but not usually.
    This has occured to both User and System level fonts.
    We have cleaned the font caches, but this only provides a temporary fix.
    We have tried not using our Suitcase Fusion and just letting FontBook manage the fonts on this machine, the problem still manifests itself.
    The only change in the equation from a perfectly operational machine was the change from Tiger to leopard.
    Any thoughts/help = greatly appreciated.
    Matt

    Update: Reader 8 on a PC displays everything fine, so it's a matter of updating

  • Need all fonts embedded in my PDF.

    I converted a word document to pdf through pdf pack. How can I get the following fonts embedded in my pdf: arial MT, arial MT bold, and arial MT italic? Thanks.

    Hi Cyn Tarr,
    You can embed fonts using Adobe Acrobat.
    PDF Pack cannot accomplish this.
    Regards,
    Rave

  • How to extract Chinese text from font embedded text PDF?

    This is actually font embedded text PDF (Used: type 1 fonts & custom encoding) and not scanned PDF, however I am unable to extract the "Chinese language" text properly and found only the garbled text when "Copy & Paste" (or save as RTF). Kindly refer the sample PDF attached for your reference.
    Kindly advise how could I solve this problem.
    Thanks in advance for your better solution.

    As I was unable to upload the sample page PDF in my original thread, I have shared now in the following path. Kindly look into this and guide me how to extract the chinese text as UNICODE text.
    Downloading: Chinese_Text_Extraction.pdf - Uploadingit

  • Font embedding chinese

    Hi all,
    I need to know if font embedding is possible for multilingual data ( ie chinese data). I have SimSun.ttf which I converted to afm and pfb files using ttf2pt1 tool. But there were lots of exception when the conversion was done. When i try to embed the font using the pdf-embed option the pdf is not getting opened atall. Can anyone give any inputs on this.
    can we generate pdf with embed option that has chinese data. What font is proposed for the embeding. I am unable to get correct afm and pfb fonts.

    i have installed the acrobat asian font pack. I have the stsong font. it is a cid font. Can anybody tell how to embed a cid font in a pdf. I couldn't find any online resources that would help me do this.

  • How to disable automatic font embedding in CS5?

    I installed CS5 and opened an old .fla which did not embed the Arial font because everyone has it already. Mostly it is used for user-entered and dynamic content.  However, CS5 is auto-embedding the few characters I use in Arial, and all of the other characters are no longer showing up in the swf file.  The only fix seems to be embedding the entire Arial font in the movie, which is too large since I want to be able to support all kinds of characters.
    Is there a way to turn off auto-font embedding?  This feature seems well-intentioned but critically flawed if it can't be turned off.
    -Ben

    Hi,
    You can set the TextField's Anti-alias setting to "Use device fonts" if you don't want to embed the font.
    HTH,
    Nivesh

  • Use of fonts embedded in photoshop for commerical use? (Static content, like images)

    Hello.
    I am developing a Mobile game for Android, and I can't stop thinking about if i am in the clear when it comes to the use of fonts. I've searched the web, but can't really find a clear answer.
    I am using only font embedded in photoshop/illustrator, and only displaying them in static content, such as Images/logos. So my question is, am I in the clear, or do I need som kind for special license for this?
    FYI I am mostly using the MonoType Impact font. I stumbled over this though, its Monotypes Imaging EULA for fonts ( I think). It says :
    You may embed static graphic images into an electronic document, including a Commercial Product, (for example, a "gif") with a representation of a typeface and typographic design or ornament created with the Font Software as long as such images are not used as a replacement for Font Software, i.e. as long as the representations do not correspond to individual glyphs of the Font Software and may not be individually addressed by the document to render such designs and ornaments.
    Would appreciate any help, thanks!

    you can access them from <bpelx:exec> activity and you can pass these returned document to underlying java class.
    Re: getVariableData in Java Exec

Maybe you are looking for