Skip to main content
Inspiring
March 12, 2010
Answered

Misaligned selection with "Lucida Handwriting"

  • March 12, 2010
  • 1 reply
  • 1723 views

Hi,

when I set the format to use "Lucida Handwriting" on an XP machine (using flex_sdk_4.1.0.14706) the selection is misaligned with the text. If you change the font to Arial it works. Lucida Handwriting is a commonly installed system font on PCs.  Here is the code I was using:

package {

     import flash.display.Sprite;

     

     import flashx.textLayout.container.ContainerController;

     import flashx.textLayout.edit.EditManager;

     import flashx.textLayout.elements.DivElement;

     import flashx.textLayout.elements.ParagraphElement;

     import flashx.textLayout.elements.SpanElement;

     import flashx.textLayout.elements.TextFlow;

     import flashx.textLayout.formats.TextLayoutFormat;

     import flashx.undo.UndoManager;

     

     public class SimpleTextFlow extends Sprite

     {

          private var tf:TextFlow;

          private var em:EditManager;

          private var um:flashx.undo.UndoManager

          private var _init_fmt:TextLayoutFormat;

          

          public function SimpleTextFlow()

          {

               //define TextFlow and manager objects

               tf = new TextFlow();

               um = new UndoManager();

               em = new EditManager(um);

               tf.interactionManager = em;

               

               //define elements to contain text

               var d:DivElement = new DivElement();

               var p:ParagraphElement = new ParagraphElement();

               var s:SpanElement = new SpanElement();

               s.text ="This is sample text for the EditManager example.";

               

               //add these elements to the TextFlow

               p.addChild(s);

               d.addChild(p);

               tf.addChild(d);   

               

               _init_fmt = new TextLayoutFormat();

               _init_fmt.fontFamily = "Lucida Handwriting";

               tf.hostFormat = _init_fmt;

               

               //compose TextFlow to display

               tf.flowComposer.addController(new ContainerController(this,600,600));

               tf.flowComposer.updateAllControllers();

          }

     }       

}

This topic has been closed for replies.
Correct answer

I made it wrap on to two lines so that you can see it clearly.  In this case "example." is selected.


I'm told this has been fixed in Flash Player 10.1. Can you try your Lucida Handwriting in the latest beta? http://labs.adobe.com/technologies/flashplayer10/

1 reply

josh_onAuthor
Inspiring
March 12, 2010

package {

import flash.display.Sprite;

import flashx.textLayout.container.ContainerController;

import flashx.textLayout.edit.EditManager;

import flashx.textLayout.elements.DivElement;

import flashx.textLayout.elements.ParagraphElement;

import flashx.textLayout.elements.SpanElement;

import flashx.textLayout.elements.TextFlow;

import flashx.textLayout.formats.TextLayoutFormat;

import flashx.undo.UndoManager;

public class SimpleTextFlow extends Sprite

{

private var tf:TextFlow;

private var em:EditManager;

private var um:flashx.undo.UndoManager

private var _init_fmt:TextLayoutFormat;

public function SimpleTextFlow()

{

//define TextFlow and manager objects

tf = new TextFlow();

um = new UndoManager();

em = new EditManager(um);

tf.interactionManager = em;

//define elements to contain text

var d:DivElement = new DivElement();

var p:ParagraphElement = new ParagraphElement();

var s:SpanElement = new SpanElement();

s.text ="This is sample text for the EditManager example.";

//add these elements to the TextFlow

p.addChild(s);

d.addChild(p);

tf.addChild(d);   

_init_fmt = new TextLayoutFormat();

_init_fmt.fontFamily = "Arial";//"Lucida Handwriting";

tf.hostFormat = _init_fmt;

//compose TextFlow to display

tf.flowComposer.addController(new ContainerController(this,600,600));

tf.flowComposer.updateAllControllers();

}

}       

}

March 13, 2010

In what way is the selection misaligned? Could you post a picture?

There are a few versions of Lucida Handwriting I can see from a Google search - all of them cost something to license aside from a Mac truetype version, so I don't have immediate access to that font.

josh_onAuthor
Inspiring
March 13, 2010

I made it wrap on to two lines so that you can see it clearly.  In this case "example." is selected.