diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-10-25 13:21:37 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-10-26 18:46:43 +0200 |
commit | e8a1504407311ce0269926797671951fa55b4134 (patch) | |
tree | c333105a91ee9566b215bfe971ce1a693051ceff | |
parent | 343abcf4dfa2d3da2bbec5e34d48c1b337a3348c (diff) | |
download | mupdf-e8a1504407311ce0269926797671951fa55b4134.tar.xz |
Fix 697215: Script specific punctuation blocks.
Ideographic and full-width punctuation inherit the script from the
surroundings, like all other punctuation. This does not play well
with our fallback font lookups.
Add special cases for ideographic and fullwidth unicode blocks.
-rw-r--r-- | source/fitz/font.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c index 14c79aa9..7142414e 100644 --- a/source/fitz/font.c +++ b/source/fitz/font.c @@ -1525,6 +1525,16 @@ fz_encode_character_with_fallback(fz_context *ctx, fz_font *user_font, int unico if (script == 0) script = ucdn_get_script(unicode); + /* Fix for ideographic/halfwidth/fullwidth punctuation forms. */ + if ((unicode >= 0x3000 && unicode <= 0x303F) || (unicode >= 0xFF00 && unicode <= 0xFFEF)) + { + if (script != UCDN_SCRIPT_HANGUL && + script != UCDN_SCRIPT_HIRAGANA && + script != UCDN_SCRIPT_KATAKANA && + script != UCDN_SCRIPT_BOPOMOFO) + script = UCDN_SCRIPT_HAN; + } + font = fz_load_fallback_font(ctx, script, language, user_font->flags.is_serif, user_font->flags.is_bold, user_font->flags.is_italic); if (font) { |