0 Replies Latest reply on Feb 2, 2011 8:41 PM by yuushima.akiko

    Rotated ASCII characters overlap in Text Layout Framework with specific Japanese/Chinese fonts

    yuushima.akiko

      I am trying to layout rotated text with Text Layout Framework. Mostly okay, but when it comes to specific Japanese/Chinese fonts, problem happens - "hankaku" alphanumeric characters(in other words, ASCII characters) overlap in those fonts. (Full-width "zenkaku" characters have no problem, though)

       

      When "HG丸ゴシックM-PRO" or "HG正楷書体-PRO" are specified as fontFamily(both come with Office - common fonts in Japanese Windows environment), characters are wholly overlapped.

      hgmarugothic.PNG


      When "SimSun", "NSimSun" or "SimHei" are specified as fontFamily(Chinese fonts, all come with Japanese Windows XP), characters are slightly overlapped.

      simsun.PNG

       

      If anyone knows a solution or a workaround to this, please let me know.


      Sample code:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initapp();">
          <mx:Script>
              <![CDATA[
                  import flashx.textLayout.container.ContainerController;
                  import flashx.textLayout.elements.ParagraphElement;
                  import flashx.textLayout.elements.SpanElement;
                  import flashx.textLayout.elements.TextFlow;
                  import flash.text.engine.TextRotation;
                  import mx.core.UIComponent;
                  
                  private function initapp():void
                  {
                      var container:UIComponent           = new UIComponent();
                      var textflow:TextFlow               = new TextFlow();
                      var controller:ContainerController  = new ContainerController(container);
                      var paragraph:ParagraphElement      = new ParagraphElement();
                      var span:SpanElement                = new SpanElement();
                      
                      textflow.fontFamily          = "HG丸ゴシックM-PRO";
                      textflow.textRotation        = TextRotation.ROTATE_270;
                      textflow.fontSize            = 72;
                      textflow.color               = 0;
                      span.text                    = "abcdefg";
                      
                      controller.setCompositionSize(this.unscaledWidth, this.unscaledHeight);
                      paragraph.addChild(span);
                      textflow.addChild(paragraph);
                      textflow.flowComposer.addController(controller);
                      textflow.flowComposer.updateAllControllers();
                      
                      this.addChild(container);
                  }
              ]]>
          </mx:Script>
      </mx:WindowedApplication>
      


      Warm regards,
      Yuushima