Font ascent, descent, base line, ...

Java

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

 

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

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

 

 

symbian

The ascent of 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 height of 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

  

 

Wikipedia

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 descent spans 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 ascent spans 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.

 

 

Libgdx BitmapFont

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

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

The descent is 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 height is the distance from the top of most capital letters in the font (the cap height) to the baseline. 

=> bounds height = cap height

 

AngleCode BMFont

Hiero

Bitmap Font Generator

 

 

转载于:https://www.cnblogs.com/fungapapp/archive/2012/05/17/2506201.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值