From 20b50a5cb429ea7cef2f80280a0e49a9003d039b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ximo=20Casta=C3=B1eda?= Date: Sat, 19 Feb 2022 21:12:38 +0100 Subject: [PATCH] app_server: update list of default ignorable code points Update as per Unicode 14 (and draft 15) Include the noncharacters. We don't really want the .notdef glyph for them, except for U+FDD1 which we have reserved internally to force it from webkit. Fixes #17593 Change-Id: I5a62bf0e7753adacc81ea19b3351deb58d5c0653 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4984 Tested-by: Commit checker robot Reviewed-by: Adrien Destugues --- src/servers/app/font/FontCacheEntry.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/servers/app/font/FontCacheEntry.cpp b/src/servers/app/font/FontCacheEntry.cpp index 953a12bae9..ef8af33af3 100644 --- a/src/servers/app/font/FontCacheEntry.cpp +++ b/src/servers/app/font/FontCacheEntry.cpp @@ -202,8 +202,6 @@ render_as_space(uint32 glyphCode) // no-break space || (glyphCode == 0x1680) // ogham space mark - || (glyphCode == 0x180e) - // mongolian vowel separator || (glyphCode >= 0x2000 && glyphCode <= 0x200a) // en quand, hair space || (glyphCode >= 0x2028 && glyphCode <= 0x2029) @@ -222,17 +220,20 @@ inline bool render_as_zero_width(uint32 glyphCode) { // ignorable chars: render as invisible - // as per Unicode DerivedCoreProperties.txt: Default_Ignorable_Code_Point + // as per Unicode DerivedCoreProperties.txt: Default_Ignorable_Code_Point. + // We also don't want tofu for noncharacters if we ever get one. return (glyphCode == 0x00ad) // soft hyphen || (glyphCode == 0x034f) // combining grapheme joiner + || (glyphCode == 0x061c) + // arabic letter mark || (glyphCode >= 0x115f && glyphCode <= 0x1160) // hangul fillers || (glyphCode >= 0x17b4 && glyphCode <= 0x17b5) // ignorable khmer vowels - || (glyphCode >= 0x180b && glyphCode <= 0x180d) - // variation selectors + || (glyphCode >= 0x180b && glyphCode <= 0x180f) + // mongolian variation selectors and vowel separator || (glyphCode >= 0x200b && glyphCode <= 0x200f) // zero width space, cursive joiners, ltr marks || (glyphCode >= 0x202a && glyphCode <= 0x202e) @@ -249,10 +250,19 @@ render_as_zero_width(uint32 glyphCode) // halfwidth hangul filler || (glyphCode >= 0xfff0 && glyphCode <= 0xfff8) // reserved + || (glyphCode >= 0x1bca0 && glyphCode <= 0x1bca3) + // shorthand format controls || (glyphCode >= 0x1d173 && glyphCode <= 0x1d17a) // musical symbols || (glyphCode >= 0xe0000 && glyphCode <= 0xe01ef) // variation selectors, tag space, reserved + || (glyphCode >= 0xe01f0 && glyphCode <= 0xe0fff) + // reserved + || ((glyphCode & 0xffff) >= 0xfffe) + // noncharacters + || ((glyphCode >= 0xfdd0 && glyphCode <= 0xfdef) + && glyphCode != 0xfdd1) + // noncharacters; 0xfdd1 is used internally to force .notdef glyph ; }