From 3204cbf1a986326e98c453818af69d17d0a4a193 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Tue, 9 Feb 2016 23:55:11 +0100 Subject: html: Consider CJK punctuation in line breaking algorithm --- source/html/html-layout.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/html/html-layout.c b/source/html/html-layout.c index 30b6e334..0a6e9970 100644 --- a/source/html/html-layout.c +++ b/source/html/html-layout.c @@ -152,6 +152,7 @@ static fz_html_flow *split_flow(fz_context *ctx, fz_pool *pool, fz_html_flow *fl static int iscjk(int c) { + if (c >= 0x3000 && c <= 0x303F) return 1; /* CJK Symbols and Punctuation */ if (c >= 0x3200 && c <= 0x9FFF) return 1; /* CJK Blocks */ if (c >= 0xFF00 && c <= 0xFFEF) return 1; /* Halfwidth and Fullwidth Forms */ return 0; @@ -165,8 +166,8 @@ static int not_at_bol(int cat, int c) if (c == ']' || c == 0xFF3D) return 1; if (c == '}' || c == 0xFF5D) return 1; if (c == '>' || c == 0xFF1E) return 1; - if (c == ',' || c == 0xFF0C) return 1; - if (c == '.' || c == 0xFF0E) return 1; + if (c == ',' || c == 0xFF0C || c == 0x3001) return 1; + if (c == '.' || c == 0xFF0E || c == 0x3002) return 1; if (c == ':' || c == 0xFF1A) return 1; if (c == ';' || c == 0xFF1B) return 1; if (c == '?' || c == 0xFF1F) return 1; -- cgit v1.2.3