Kikito is right, there is space above letters in most fonts for the ascenders. You used capital letters, but the ascenders typically rise above capital height.kikito wrote:Fonts are complex. That "extra space" you see could be the font ascent. See this link:
http://en.wikipedia.org/wiki/Typeface#Font_metrics
Font Aligning Problems
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Font Aligning Problems
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: Font Aligning Problems
That's good to know.
Actually isn't it any way to predict how much the ascent will rise depending on the font size one might want to set ?
Actually isn't it any way to predict how much the ascent will rise depending on the font size one might want to set ?
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Font Aligning Problems
Depends on the font, so unless and until LÖVE has a way to extract that information from the font, the answer is no.
Help us help you: attach a .love.
Re: Font Aligning Problems
For this particular font, there should be some space above the ABC. However, LOVE is adding too much space, from what I can tell. I tracked this down to a line of code in LOVE's print() function in /opengl/Font.cpp):rcm wrote:All 3 sizes should be aligned along the top of the window, instead there's extra space above them. Is this supposed to happen
Code: Select all
if (type == FONT_TRUETYPE) glTranslatef(0, floor(getHeight() / 1.25f + 0.5f), 0);
To fix this that line of code should look like this, IMO:
Code: Select all
if (type == FONT_TRUETYPE) glTranslatef(0, getAscent(), 0);
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Font Aligning Problems
I think that post belongs in the issue tracker. Good find!
When I write def I mean function.
Who is online
Users browsing this forum: Amazon [Bot] and 2 guests