Font.GetCharacterInfo always returns false

Hi, I am trying to get width of a char from unity text component

Text t = GetComponent<Text>();
t.text = "abc";

CharacterInfo info;

if(t.font.GetCharacterInfo('a', out info, t.fontSize)){
    //Never returns true
}

I have tried unity default Arial font and many other but none of them successfully return true.
What might be the problem?

Not sure if still is valid, but you gotta set the font to “unicode” in the import settings or atleast anything other than “dynamic”.
Atleast that’s what i did wrong first

Maybe your font is dynamic: this means you have to add characters in your font, and you should use Font.RequestCharactersInTexture! This happened to me with a single UnityEngine.UI.Text component, no matter the font.
Reference: Unity - Scripting API: Font.RequestCharactersInTexture

the unity default font is dynamic
// answer:
Text t = GetComponent();
t.text = “abc”;

     CharacterInfo info;
    font.RequestCharactersInTexture(t.text, t.fontSize,t.fontStyle); //add this
     if(t.font.GetCharacterInfo('a', out info, t.fontSize)){
         //Never returns true
     }