From: handa Date: Sun, 6 Jan 2008 14:25:45 +0000 (+0000) Subject: (mfont__get_glyph_id): Return -1 if some code is invalid. X-Git-Tag: REL-1-5-1~26 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=facc80c95de5a5fba7a3da05553be42fdd15a543;p=m17n%2Fm17n-lib.git (mfont__get_glyph_id): Return -1 if some code is invalid. --- diff --git a/src/font.c b/src/font.c index 1bcae33..35cdea9 100644 --- a/src/font.c +++ b/src/font.c @@ -1676,6 +1676,7 @@ mfont__get_glyph_id (MFLTFont *font, MFLTGlyphString *gstring, MFontEncoding *encoding; MFontDriver *driver = NULL; MGlyph *glyphs = (MGlyph *) gstring->glyphs; + int result = 0; encoding = mfont->encoding ? mfont->encoding : find_encoding (mfont); for (; from < to; from++) @@ -1713,8 +1714,10 @@ mfont__get_glyph_id (MFLTFont *font, MFLTGlyphString *gstring, } } g->g.encoded = 1; + if (g->g.code == MCHAR_INVALID_CODE) + result = -1; } - return 0; + return result; } int