From facc80c95de5a5fba7a3da05553be42fdd15a543 Mon Sep 17 00:00:00 2001 From: handa Date: Sun, 6 Jan 2008 14:25:45 +0000 Subject: [PATCH] (mfont__get_glyph_id): Return -1 if some code is invalid. --- src/font.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 1.7.10.4