From b5621027ae6f52f8721096d3c1ff895c2628fc5b Mon Sep 17 00:00:00 2001 From: handa Date: Mon, 3 Sep 2007 00:37:02 +0000 Subject: [PATCH] *** empty log message *** --- Makefile.am | 6 +++++- flt.c | 28 +++++++++++++++++----------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6182fa8..fb8f4ae 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ noinst_PROGRAMS = \ linebreak replace mimdemo mimdaemon fifotest1 fifotest2 \ imtest findfont gdkdraw finddb imsim langname viewfile pangotest \ - flt-gui flt-otf flt-hb flt-pango + flt-gui flt-otf flt-hb flt-pango find-flt mimdemo_LDADD = -lgd mimdaemon_LDADD = -lgd @@ -32,6 +32,10 @@ flt_pango_SOURCES = flt.c flt_pango_CFLAGS = ${baseCFLAGS} @M17NFLT_CFLAGS@ @PANGO_CFLAGS@ -DFLT_PANGO flt_pango_LDFLAGS = ${baseLIBS} @M17NFLT_LIBS@ @PANGO_LIBS@ +find_flt_SOURCES = find-flt.c +find_flt_CFLAGS = ${baseCFLAGS} @M17NFLT_CFLAGS@ +find_flt_LDFLAGS = ${baseLIBS} @M17NFLT_LIBS@ + verify: linebreak @echo "checking line breaking..." @for arg in "" --sp-cm --korean-sp --ai-as-id; do \ diff --git a/flt.c b/flt.c index dbf6c88..1590ed2 100644 --- 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); -- 1.7.10.4