Paint.getTextWidths.什么是提前宽度? [英] Paint.getTextWidths. What is advance width?

查看:17
本文介绍了Paint.getTextWidths.什么是提前宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是前进宽度?

该术语出现在 android 类 Paint 中,特别是函数 getTextWidths().文档说明返回字符串中字符的前进宽度".

The term comes up in the android class Paint, specifically the function getTextWidths(). The documentation states "Return the advance widths for the characters in the string".

什么是前进宽度"?

推荐答案

Advance Width 是与字体/排版相关的度量术语.SO 上有一些问答涵盖了它,但简短的定义或多或少是:

Advance Width is a metrics term related to fonts/typography. There are some Q&A's here on SO that cover it, but the short definition is more or less:

advance width 是字形初始笔之间的距离位置和下一个字形的初始笔位置.

The advance width is the distance between the glyph's initial pen position and the next glyph's initial pen position.

可视化通常会使事情更容易理解,因此请查看下图.

A visualization usually makes things easier to understand, so have a look at the image below.

图片由 freetype.org 提供.

与advance width类似,还有一个不太常用的advance height:

Similar to the advance width, there is also a less frequently used advance height:

图片由 freetype.org 提供.

Freetype 关于 glyps 指标的文章更深入地介绍了各种指标.如果您有兴趣,可能值得一读.

Freetype's article on glyps metrics goes more in depth about the various metrics. Might be worth a read if you're interested.

注意:我与 Freetype.org 没有任何关系.我只是碰巧发现他们关于此事的文档很有用.

Note: I'm in no way affiliated with Freetype.org. I just happen to find their documentation on this matter useful.

这篇关于Paint.getTextWidths.什么是提前宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆