> I rely on undocumented Flash Player API - flash.text.TextRun
> http://nondocs.blogspot.com/2007/05/flashtexttextrun.html -
> is it OK to rely on undocumented Flash Player API in our projects?

I very much doubt that the Player team will remove this API, although I can't 
promise that. In any case, TextField is not going to get much attention in the 
future. It will continue to be supported for backward compatibility, but the 
new flash.text.engine APIs in FP10 are the foundation for text display from now 
on.

Gordon Smith
Adobe Flex SDK Team


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Andriy 
Panas
Sent: Thursday, November 06, 2008 2:33 AM
To: [email protected]
Subject: Re: [flexcoders] Does UIComponent.measureHTMLText(htmlText) method 
takes TextFormat.blockIndent value into the account when calculating width 
value of TextLineMetrics object?


Hi Gordon,

I've found the submission patch at Adobe JIRA bug-base you've been
referring in a previous message:
http://bugs.adobe.com/jira/browse/SDK-16641

While I fully welcome this fix, it does not suit my needs precisely.

I've studied source code of <mx:Text> private function
"measureUsingWidth(widthValue)" and that was closer to solve my task.

I've reused this method in my custom Text component to take into
account the values of "blockIndent" values specified to all TextFormat
applied to the textField under the question while measuring the width
for this component in override protected "measure" method.

To return the Array of all TextFormats applied to the textField I rely
on undocumented Flash Player API - flash.text.TextRun
http://nondocs.blogspot.com/2007/05/flashtexttextrun.html - is it OK
to rely on undocumented Flash Player API in our projects?

Then, I calculate the maximum BLOCKINDENT value within all TextFormats
objects found for the textField and then I make sure in my "|measure"
method for my Text component to take this maximum BLOCKINDENT value
into the consideration, e.g

measuredWidth = Math.max(MIN_TEXT_HEIGHT,
Math.ceil(textField.textWidth) + UITextField.TEXT_WIDTH_PADDING +
maxParagraphIndentValue);

2008/11/4 Gordon Smith <[EMAIL PROTECTED]<mailto:gosmith%40adobe.com>>:
> It sounds like a Player quirk that the Flex framework needs to work around.
> I think a fix went in to the measure() method of UITextFormat recently for a
> similar problem with 'indent'. You should file a bug. And if you file a
> patch, it is likely to get fixed sooner.
>
>
>
> - Gordon
>
>
>
> From: [email protected]<mailto:flexcoders%40yahoogroups.com> 
> [mailto:[email protected]<mailto:flexcoders%40yahoogroups.com>] On
> Behalf Of Andriy Panas
> Sent: Monday, November 03, 2008 2:38 PM
> To: [email protected]<mailto:flexcoders%40yahoogroups.com>
> Subject: [flexcoders] Does UIComponent.measureHTMLText(htmlText) method
> takes TextFormat.blockIndent value into the account when calculating width
> value of TextLineMetrics object?
>
>
>
> Hi all,
>
> Accordingly to my tests, method "textField.getLineMetrics(0)" that
> lays in the core of "UIComponent.measureHTMLText(htmlText)" returns
> TextLineMetrics object with the value for the "width" property that is
> calculated regardless from the value specified for
> "textFormat.blockIndent" value applied to the textField in question.
>
> Is that an intentional behavior?
> --
> Med venlig hilsen / Best regards
> Andriy Panas
> [EMAIL PROTECTED]<mailto:a.panas%40gmail.com>
>
>

--
--
Med venlig hilsen / Best regards
Andriy Panas
[EMAIL PROTECTED]<mailto:a.panas%40gmail.com>

Reply via email to