Splitting text entity

Hi,

Using Rhinocommon… (c# or python)

I would like to align a text object (not curves) on a curve.
The result would be a text entity per char oriented on a curve.
I can’t find a way to find each character horizontal position.
I’m not using a monospace font… So the spacing is variable.
I tried CreateSurfacesGrouped is not helping cause surfaces planes are not aligned to font char baseline.

Is their a way to explode text entity to several text entities of single char and keeping their position ?

Regards.

I’d like to know if this is what you want?


SplittingTextEntity.gh (11.5 KB)

1 Like

Thanks for the quick return but I thought about something more accurate.
Rapidly I met grasshopper limitations regarding textentity.
I needed a way to preserve baseline, median, kerning…
I’m actually working on python components trying to extract typography parameters.

Regards

I would like to validate the behavior of TextEntity.GetBoundingBox.
Here is a Grasshopper test.
The bounding box and Model Width are not consistent if text is rotated.
Is that OK ?

Regards.

textentity_bb.gh (13.3 KB)

Did you try Annotation Text Settings component of Grasshopper in Rhino 8 ?

Yes.
But I did not understand it.
Even if I played with annotation since rhino 5 I still can’t get it completely.
Model scale particularly. The global option about enabling model and layout scaling is really counter intuitive. That’s another story I guess.

Here, with TextEntity and Annotation Text Settings, I see a preview a lot larger than the text height specified. I guess it is linked by default to model scale of the current dim style with Rhino somewhere (which is not a good idea). But there is not input to control that in the TextEntity component. With Rhino.Geometry.TextEntity class, dim style seems mandatory.

How could dim style be specified ?

In fact, the previewed text height is the text height specified. You can control the text height with Annotation Text Settings component just as you do in Rhino. For example, the height of this text I set earlier is 2 mm, and the preview height measured is also 2 mm.

Please visit below page for details,

What I’m seeing is that the current rhino annotation style is used to preview the textentity component which has no input to specify style (oddly). By the way, it seems pointless to create a parametric object which depends on current global settings, isn’t it ?

When baked, the text seems fine but the use of the current annotation style with overrode parameters is pretty weird technique.

The preview is wrong.
On my side, when my current annotation has a dimension scale of 10, my preview is 10 times larger than the text height specified on my textentity component. (Rhino 8 SR13)

Grasshopper

Current Rhino annotation style with model scale of 10 and grasshopper preview


Current Rhino annotation style with model scale of 1 and grasshopper preview