General discussion about LÖVE, Lua, game development, puns, and unicorns.
- Inner party member
- Posts: 3651
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
So Top-Left is winning with 94% and a 6% margin of error in its favor.
- Party member
- Posts: 108
- Joined: Thu Feb 21, 2008 2:37 pm
- Location: Norway/Norge/諾威/挪威 (Yes, I'm teh back!)
You mean the whole string is too low, right?Simtex wrote:Notice that the 'p' and 'y' extend below the other letters, while the 'l' rises higher than the other letters, yet even the 'l' is too low. Along the x-axis though, everything is properly centered.
And that if the problem with using top left as the base instead of the baseline, was ascenders then the l should have been in a different position in this string.
First of all, the l would have been lower if the text was top-left aligned and the l was higher due to an ascender (that is, if this problem existed).
In 0.5.0 it's easy to do a centered baseline, but then the text is a bit too high. And there doesn't seem to be any kind of proper font metrics.
The thing you are interested in is the x height, could be called getXHeight.
getHeight returns the font's ascent (height of ascenders from baseline), should probably have been getAscent, but maybe names shouldn't change. Or set getHeight to return the x height and getAscent to return the ascent.
You already have getLineHeight, but I'm not sure if it reflects the actual line height, since you can set it. (line height = ascent + descent + line gap)
There's also the cap height, which is the height of capital letters from the baseline, as it can be different from the height of ascenders.
Apple has a good resource explaining font metrics in a single simple image:
http://developer.apple.com/mac/library/ ... trics.html
Take off every Zigg for great rapist.
Now, outgay that!
Now, outgay that!
Users browsing this forum: No registered users and 12 guests