TextMesh Pro TextInfo not initialized on 'Start()'

I’m using the lastest versión of TextMesh Pro and I’m evaluating if it’s going to be useful for my upcoming project.

But, when accessing ‘textInfo’, or ‘GetParsedText()’ from ‘Start()’ or ‘OnEnable()’, I get blank un-initialized data. How can I fix that?
(I get TextInfo with WordInfo with dummy array full of nulls and uninitialized data, ‘GetParsedText()’ returns “”)
When this data gets done?

My final objective here is: I want to GET the screen (or world) position of EACH word, also their height and width… all within the same TextMesPro component.
Also Lines.
I know where they are and mostly how, but any advice on that would be also appreciated.

Finally, where can I find an API reference for TextMesh Pro. I’ve looking and couldn’t find any. Methods are not commented and it’s tricky to know who is who and what it does.

You need to run ForceMeshUpdate method before reading textinfo @Mese

 m_textbox.ForceMeshUpdate();
 Debug.Log($" {m_textbox.textInfo.characterCount}");

TL;DR; Try calling textMeshPro.ForceMeshUpdate(), before accessing the TextInfo or the likes.

I’m not sure, if that’s still around in the latest version, but TextMeshPro Components used to have a ForceMeshUpdate() method. We ran into issues that text meshes were updated too late in the frame, and with this method we could force the availability of ‘up to date’ mesh datat to be used, when needed.

That won’t work if “Awake” hasn’t been called on the Text component yet.
This solution works always, by activating every parent in the tree up to the root, then restoring the active state of each.

public static int GetLineCount(this TMP_Text label)
{
    var disableds = label.transform.EnumerateAllParents(true).Where(p => !p.gameObject.activeSelf).ToList();
    disableds.ForEach(p => p.gameObject.SetActive(true));
    label.ForceMeshUpdate(true);
    if (label.textInfo == null)
    {
        Console.Log($"Label {label.name.Quoted()} doesn't have a 'textInfo' object. This is usually because it has not been 'Awoken' yet. activeSelf: {label.gameObject.activeSelf} activeInHierarchy: {label.gameObject.activeInHierarchy}");
        // Try to salvage:
        return label.text.Empty() ? 0 : (label.text.Count('

') + 1);
}
disableds.ForEach(p => p.gameObject.SetActive(false));
return label.textInfo.lineCount;
}
Utility:

        public static IEnumerable EnumerateAllParents(this Transform go, bool includeSelf = false)
        {
            if (!includeSelf)
            {
                go = go?.parent;
            }
            while (go)
            {
                yield return go;
                go = go.parent;
            }
        }
        public static string Quoted(this string s) => s == null ? "null" : $"\"{s}\"";
        public static int Count<T>(this IEnumerable<T> container, T v) { return container.Count(x => EqualityComparer<T>.Default.Equals(x, v)); }
        public static void ForEach<TSource>(this IEnumerable<TSource> source, Action<TSource> actor) { foreach (var x in source) { actor(x); } }