diff options
Diffstat (limited to 'source/fitz')
-rw-r--r-- | source/fitz/font.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c index de69ff9c..6e7e0063 100644 --- a/source/fitz/font.c +++ b/source/fitz/font.c @@ -1644,6 +1644,40 @@ fz_encode_character_with_fallback(fz_context *ctx, fz_font *user_font, int unico return *out_font = font, gid; } +#ifndef TOFU_CJK_LANG + if (script == UCDN_SCRIPT_HAN) + { + font = fz_load_fallback_font(ctx, script, FZ_LANG_ja, user_font->flags.is_serif, user_font->flags.is_bold, user_font->flags.is_italic); + if (font) + { + gid = fz_encode_character(ctx, font, unicode); + if (gid > 0) + return *out_font = font, gid; + } + font = fz_load_fallback_font(ctx, script, FZ_LANG_ko, user_font->flags.is_serif, user_font->flags.is_bold, user_font->flags.is_italic); + if (font) + { + gid = fz_encode_character(ctx, font, unicode); + if (gid > 0) + return *out_font = font, gid; + } + font = fz_load_fallback_font(ctx, script, FZ_LANG_zh_Hant, user_font->flags.is_serif, user_font->flags.is_bold, user_font->flags.is_italic); + if (font) + { + gid = fz_encode_character(ctx, font, unicode); + if (gid > 0) + return *out_font = font, gid; + } + font = fz_load_fallback_font(ctx, script, FZ_LANG_zh_Hans, user_font->flags.is_serif, user_font->flags.is_bold, user_font->flags.is_italic); + if (font) + { + gid = fz_encode_character(ctx, font, unicode); + if (gid > 0) + return *out_font = font, gid; + } + } +#endif + font = fz_load_fallback_symbol_font(ctx); if (font) { |