Hi,
A series of these transformers creates underline of a text feature, but its length will be longer a little than the text feature. I couldn't find a way to calculate exact length of the text feature.
1) TextPropertyExtractor Destination Text Rotation Attribute: _text_rotation 2) CoordinateExtractor Index: 0 X Attribute: _x Y Attribute: _y 3) Rotator Rotation Angle: -@Value(_text_rotation) X Origin: _x Y Origin: _y 4) BoundsExtractor Minimum X Attribute: _xmin Maximum X Attribute: _xmax 5) 2DPointReplacer X Value: _x Y Value: _y 6) 2DPointAdder X Value: @Value(_x)+@Value(_xmax)-@Value(_xmin) Y Value: _y 7) Rotator_2 Rotation Angle: _text_rotation X Origin: _x Y Origin: _y
Takashi
Thank you for the tips Takashi.
Regards
Hi all,
Yeah, the stroker is useless for that.
I did a similar thing, building a datagrid for my pdf writer.
But i made some trial and error parameters to ensure fit.
It is not easy to extract the size because of the way letters are designed and its history.
U would need to take into account a lot to even try it.
There are some scripts about doing such, very old ones even.
Basically u need to work with the fontsize, the type, typographical points.
To be correct u even should to take into account the pixelsize of your targetmedia (i.e. screen).
To eleminate the screenresolution (but not always correct) u can go for the
the postscript size 1/72 of an inch (typographical point)
So "Hello!" in Arial 12 would be somewhat 12x1/72*2.54=0.4233.. cm at highest point.
The problem is the width then.
An fme solution would be, assuming the stroker at least keeps the aspect ratio up, is indeed the textstroker.
Stroke the text, extract the boundingbox (if its angled u can either rotate first or use a minmalboundingboxextractor). This will give u the aspectratio.
As u know the height, u can now calculate a very good aproximation of width.
Now u need to find the insertionpoint of the text.
The stroker srokes to the correct x coordinate but not he y.
...if have not found any info on how the textadder or labelpointreplacer decides it insertionlocation.
So im stranded at the y coordinate, alas. :(
let me know if u do...;)