Skip to content

Commit d916f66

Browse files
committed
Update
1 parent 03f63d2 commit d916f66

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎CustomView/Advance/[8DrawText.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,23 @@ public void setStyle (Paint.Style style) // 设置样式
144144
canvas.drawText("GcsSloop 中文", 0, 600, mPaint);
145145
```
146146

147+
#### FontMetrics
147148

149+
> 看了前面的Align和Style是不是茅塞顿开,感觉自己在技(装)术(逼)的道路上又前进了一大步,O(∩_∩)O哈哈哈~
150+
请稍安勿躁,前面仅仅是餐前甜点,真正的大餐现在才开始。
148151

152+
FontMetrics 是 Paint 的一个内部类,根据名字我们可以大致知道这是一个描述**字体规格**相关的类。
153+
154+
关于这个类的描述原文是这样的:
155+
156+
> Class that describes the various metrics for a font at a given text size. Remember, Y values increase going down, so those values will be positive, and values that measure distances going up will be negative. This class is returned by getFontMetrics().
157+
158+
翻译一下:
159+
160+
> 简单来说,FontMetrics包含了当前文本相关的各项参数,你可以通过 Paint中 _getFontMetrics()_ 这个方法来获取到这个类。
161+
(另外,原文中还特地强调了一下关于坐标正负的问题。)
162+
163+
##### FontMetrics包含了以下几项参数:
149164

150165

151166

0 commit comments

Comments
 (0)