*** empty log message ***
[m17n/m17n-test.git] / flt.c
diff --git a/flt.c b/flt.c
index dbf6c88..1590ed2 100644 (file)
--- a/flt.c
+++ b/flt.c
@@ -741,7 +741,6 @@ setup_features (int gsubp, FontInfoHB *font_info, MFLTOtfSpec *spec,
   FT_UShort req_feature, index;
   FT_UInt *feature_list;
   int i, j, k;
-  HB_Error err;
 
   if (gsubp)
     {
@@ -1026,6 +1025,8 @@ get_glyph_id (MFLTFont *font, MFLTGlyph *g)
   return (g->code ? 0 : -1);
 }
 
+#define PANGO_SCALE_TO_26_6 (PANGO_SCALE / (1<<6))
+
 int
 get_metric (MFLTFont *font, MFLTGlyphString *gstring, int from, int to)
 {
@@ -1039,13 +1040,14 @@ get_metric (MFLTFont *font, MFLTGlyphString *gstring, int from, int to)
 
       pango_font_get_glyph_extents (PANGO_FONT (font_info->pango_font),
                                    gstring->glyphs[i].code, &inc, &logical);
-      g->lbearing = inc.x;
-      g->rbearing = inc.x + inc.width;
-      g->xadv = logical.width;
+      g->lbearing = inc.x / PANGO_SCALE_TO_26_6;
+      g->rbearing = (inc.x + inc.width) / PANGO_SCALE_TO_26_6;
+      g->xadv = logical.width / PANGO_SCALE_TO_26_6;
       g->yadv = 0;
-      g->ascent = - inc.y;
-      g->descent = inc.height + inc.y;
+      g->ascent = - inc.y / PANGO_SCALE_TO_26_6;
+      g->descent = (inc.height + inc.y) / PANGO_SCALE_TO_26_6;
     }
+  return 0;
 }
 
 #ifndef PANGO_OT_DEFAULT_LANGUAGE
@@ -1065,7 +1067,6 @@ setup_features (PangoOTTableType type, FontInfoPango *font_info,
   guint req_feature, index;
   guint *feature_list;
   int i, j, k;
-  int err;
   FT_Face face;
   PangoOTInfo *ot_info; 
 
@@ -1186,9 +1187,9 @@ drive_otf (MFLTFont *font, MFLTOtfSpec *spec,
       g = out->glyphs + out->used++;
       if (g->code != glyph_info->glyph)
        g->c = 0, g->code = glyph_info->glyph;
-      g->xoff = glyph_info->geometry.x_offset;
-      g->yoff = glyph_info->geometry.y_offset;
-      g->xadv = glyph_info->geometry.width;
+      g->xoff = glyph_info->geometry.x_offset / PANGO_SCALE_TO_26_6;
+      g->yoff = glyph_info->geometry.y_offset / PANGO_SCALE_TO_26_6;
+      g->xadv = glyph_info->geometry.width / PANGO_SCALE_TO_26_6;
       g->yadv = 0;
       adjustment[i].set = 0;
     }
@@ -1308,13 +1309,18 @@ main (int argc, char **argv)
   for (i = 0, j = mtext_character (mt, i, len, '\n'); i < len;
        i = j + 1, j = mtext_character (mt, i, len, '\n'))
     {
+      int to;
+
       if (j < 0)
        j = len;
-      if (flt (mt, i, j, font, flt_name) < 0)
+      to = flt (mt, i, j, font, flt_name);
+      if (to < 0)
        {
          fprintf (stderr, "Error in FLT processing.\n");
          exit (1);
        }
+      while (to < j
+
     }
   m17n_object_unref (mt);
   close_font (font);