java 字体 ascent_Font ascent, descent, base line, ...

The baselineis the hypothetical line upon which characters rest. Some characters such as y and g have descenders that drop below the baseline.

Baseline.gif

The ascentof a font is the distance from the tops of the tallest glyphs to the baseline.

Ascent.gif

The descentof a font is the distance from the baseline to the bottom of the lowest descenders on the glyphs.

Descent.gif

The ascentof a character cell defines the position of the baseline within every character cell of a font. It is the number of pixels from the top of the cell to the baseline. The baseline is not a pixel row itself, but occurs between two pixel rows.

The heightof a character, the ascent and the descent are related by the following formula: height = ascent + descent

In the example below, the character cell height is 12 pixels, the cell ascent is 10 pixels

gdfont-htascdsc.gif

Most scripts share the notion of a baseline: an imaginary horizontal line on which characters rest. In some scripts, parts of glyphs lie below the baseline. The descentspans the distance between the baseline and the lowest descending glyph in a typeface, and the part of a glyph that descends below the baseline has the name descender. Conversely, the ascentspans the distance between the baseline and the top of the glyph that reaches farthest from the baseline. The ascent and descent may or may not include distance added by accents or diacritical marks.

In the Latin, Greek and Cyrillic (sometimes collectively referred to as LGC) scripts, one can refer to the distance from the baseline to the top of regular lowercase glyphs (mean line) as the x-height, and the part of a glyph rising above the x-height as the ascender. The distance from the baseline to the top of the ascent or a regular uppercase glyphs (cap line) is also known as the cap height.

f964b0b4512be31ce6067a2e120305d6.png

Libgdx BitmapFont

The ascentis the distance from the cap height to the top of the tallest glyph.

=> 注意,与以上解释均不同

The descentis the distance from the bottom of the glyph that extends the lowest to the baseline.

The cap height is the distance from the top of most uppercase characters to the baseline.

getBounds(java.lang.CharSequence str): returns the size of the specified string. The heightis the distance from the top of most capital letters in the font (the cap height) to the baseline.

=> bounds height = cap height

AngleCode BMFont

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值