From: handa Date: Mon, 5 Oct 2009 08:10:01 +0000 (+0000) Subject: (mfont__get_glyph_id): Pay attention to. mfont->source. X-Git-Tag: merge-to-XML~66 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=9634b3077f91e0d8e5a8df504fa580744279469c;p=m17n%2Fm17n-lib.git (mfont__get_glyph_id): Pay attention to. mfont->source. --- diff --git a/src/font.c b/src/font.c index 09fa489..40782c8 100644 --- a/src/font.c +++ b/src/font.c @@ -1685,13 +1685,16 @@ mfont__get_glyph_id (MFLTFont *font, MFLTGlyphString *gstring, if (g->g.encoded) continue; - if (! encoding->encoding_charset) - g->g.code = MCHAR_INVALID_CODE; - else if (mfont->source == MFONT_SOURCE_X && encoding->repertory_charset) + if (mfont->source == MFONT_SOURCE_X && encoding->repertory_charset) g->g.code = ENCODE_CHAR (encoding->repertory_charset, g->g.code); else { - unsigned code = ENCODE_CHAR (encoding->encoding_charset, g->g.code); + unsigned code; + + if (encoding->encoding_charset) + code = ENCODE_CHAR (encoding->encoding_charset, g->g.code); + else + code = g->g.code; if (code != MCHAR_INVALID_CODE) {