获取字体的高度和宽度
2015-06-04 00:06
295 查看
Rect rect= new Rect(); Paint textPaint = new Paint(Paint.ANTI_ALIAS_FLAG); textPaint.setTextAligh(Paint.Align.Right); textPaint.setTextSize(12); textPaint.getTextBounds("ABC", 0, "ABC".length(),rect); int textHeight = rect.height(); int textWidth = textPaint.measureText("ABC");
相关文章推荐
- Reflector 反编译 .NET文件后修复
- android:background="@color/white" [create file color.xml at res/values/]
- android:background="@color/white" [create file color.xml at res/values/]
- 前端性能优化最佳实践
- spring开源项目链接
- 查找——图文翔解Treap(树堆)
- android布局属性详解
- Java中利用gson解析Json实例教程
- python在windows下创建隐藏窗口子进程的方法
- Python使用multiprocessing创建进程的方法
- Python守护进程用法实例分析
- Python通过select实现异步IO的方法
- Python通过poll实现异步IO的方法
- Python文件及目录操作实例详解
- python创建进程fork用法
- django通过ajax发起请求返回JSON格式数据的方法
- Python中threading模块join函数用法实例分析
- Interleaving String
- mergeSort
- 过去半年的工作总结