3D Text not changing font

I have recently started using the 3D Text and i tried to change the font of it. All i have gotten was the text all messed and unreadable

Here is my code:

public TextMesh countText;
public TextMesh topText;
public TextMesh switchText;

public Font defaultFont;
public Font newFont;

// Start is called before the first frame update
void Start()
{
    topText.GetComponent<TextMesh>().font = newFont;
    switchText.GetComponent<TextMesh>().font = newFont;
    countText.GetComponent<TextMesh>().font = newFont;
}

I’d recommend you use TextMeshPro for this kind of thing. It should be available directly to you if you have the lastest unity version, if not, get it from the asset store. It may fix your problem.