exe*_*ook 4 android text-rendering
我需要知道给定字体句柄的文本字符串的宽度(或字体名称+字体大小+字体样式数据).
在Windows中我以前使用GetTextExtentPoint()
使用此代码
Rect bounds = new Rect();
Paint textPaint = textView.getPaint();
textPaint.getTextBounds(text, 0, text.length(), bounds);
int height = bounds.height();
int width = bounds.width();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3432 次 |
| 最近记录: |