From: handa Date: Thu, 6 Sep 2007 04:04:09 +0000 (+0000) Subject: (run_stages): Call positioning only if X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=c87f397b76fa864df1a75de1a56d826ae7167e9a;p=m17n%2Fm17n-lib.git (run_stages): Call positioning only if font->get_metric is non-NULL. (CHECK_FLT_STAGES): Fix typo. (mflt_get): New function. --- 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;