changeset 102877:3f976a2deab1

(ftfont_text_extents): Fix calculation of metrics->descent.
author Kenichi Handa <handa@m17n.org>
date Wed, 08 Apr 2009 01:30:55 +0000
parents e38631d95db3
children 2203893d21b9
files src/ftfont.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/ftfont.c	Tue Apr 07 04:06:39 2009 +0000
+++ b/src/ftfont.c	Wed Apr 08 01:30:55 2009 +0000
@@ -1255,7 +1255,7 @@
 		  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 @@
 		  = 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;
 	}