Hi Alex,
Finally i solved my problem yesterday. (i tried the calculation with a 
textField but also i could not get the same measurements).
In this moment i can not change the code is not my own software and we are 
using embebed font as cff and with no time no create the swf for the fonts 
again  for no cff, but yesterday i found a solution.
I will post it here can help someone:
this.richEditableText.textFlow = TextConverter.importToFlow(value, 
TextConverter.PLAIN_TEXT_FORMAT);this.richEditableText.textFlow.leadingModel = 
LeadingModel.APPROXIMATE_TEXT_FIELD;this.richEditableText.textFlow.lineHeight = 
"-100%";this.richEditableText.textFlow.invalidateAllFormats();

and i also need the middle point for the backend svg creation:i had to caculate 
that because every item is inside of a container so the x, y position is always 
of the container and the item itself rotate on the middle of that container... 
and the container size is the same of the item text:             public 
function calculateMiddlePoint():void             {                       var 
point:Point;                        var theta:Number = 
FDMath.degToRad(rotation);                   var A_y:Number = this.y;           
             var A_x:Number = this.x;                                           
     var y_min:Number;                       var y_max:Number;                  
     var x_min:Number;                       var x_max:Number;                  
                             var ct:Number = Math.cos( theta );                 
     var st:Number = Math.sin( theta );                                         
     var hct:Number = height * ct;                   var wct:Number = width * 
ct;                    var hst:Number = height * st;                   var 
wst:Number = width * st;                                            if 
(rotation >=0 && rotation < 90)                      {                          
     y_min = A_y;                            y_max = A_y + hct + wst;           
                     x_min = A_x;                            x_max = A_x + wct 
+ hst;                        }                       else if (rotation >=90 && 
rotation < 180)                       {                               y_min = 
A_y;                            y_max = A_y + wst - hct;                        
        x_min = A_x;                            x_max = (A_x + hst - wct);      
                }                       else if ( rotation >= 180  && rotation 
< 270)                   {                               y_min = A_y;           
                 x_min = A_x;                            y_max = A_y - hct - 
wst;                                x_max = A_x - wct - hst;                    
    }                       else                    {                           
    y_min = A_y;                            y_max = A_y - wst + hct;            
                    x_min = A_x;                            x_max = A_x - hst + 
wct;                        }                                               
point = new Point((x_max - x_min)/2 + x_min, (y_max-y_min)/2 + y_min);          
                                this.middleX = point.x ;                        
this.middleY = point.y ;                }
------------------------
Thanks for the reply!
(i tried also to post on the users mailing list but i had a mail server error)

My best regards,Miguel
-------------------------------
> From: aha...@adobe.com
> To: dev@flex.apache.org
> Date: Sun, 28 Apr 2013 20:54:58 -0700
> Subject: Re: As2 to tlf
> 
> Do you need to support right-to-left text?  If not, why not still use
> TextField?
> 
> 
> On 4/28/13 10:36 AM, "Miguel Ferreira" <miguel.cd.ferre...@hotmail.com>
> wrote:
> 
> > Hello guys,
> > 
> > A lot of time that i am reading this list on silent mode, wishing to be more
> > participative 😊 but now i will start with a question, regarding tlf and
> > texfield as2.
> > 
> > My problem is simple but complex solution... I have a old software made in 
> > as2
> > and now i rebuild it for flex 4.6 and for a web to print solution after the
> > user makes is textfields (i am using richeditabletex) the design goes to
> > production and on the backend is created a svg file.
> > 
> > The problem comes now the backend svg creator is also old from the same time
> > as the as2 and the dimension used were from the as2 texfield but now i have
> > really different dimensions using tlf so the svg file output is wrong.
> > 
> > Now the question, is there a way to calculate The dimensions with the same
> > rendering mode from the old text field?
> > I am using embedded fonts only width cff. (big list)
> > 
> > I get so different dimensions even when i use leadingmodes
> > 
> > Enviado do meu Windows Phone
> 
> -- 
> Alex Harui
> Flex SDK Team
> Adobe Systems, Inc.
> http://blogs.adobe.com/aharui
> 
                                          

Reply via email to