10 Replies Latest reply on Apr 13, 2010 2:36 AM by Krish.praveen

    TextLayoutFramework - Japanese Text

    Krish.praveen Level 1

      Hi all,


      I found some strange things to happen to TLF used in my application.


      The original text looks like this.


      ニコン液晶露光装置 「FX-75S」「FX-85S」


      But when it moves to the TLF editor, it looks like this.


      As you can see the the special characters moved to boxes..


      Can any one help me to find the solution ASAP.


      Thanks in Advance


        • 1. Re: TextLayoutFramework - Japanese Text
          Flex harUI Adobe Employee

          Make sure the font you are using supports those characters.

          1 person found this helpful
          • 2. Re: TextLayoutFramework - Japanese Text
            Krish.praveen Level 1



            Thanks for your reply.

            I do check for the same regarding the font used.


            I also found one strange thing over here in the text is one of the character that gots displayed but other cannt.

            like this letter in the context


            「FX-75S」- Its the original text.


            Its in text layout editor


            My concern is, how it displays the first character but not the last one. Any comments on this?


            thanks in advance.



            • 3. Re: TextLayoutFramework - Japanese Text
              Flex harUI Adobe Employee

              Post a simple test case.

              • 4. Re: TextLayoutFramework - Japanese Text
                Krish.praveen Level 1



                Thanks for the response.


                Here is the case :


                I am using GRID, to show this text. Where i use two different controls in item editor and renderer.


                In item renderer it shows this text.


                ニコン液晶露光装置 「FX-75S」「FX-85S」

                But when i tried to edit, it moves to TextLayout Editor. It displays as in this format.





                Hope this will help you out to get into the scenario. If any further needs, let me know.




                • 5. Re: TextLayoutFramework - Japanese Text
                  Flex harUI Adobe Employee

                  That's not a test case.  Let's see about 20 lines of MXML that I can copy

                  and paste and run.

                  • 6. Re: TextLayoutFramework - Japanese Text
                    Krish.praveen Level 1

                    This is the sample code, what i am trying out.





                    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*"

                    creationComplete="init()" horizontalScrollPolicy="

                    off" viewSourceURL="srcview/index.html">







                    import flashx.textLayout.events.ScrollEvent;


                    import flashx.textLayout.events.FlowOperationEvent;


                    import flashx.textLayout.events.CompositionCompletionEvent;


                    import mx.controls.Image;


                    import flashx.textLayout.events.FlowElementMouseEvent;


                    import flashx.textLayout.elements.FlowElement;


                    import flashx.textLayout.elements.FlowLeafElement;


                    import flashx.textLayout.edit.ElementRange;


                    import flashx.textLayout.edit.TextRange;


                    import flashx.textLayout.events.SelectionEvent;


                    import mx.controls.CheckBox;


                    import mx.collections.ArrayCollection;


                    import flashx.textLayout.formats.Direction;


                    import flashx.textLayout.elements.InlineGraphicElement;


                    import flashx.textLayout.events.StatusChangeEvent;


                    import air.update.events.StatusUpdateEvent;


                    import flashx.textLayout.formats.ContainerFormat;


                    import flashx.textLayout.formats.ICharacterFormat;


                    import flashx.textLayout.formats.CharacterFormat;


                    import mx.events.SliderEvent;


                    import flashx.textLayout.edit.UndoManager;


                    import flashx.textLayout.edit.EditManager;


                    import flashx.textLayout.container.DisplayObjectContainerController;


                    import flashx.textLayout.conversion.TextFilter;


                    import flashx.textLayout.elements.TextFlow;


                    import flash.text.TextField;



                    import mx.core.UIComponent;


                    import mx.collections.XMLListCollection;


                    import mx.collections.ArrayCollection;



                    import mx.managers.DragManager;


                    import mx.core.DragSource;


                    import mx.events.DragEvent;


                    import flash.events.MouseEvent;






                    Bindable] static public var imgClass:Class;


                    Bindable] private var _textContainer:Sprite = null;


                    public var image:InlineGraphicElement;








                    static const textInput:XML =

                    <TextFlow xmlns="http://ns.adobe.com/textLayout/2008">

                    ニコン液晶露光装置 「FX-75S」「FX-85S」


                    液晶テレビは数量ベースで、世界市場の過半数を超え、急速な普及が進んでいます。また、そのフラットパネル(省スペース)という特徴とともに、従来のブラウン管テレビでは実現できなかった画面 サイズの大型化もさらに進化しております。一方、デジタルサイネージに代表されるインフォメーションディスプレイも近年大きな注目を浴びつつあります。






                    var _textFlow:TextFlow;






                    private function init():void


                    _textContainer =

                    new Sprite();




                    var cf:CharacterFormat = new CharacterFormat();


                    _textFlow = TextFilter.importToFlow(textInput, TextFilter.TEXT_LAYOUT_FORMAT);


                    new DisplayObjectContainerController(_textContainer, canvas.width-40, canvas.height));


                    _textFlow.interactionManager = new EditManager(new UndoManager());










                    <mx:Canvas id="canvas" width="450" height="150" backgroundColor="#ffffff" verticalScrollPolicy="auto/>




                    Hope this will help it out.






                    • 7. Re: TextLayoutFramework - Japanese Text
                      dave cragg Level 2

                      I couldn't get your script to compile. (Which SDK version are you using?)


                      However, I saw the same problem when setting the textFlow of a Spark TextArea to the Japanese text in your example.




                      1.  If I set no fontFamily on the TextArea, it displays with the boxes as you describe.

                      2.  (On a Mac) if I set the fontFamily to "Osaka", it displays correctly without the boxes.


                      But I don't think you should have to set the fontFamily specifically for this to work. You should just have a default Japanese font on your system somewhere. The fact that the text displays correctly in the Flash Builder script editor suggests this is a bug.


                      While playing with this, I noticed I couldn't enter Japanese text in the TextArea. When I switch the input mode to Japanese, nothing happens. I'm pretty sure during the beta test, I was able to enter Japanese (although it required the non-inline entry window).


                      Is handling Japanese generally a problem with Flex/Flash? I haven't had to work with Japanese text much in Flex, but I have some projects coming up where this will be important.

                      • 8. Re: TextLayoutFramework - Japanese Text
                        Krish.praveen Level 1



                        I use SDK 3.3


                        Font Installed for japanese is : Arial Unicode MS (arialuni.ttf).




                        • 9. Re: TextLayoutFramework - Japanese Text
                          Flex harUI Adobe Employee

                          If you are using embedded fonts, all embedded fonts for a component instance

                          must be from the same SWF and you must use fontFamily to hint to the

                          component.  See the post on embedded fonts on my blog



                          Alex Harui

                          Flex SDK Team

                          Adobe System, Inc.


                          • 10. Re: TextLayoutFramework - Japanese Text
                            Krish.praveen Level 1



                            My issue was different, can you help me to solve the same.