From c87f397b76fa864df1a75de1a56d826ae7167e9a Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 6 Sep 2007 04:04:09 +0000 Subject: [PATCH] (run_stages): Call positioning only if font->get_metric is non-NULL. (CHECK_FLT_STAGES): Fix typo. (mflt_get): New function. --- src/m17n-flt.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/m17n-flt.c b/src/m17n-flt.c index f128e43..b6425ee 100644 --- a/src/m17n-flt.c +++ b/src/m17n-flt.c @@ -1901,7 +1901,8 @@ run_stages (MFLTGlyphString *gstring, int from, int to, } } - positioning (ctx->font, ctx->out, 0, ctx->out->used); + if (ctx->font->get_metric) + positioning (ctx->font, ctx->out, 0, ctx->out->used); /* Handle combining. */ if (ctx->check_mask & CombiningCodeMask) @@ -1986,7 +1987,7 @@ run_stages (MFLTGlyphString *gstring, int from, int to, return to; } -#define CHECK_FLT_STAGES(flt) ((flt)->stages || load_flt (flt) < 0) +#define CHECK_FLT_STAGES(flt) ((flt)->stages || load_flt (flt) == 0) /* Internal API */ @@ -2078,6 +2079,21 @@ m17n_fini_flt (void) #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */ MFLT * +mflt_get (char *name) +{ + MSymbol sym = msymbol (name); + MFLT *flt; + + if (! flt_list + && list_flt () < 0) + return NULL; + flt = mplist_get (flt_list, sym); + if (flt && ! CHECK_FLT_STAGES (flt)) + return NULL; + return flt; +} + +MFLT * mflt_find (MFLTGlyphString *gstring, int pos, MFLTFont *font) { MPlist *plist; -- 1.7.10.4