Text along polyline

That is what I meant with ‘probably a minor one’.
You are right that an offset to any base shape can be treated as a polyline.
Meaning that ‘Text Along’ can be upgraded to: Line, Arc, Circle, Ellipse, Poly and Spline entities.
This is basically how FlexPainter evolved, it started with one type and was expanded for all types of line-art.

But there is a catch with offsets … Not all will be correct, some may even be unusable for your approach.

I had a look at my FlexPainter code because I know there were issues with getting it about correct on some types.
It is Case 3 and Case 4 depending tangentially closed or not:

FlexPainter considers an open and a not tangentially closed polyline as open, as having a start and an end.
When geometrically closed and tangentially connected it is treated as closed, as endless like a circle.

Retrieving the tangent angle is basically done by:

    var castPoint = shape.getPointWithDistanceToStart(activeDist);
    var segmentShape = shape.getSegmentAt(shape.getClosestSegment(castPoint));
    var castAngle = segmentShape.getAngleAtPoint(castPoint);

For Case 3-4 it catches off distances near/over the end and forces the total shape length, for Case 3 it subtracts 2e-6.
Now I start to wonder why I opted for the angle at the closest segment … Further left undocumented :blush:

Some questions/remarks:

  • Is it correct that you use the Middle-Center point of a character?
  • How do you avoid overlapping characters at inner corners, inner curvature?
  • Angles at points very near nodes take the angle of the next segment, the tolerance may differ for Line vs Arc segments.

Best is to test if your near a node instead of near a segment end.

  • You really don’t want to morph characters like FlexPainter does, even with proper defined flexible painters.

The included notice is:

FlexPainter having the flaws in steep curves is error-like but it is super realistic.
Twisting a roller stamp too much will smudge.
Simply avoid hard corners or small radii in your base line-art.

Not all TTF art can be morphed freely.

  • To have a single selectable (not editable) item … I can understand that but I would make it an option.

On the other hand, grouped as block (each one is unique) or as a selectable group of entities.
I am in the process of finalizing an addon for selecting grouped entities together base on a custom property.


Perhaps you could share the code so far and we could have a look at it together.
If you don’t want to share it in public then by private message is fine (See top right).

Regards,
CVH