宽度:
int stringWidth = getFont().getAdvance(yourString);`
Run Code Online (Sandbox Code Playgroud)
高度:
int stringHeight = getFont().getHeight();`
Run Code Online (Sandbox Code Playgroud)
如果你是在你Field的一个方法中进行调用(意思是你已经extend编过Field),那就是这些.但是,如果你只是想绘制字符串并想知道什么ax和ay表示,那些是位置,而不是维度.