Commit 57d3b93b authored by Kenichi Handa's avatar Kenichi Handa

(ftfont_text_extents): Fix calculation of metrics->descent.

parent 4ffdb307
2009-04-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* ftfont.c (ftfont_text_extents): Fix calculation of
metrics->descent.
2009-04-06 Jason Rumney <jasonr@gnu.org>
* frame.c (x_set_font): Avoid C99 mid-block variable declaration.
......
......@@ -1255,7 +1255,7 @@ ftfont_text_extents (font, code, nglyphs, metrics)
metrics->lbearing = m->horiBearingX >> 6;
metrics->rbearing = (m->horiBearingX + m->width) >> 6;
metrics->ascent = m->horiBearingY >> 6;
metrics->descent = (m->horiBearingY + m->height) >> 6;
metrics->descent = (m->height - m->horiBearingY) >> 6;
}
first = 0;
}
......@@ -1269,8 +1269,8 @@ ftfont_text_extents (font, code, nglyphs, metrics)
= width + ((m->horiBearingX + m->width) >> 6);
if (metrics->ascent < (m->horiBearingY >> 6))
metrics->ascent = m->horiBearingY >> 6;
if (metrics->descent > ((m->horiBearingY + m->height) >> 6))
metrics->descent = (m->horiBearingY + m->height) >> 6;
if (metrics->descent > ((m->height - m->horiBearingY) >> 6))
metrics->descent = (m->height - m->horiBearingY) >> 6;
}
width += m->horiAdvance >> 6;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment