Bug with leadingModel and alignmentBaseline
To help solve the problem of overlapping fonts (per post http://forums.adobe.com/thread/210312?tstart=90), I have been trying to adjust the baseline, leading, etc. This setting seems to produce what I am looking for:
textFlow.alignmentBaseline = TextBaseline.IDEOGRAPHIC_BOTTOM;
textFlow.leadingModel = LeadingModel.IDEOGRAPHIC_TOP_DOWN;
However, an error happens when clicking the last line if all the text does not fit into the container.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flashx.textLayout.elements::TextFlowLine/http://ns.adobe.com/textLayout/internal/2008::getRomanSelectionHeightAndVerticalAdjustment()
at flashx.textLayout.elements::TextFlowLine/computePointSelectionRectangle()
at flashx.textLayout.elements::TextFlowLine/http://ns.adobe.com/textLayout/internal/2008::hilitePointSelection()
at flashx.textLayout.container::ContainerController/http://ns.adobe.com/textLayout/internal/2008::addSelectionShapes()
at flashx.textLayout.compose::StandardFlowComposer/showSelection()
at flashx.textLayout.edit::SelectionManager/addSelectionShapes()
at flashx.textLayout.edit::SelectionManager/mouseDownHandler()
at flashx.textLayout.container::ContainerController/mouseDownHandler()
at flashx.textLayout.container::ContainerController/http://ns.adobe.com/textLayout/internal/2008::requiredMouseDownHandler()
I am using the release from 4/23/09 (Build 418).
Here is code to recreate the problem. The problem happens when clicking on the last line.
public class TestTextLayoutCode extends Canvas {
private var markup:String = "<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'>" +
"<p fontSize='48' fontFamily='Arial'>Very Big Font</p>" +
"<p fontSize='12' fontFamily='Times New Roman'><span>" +
"This is a normal font size to show how the text functionality works. " +
"</span></p>" +
"</TextFlow>";
private var textFlow:TextFlow;
public function TestTextLayoutCode() {
textFlow = TextFilter.importToFlow(markup, TextFilter.TEXT_LAYOUT_FORMAT);
textFlow.leadingModel = LeadingModel.IDEOGRAPHIC_TOP_DOWN;
textFlow.alignmentBaseline = TextBaseline.IDEOGRAPHIC_BOTTOM;
textFlow.flowComposer = new StandardFlowComposer();
var container:Sprite = new Sprite();
var controller:ContainerController = new ContainerController(container);
controller.verticalScrollPolicy = ScrollPolicy.OFF;
textFlow.flowComposer.addController(controller);
controller.setCompositionSize(300, 80);
rawChildren.addChild(container);
textFlow.flowComposer.updateAllControllers();
textFlow.interactionManager = new EditManager();
}
}
