Skip to main content
Inspiring
Mar 12, 2010 11:43 PM UTC
Answered

Misaligned selection with "Lucida Handwriting"

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 is closed to new replies. Start a new post to keep the conversation going.
Correct answer
Apr 4, 2010 2:13 AM UTC

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/

5 replies

josh_onAuthor
Inspiring
Mar 12, 2010 11:44 PM UTC

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();

}

}       

}

Translate
Mar 13, 2010 12:20 AM UTC

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.

Translate
josh_onAuthor
Inspiring
Mar 13, 2010 4:06 AM UTC

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

Translate