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.

Similar Messages

  • HTML text with ToolTipManager.createToolTip

    I need to use HML text with the ToolTipManager class. Is there a way this can be done, possibly using the toolTipClass?
    Thanks!

    Yes, but ToolTip can be extended to work with html: http://flexexamples.blogspot.com/2009/07/flex-html-tooltip-component.html.
    However, this doesn't work for ToolTipManager.createToolTip().

  • Using InterMedia Text with FrameMaker, StarOffice...

    I'm planning to use InterMedia text with various kinds of documents, but inso filter does not support them. In particular, it does not support:
    - Framemaker
    - PostScript (I know it works on encapsulated PostScript)
    - Applix
    Where can I find the right filters?
    Is there a way to use InterMedia text with these documents?
    Thank you
    Paolo Bonanomi

    I'd suggest searching the web - there are a number of little freeware filters out there that could be used as user-filters.>Have anybody found a postscript filter and can post it here ?
    Regards,
    Mihai

  • Using speak text with pages

    Trying to use speak text with pages.
    Keyboard pops up all the time
    Blocking the speak now option.
    Anyone have a way around this?
    iPad 1, large file.

    Mine does show up, but not on the right like in other apps, but on the far left of the menu.
    Jason

  • How Can i use Html frames with  simple JSP???

    How Can i use Html frames with simple JSP???
    Actually i am creating an application in which i have used Index.html as frame.
    Noew i am trying that if i click on a link of one frame(say menu frame) the \result shoul come to some other frame(say frame named mainwindow).
    Hoe can i do like this???
    Anand Pritam

    Well i am using..
    < Base target="mainwindow">
    But it is no working is there some other way??

  • Arabic Text with SKR Headr1 Font

    I have installed Indesign CC, Added New Arabic Text with SKR Headr1 Font, but arabic text is scrambled, Tried with CS5/6, same issue, I Have i7-Win7x64 Arabic Enabled

    HI Jeff,
    On more query, Do I have to buy  Minion Pro to work properly,
    Text shows crossed blocks.. looks text hidden

  • Calculate text with for specific font

    Hi,
    is there some support to calculate the width of a text with a specific font? E. g. if the font is equi-distant or not or different size, it has a different width.
    Regards
    Oliver

    You can add a listener and then (I assume) make changes if the text does not fit:
    txt.widthProperty().addListener(new ChangeListener() {          
                 @Override public void changed(ObservableValue o,Object oldVal, Object newVal){
                      if ( newVal instanceof Double){
                           double xw = (Double) newVal;                       
               });

  • Text display issues with htmlText, Embedded Font

    Hey All,
    I'm having an issue with the display of my hyperlinks in a
    textfield that is using embedded fonts. It offsets the hyperlinks
    to the left along the line they are on and the underline doesn't
    stretch all the way under the text field. The text display normally
    when I don't embed the font. For some reason I think this might
    have to do with the embedded character range so I opened it up.
    Does anyone know if this range is enough or if there are special
    characters flash uses that need to be embedded for their width even
    though they arn't displayed.
    Embedded range:
    [Embed(source='MyriadPro-Regular.otf', fontName='Myriad Pro',
    unicodeRange='U+0000-U+00fe')]
    Here's a link to the related code:
    http://pcpnew.privatepaste.com/a7eKaAuCTt

    Any ideas?

  • Refying PDF with subset embedded fonts fixes text extraction

    Hi All,
    I know it is not a good idea to (just) refry PDF files (PDF -> EPS -> PDF). Especially when the PDF contains subset embedded fonts. Chances are you will end up with a PDF file which does not contain valid (searchable) text.
    I did not know the apposite could also be true. The following zip file contains 2 PDF files echo containing two words: the original and the refried version.
    Refried.zip
    When selecting text from the original PDF (using acrobat 6 through X) file it contains incorrect text, in this case invalid capitals. If I try the same in the refried version the extracted text is correct.
    It seems strange to me that a process which only can result in loss of information "fixes" this text issue. Somewhere the correct text must be hidden in the original PDF file. Not only capitals seem to be effected but also random characters which seem to be fixed once refried.
    Could anyone think of an explanation?
    Is there a workaround without having to refry the PDF (refrying often results in loss of information). I have no influence on the PDF files I recieve, therefore I cannot embed the full fonts.
    I am using de C++ SDK for Acrobat to write plugins.
    Any pointers would be great!
    Kind regards,
    Robert

    Thanks again for your reply,
    Your explanation makes sense.
    I went ahead and removed the tounicode cmap just to see what would happen
           if (CosDictKnown (cosFont, ASAtomFromString ("ToUnicode")))
             CosDictRemove (cosFont,ASAtomFromString ("ToUnicode"));
    As you predicted this fixes some issues and introduces new ones.
    The results differed from the refry method, in some cases the refried PDF did not contain extractable  text, in other cases the PDF without "ToUnicode Cmap" had no extractable text.
    Maybe I could combine the information of different text extraction methods to make an educated gues which one (or combination of) is best :S
    I suppose looking at individual textruns (with all its complexity) would not help me either...
    Kind regards,
    Robert

  • Gumbo text elements and embedded fonts

    Hi again,
    ok I found the solution. The first time, I searched in the "CSS Advanced Selectors" spec document for the solution and I found nothing about it. Then I had the "great" idea to look in the only right place which is of course "Text Primitives (TextBox, TextGraphic, and TextView)". There I found the hint about "DefineFont4" which, with some search, led me to the solution:
    1. Add the new property "cff: true" in the "@font-face" css block
    2. Set the property fontLookup="embeddedCFF" for the text element
    et voilà!
    I hope this will save somebody else some time!
    Haykel Ben Jemia
    Allmas
    Web & RIA Development
    http://www.allmas-tn.com

    OK,
    I have given up messing with stylesheets, trying display:
    block, inline, different ways of formatting the XML, messing with
    XML.ignoreWhiteSpace, and XML.prettyPrinting etc.
    I went down the route of encodeURI, using a RegExp to strip
    out all tabs, linefeeds and carriage returns. This now gives
    consistent results for all situations, even embedded and none
    embedded fonts.
    e.g.
    _text:String = TEXT FROM XML, HTML TEXT etc
    var st:String = encodeURI(_text);
    var pattern:RegExp = /(%09)+|(%0A)+|(%0D)+/g;
    st = st.replace(pattern, "");
    st = decodeURI(st);
    YOUTEXTFIELD.htmlText = st;
    The <p> tags still behave as a <br/> tag, but you
    can add an extra <br/> to simulate a paragraph.
    Here is the example again with the updates,
    Hope this helps someone

  • Dynamic text box, HTML Text with Image

    Hello Everyone,
    I am using Flash version 8. I have used the text tool and
    created a dynamic text box and have attached the UIScrollBar
    component to it. This text box is configured to allow the use of
    html text to be inputted to it. I have code that reads a file which
    contains a list of text files that I then read and place them into
    the text box. The user can use the scroll bar to scroll through all
    the text.
    I have created an image that is a picture of the tab portion
    of a file folder. On the tab I have place some text. This was all
    done in Photoshop. This tab image is used to separate the different
    stories in the text box. The image is save as a jpeg file
    Everything you have just read works with out any problems.
    Now for the problem!
    This image is only 20 pixels tall and the text is not very
    readable. As we all know the HTML tags are very limited in Flash 8.
    Ideally I would like to put the text and image in to the text
    box as I would normally do. Then place text on top of the image and
    have it all scroll properly with in the text box.
    I have taken the tab image and converted it in to a graph
    symbol and then put the text on top of the image. This looks good;
    however I don’t know how (or if it is even possible) to place
    the graphic symbol in to the text box at the correct place within
    the text.
    Does anyone have ideas on what may work? Remember that the
    image I am working with is only 20 pixels tall which is why the
    text quality on the image is so poor.
    Thank you all for any help you may provide,
    Steve

    Yes Tim I am using the <img> tag and I know that I
    can’t place text over the image. I have set the height and
    width to be the exact size of the image. However When you go to the
    webpage it will open the movie to the maximum size based on the
    resolution of your display; however I do maintain the aspect ratio
    of the movie. For testing I did set a fix size to the size of the
    movie. Sometimes the fix size (1000x750) looks better and sometimes
    a larger size (example 1280x1024). I believe that the main problem
    is the fact the size of the image is 670 pixels wide by 25 pixels
    high and of the 25 pixels the text is only 18 pixels tall. In
    Photoshop this makes it about a 1.75 point font. As you can see the
    real problem is that I don’t have enough pixels to make up
    the text. This is why I am looking for an alterative way to create
    the text.
    I tried importing the image into flash as a graphic symbol
    and then using the text tool to create the text. The results looked
    real sharp, the text was nice and crisp (just what I wanted). The
    problem is that I could not find a way to place the graphic symbol
    into the dynamic text area like id did using the <img> tag.
    This symbol needs to scroll as you scroll the text in the text
    area.
    This is why I am asking for help. I am looking for some ideas
    that may work.
    Thank you,
    Steve

  • How to set fontFamily with an embedded font of a textFlow ?

    Hy,
    When I create a TextFlow without use any component of the flex SDK (4.0.13827) and then I try to change or apply a FontFamily of an embedded font, it doesn't work. Whereas when I use a component like RichEditableText or Label, it works.
    Bellow the code I wrote for my test :
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                xmlns:s="library://ns.adobe.com/flex/spark"
                                xmlns:mx="library://ns.adobe.com/flex/mx"
                                creationComplete="creationCompleteHandler(event)"
                                width="800" height="600"
                                >
         <fx:Style>
              @namespace s "library://ns.adobe.com/flex/spark";
              @namespace mx "library://ns.adobe.com/flex/mx";
              @namespace local "*";
              @font-face {
                   src:                         url("assets/Fonts/arial.ttf");
                   fontFamily:                  ArialEmbedded;
                   advandedAntiAliasing:      true;
                   cff:                              true;
                   unicodeRange:                U+0020-U+002F,U+0030-U+0039,U+003A-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E,U+00A1-U+00FF,U+2000-U+206F,U+20A0-U+20CF,U+2100-U+2183;
              @font-face {
                   src:                         url("assets/Fonts/cour.ttf");
                   fontFamily:                  CourierEmbedded;
                   advandedAntiAliasing:      true;
                   cff:                              true;
                   unicodeRange:                U+0020-U+002F,U+0030-U+0039,U+003A-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E,U+00A1-U+00FF,U+2000-U+206F,U+20A0-U+20CF,U+2100-U+2183;
              s|WindowedApplication
         </fx:Style>
         <fx:Script>
              <![CDATA[
                   import flash.text.Font;
                   import flash.text.engine.FontLookup;
                   import flashx.textLayout.container.ContainerController;
                   import flashx.textLayout.conversion.TextConverter;
                   import flashx.textLayout.edit.EditManager;
                   import flashx.textLayout.edit.IEditManager;
                   import flashx.textLayout.elements.TextFlow;
                   import flashx.textLayout.events.SelectionEvent;
                   import flashx.textLayout.formats.TextLayoutFormat;
                   import flashx.undo.UndoManager;
                   import mx.collections.ArrayCollection;
                   import mx.events.FlexEvent;
                   import spark.core.SpriteVisualElement;
                   import spark.events.IndexChangeEvent;
                   private var dynTextFlow : TextFlow;
                   private var ctTextFlow : TextFlow;
                   protected function creationCompleteHandler(event:FlexEvent):void
                        controlBarVisible=false;
                        dynTextFlow = TextConverter.importToFlow("Hello World", TextConverter.PLAIN_TEXT_FORMAT);
                        drawTextBloc(dynTextFlow);
                        dynTextFlow.addEventListener(SelectionEvent.SELECTION_CHANGE, selectionChangeListener);
                        dynTextFlow.fontFamily = "ArialEmbedded";
                        dynTextFlow.fontLookup = FontLookup.EMBEDDED_CFF;
                        dynTextFlow.fontSize = 24;
                        dynTextFlow.interactionManager = new EditManager(new UndoManager());
                        dynTextFlow.flowComposer.updateAllControllers();
                        dynTextFlow.invalidateAllFormats();
                        dynTextFlow.flowComposer.updateAllControllers();
                   protected function cbFont_creationCompleteHandler(event:FlexEvent):void
                        var fonts:ArrayCollection=new ArrayCollection(Font.enumerateFonts());
                        cbFont.dataProvider=fonts;
                   protected function cbFont_changeHandler(event:IndexChangeEvent):void
                        var cf : TextLayoutFormat = new TextLayoutFormat();
                        cf.fontLookup = FontLookup.EMBEDDED_CFF;
                        cf.fontFamily = ComboBox(event.currentTarget).selectedItem.fontName;
                        IEditManager(ctTextFlow.interactionManager).applyLeafFormat(cf);
                        ctTextFlow.interactionManager.setFocus();
                   private function drawTextBloc(txt : TextFlow) : void
                        var container : SpriteVisualElement = new SpriteVisualElement();
                        var controller : ContainerController = new ContainerController(container, 300, 200);
                        addElement(container);
                        txt.fontLookup = FontLookup.EMBEDDED_CFF;
                        txt.fontFamily = "ArialEmbedded";
                        txt.flowComposer.addController(controller);
                   private function selectionChangeListener(event : SelectionEvent) : void
                        ctTextFlow = event.currentTarget as TextFlow;
                   protected function txt_selectionChangeHandler(event:FlexEvent):void
                        ctTextFlow = (event.currentTarget as RichEditableText).textFlow;
              ]]>
         </fx:Script>
         <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <s:layout>
              <s:VerticalLayout paddingLeft="10" paddingTop="10"/>
         </s:layout>
         <s:RichEditableText x="10"
                                  y="10"
                                  selectionChange="txt_selectionChangeHandler(event)"
                                  paddingTop="5" paddingLeft="5" paddingRight="5" paddingBottom="5"
                                  id="txt"
                                  fontFamily="CourierEmbedded"
                                  text="RichEditableText"
                                  height="200"
                                  width="350"/>
         <s:ComboBox id="cbFont"
                        labelField="fontName"
                        creationComplete="cbFont_creationCompleteHandler(event)"
                        change="cbFont_changeHandler(event)"
                        />
         <s:Label text="TEST" fontFamily="CourierEmbedded" fontSize="22" rotation="45"/>
    </s:WindowedApplication>
    Please, help me...
    Thank you very much...

    Thank you very much,
    I finally found the solution using the swfContext :
    use namespace mx_internal;
    myTextFlow.swfContext = ISWFContext(getFontContext("myFontName", false, false, FontLookup.EMBEDDED_CFF));
    It works fine both with a dynamic component like RichEditableText or a dynamic textflow with a ContainerController.
    Thanks

  • How can embed fonts into a PDF? Additionally, how can I make so that the PDF then opens with the embedded font?

    I need to embed a standard font (such as Times New Roman) and make it so that the document opens with this font presented. I see information on embedding fonts, but nothing related to the second part of my question. Thanks.

    The second part is automatic. If you manage to embed a font (for example with Preflight in Acrobat Pro), then a PDF viewer should use that. In some cases a locally installed font of the SAME NAME might take preference, which is only a difficulty if a private edited font is used.

  • (How) can I use Embeded Fonts in Flex 3.3

    If I understand correctly, I need to transcode/embed the fonts in Flex 4 / CS 4, but is there any way to then get those embeded fonts into a Flex 3.3 application?

    Support for DefineFont4 (the cff property) is new in Flex Gumbo. It is not available in Flex 3.X. That said – I do have a solution for you. Create a separate Flex Gumbo project and use the cff property to embed the font you need into that SWF. Then embed the font SWF that you just created in Gumbo into your Flex 3.3 application.
    Check out the “Building a Font SWF for use in any Flash Application” section in my DefineFont4 blog post:
    http://blogs.adobe.com/tlf/2008/11/embedded_font_subsetting_using.html
    Here is an article on embedding a SWF in Flex:
    http://blog.flexexamples.com/2007/10/25/embedding-fonts-from-a-flash-swf-file-into-a-flex- application/
    Hope this helps!

  • Flex Mobile 4.6 introduces Stage Text - how do you render HTML text with it?

    I have a little chat component in a Flex Mobile app that I just upgraded to SDK 4.6.  The chat component has a text area displaying messages and they are HTML formatted via the following:
    StyleableTextField(textArea).htmlText += myHTMLText;
    Worked in SDK 4.5 but StyleableTextField is not a part of the new Stage Text framework introduced in SDK 4.6.
    How do I HTML format the messages in my chat text area now?

    Thanks much for your response.
    Hmmm...  That appears to work but also causes a runtime exception where there was none before the 4.6 upgrade.  It occurs when I autoscroll on receiving a new message in the chat, something that worked fine in 4.5.
    I guess I'm kind of wondering what the best practice is here.  Maybe I'm just doing this wrong altogether.  I'm finding it very difficult to implement probably one of the most basic features one would find in any collaborative app - something that was very easy in Flex 3 - the chat pane.  I've had one functioning fine for about 3 years.  Not so much in Flex mobile.
    Chat is very simple functionality.  When you receive a new message from afar...
    1.  add it to a TextArea with some nice formatting
    2.  auto scroll far enough so the user can see the new message in its entirety. 
    Nothing difficult at all.
    Why are these two things difficult to find in the TextArea in Flex mobile?  It almost seems as though it's something we're not supposed to be doing? 
    The answer here seems to be don't use Stage Text.  Revert to an older TextArea skin.  Why?  What text area doesn't need formatting as an option?  What text area doesn't need to be auto scrolled here and there?  Or am I just going about this wrong?  Maybe using the wrong components?
    I guess for now I can revert to 4.5 skin, but now the code I used to auto scroll on receiving a new message throws a null pointer exception.  I've been using the valueCommit property to auto scroll, as follows:
    valueCommit="textArea.scroller.verticalScrollBar.value = textArea.scroller.verticalScrollBar.maximum"
    Haven't had a problem prevously.  But this now throws:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at com.components::ChatWindow/__textArea_valueCommit()
    What's the best practice to accomplish this and also to be able to take advantage of the latest and greatest?

Maybe you are looking for

  • SHA2 Algorithm support in Adobe Acrobat 9

    Hello, 1) Does Acrobat 9 supports SHA2 Hash algorithms while signing PDF file? 2) As per my understanding PDF is signed using below approach     Step 1. Take the PDF contents     Step 2. Calculate the Hash of the content     Step 3. Then sign(Encrypt

  • Dynamic Text - Basic Question

    I am using Dreamweaver MX and ASP.Net to create a data driven website. I have created a database connection and set-up a dataset with the relevant query, which returns a table of information. I now want to simply insert some dynamic text that referen

  • Error event id: 16002

    I get on one AD/DC, DNS server in the shool an warning error, event id: 16002; "Closing a UDP socket with local port number 49631 in process 1160 is taking longer than expected. The local port number may not be available until the close operation is

  • Multiple column sorting in JTable

    There is way to release multiple column sorting in JTable. ADF/SWing, Jdev 10.1.3

  • I can not install itunes on my computer. It tells me I need to update safari, and I have. Help please

    I can not install itunes on my computer.  It tells me I need to update safari, and I have already done that. Please help.