(ftfont_open): Fix checking of the return value of
authorKenichi Handa <handa@m17n.org>
Mon, 6 Apr 2009 07:57:46 +0000 (07:57 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 6 Apr 2009 07:57:46 +0000 (07:57 +0000)
FT_Load_Char.  Fix setting font->underline_thickness.

src/ChangeLog
src/ftfont.c

index 2289033..6434839 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * ftfont.c (ftfont_open): Fix checking of the return value of
+       FT_Load_Char.  Fix setting font->underline_thickness.
+
 2009-04-04  Chong Yidong  <cyd@stupidchicken.com>
 
        * terminal.c (Fterminal_name, Fdelete_terminal, Fterminal_name)
index aa9777a..f515856 100644 (file)
@@ -1130,7 +1130,7 @@ ftfont_open (f, entity, pixel_size)
 
       font->min_width = font->average_width = font->space_width = 0;
       for (i = 32, n = 0; i < 127; i++)
-       if (FT_Load_Char (ft_face, i, FT_LOAD_DEFAULT) != 0)
+       if (FT_Load_Char (ft_face, i, FT_LOAD_DEFAULT) == 0)
          {
            int this_width = ft_face->glyph->metrics.horiAdvance >> 6;
 
@@ -1153,7 +1153,7 @@ ftfont_open (f, entity, pixel_size)
   if (scalable)
     {
       font->underline_position = -ft_face->underline_position * size / upEM;
-      font->underline_thickness = -ft_face->underline_thickness * size / upEM;
+      font->underline_thickness = ft_face->underline_thickness * size / upEM;
     }
   else
     {