TextEntity bug

In Rhino Version 6 SR15 (6.15.19164.21011, 13/06/2019) the TextEntity class breaks everywhere. Most of the time not all letters are returned. Occasionally Rhino crashes. I have also encountered other minor problems, such as not being able to wrap the text.

This seems already reported from SR10 (see here) and it seems to have been ignored:

I attach a test using C# in GH.
TextEntityBug.gh (10.1 KB)


 private void RunScript(Plane plane, string text, string font, bool bold, bool italic, double height, string justi, ref object A)

TextEntity entity = new TextEntity();
entity.PlainText = text;
entity.Plane = plane;
entity.Font = new Rhino.DocObjects.Font(font,
  bold ? Rhino.DocObjects.Font.FontWeight.Bold : Rhino.DocObjects.Font.FontWeight.Normal,
  italic ? Rhino.DocObjects.Font.FontStyle.Italic : Rhino.DocObjects.Font.FontStyle.Upright,
  false, false);
entity.TextOrientation = Rhino.DocObjects.TextOrientation.InPlane;
entity.TextHeight = height;
entity.Justification = (TextJustification) Enum.Parse(typeof(TextJustification), justi);

A = entity.CreateSurfaces(entity.DimensionStyle);


I hope I’m wrong about something or that you’ll fix it soon.
Thank you.

Hi Dani - it wasn’t ignored. It was closed because the issue wasn’t reproducible.

I loaded your gh file and put in some text, turned the timer on and off, toggled some buttons, etc. but am not sure what I should be seeing that is not working. I’m definitely not getting crashes.
When you get Rhino to crash, are you sending in the crash reports?

CC: @stevebaer

It has crashed me twice in two days, I will try to reproduce it to send the report.

Report sent.

I can confirm the bug reported by Dani. I have never experienced crashes but sometimes, the CreateSurfaces method from the text entities fails at building the surfaces. The failures are random, i.e it can either fail or succeed for an identical set of inputs. You can easily experience it with the model below, either by adding a timer like Dani did or by switching the Italics Toggle until the surface creation fails (happens quite often).

BakeText.gh (20.0 KB)

My initial guess is that it is a tolerance issue but the problem can be reproduced for various tolerance parameters.

As a side note, it seems somewhat more stable to use the CreateCurves function from text entities and then the Boundary component to generate surfaces, but it also fails at times. I’m guessing anyways the same SDK functions are used for both operations.