From 8eb2df1a8e9d59b6914eca9691f1bab8f4efadce Mon Sep 17 00:00:00 2001 From: Roozbeh Pournader Date: Fri, 17 Mar 2017 15:42:49 -0700 Subject: [PATCH] Remove workaround for line breaks around currency symbols This is now done properly in ICU so we no longer need to do it ourselves. Also updated some comments about emoji line-breaking. Test: Existings tests for this in Minikin continue to pass. Bug: 24959657 Bug: 27365282 Change-Id: I865ea9ba1e79a64409d84d2d30c121f740e35ad6 --- engine/src/flutter/libs/minikin/WordBreaker.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/engine/src/flutter/libs/minikin/WordBreaker.cpp b/engine/src/flutter/libs/minikin/WordBreaker.cpp index 36a3e88b23..3b9e956fe1 100644 --- a/engine/src/flutter/libs/minikin/WordBreaker.cpp +++ b/engine/src/flutter/libs/minikin/WordBreaker.cpp @@ -83,23 +83,13 @@ static bool isBreakValid(const uint16_t* buf, size_t bufEnd, size_t i) { size_t next_offset = i; U16_NEXT(buf, next_offset, bufEnd, next_codepoint); - // Proposed change to LB24 from http://www.unicode.org/L2/L2016/16043r-line-break-pr-po.txt - // (AL | HL) × (PR | PO) - int32_t lineBreak = u_getIntPropertyValue(codePoint, UCHAR_LINE_BREAK); - if (lineBreak == U_LB_ALPHABETIC || lineBreak == U_LB_HEBREW_LETTER) { - lineBreak = u_getIntPropertyValue(next_codepoint, UCHAR_LINE_BREAK); - if (lineBreak == U_LB_PREFIX_NUMERIC || lineBreak == U_LB_POSTFIX_NUMERIC) { - return false; - } - } - - // Emoji ZWJ sequences. + // Rule LB8 for Emoji ZWJ sequences. We need to do this ourselves since we may have fresher + // emoji data than ICU does. if (codePoint == CHAR_ZWJ && isEmoji(next_codepoint)) { return false; } - // Proposed Rule LB30b from http://www.unicode.org/L2/L2016/16011r3-break-prop-emoji.pdf - // EB x EM + // Rule LB30b. We need to this ourselves since we may have fresher emoji data than ICU does. if (isEmojiModifier(next_codepoint)) { if (codePoint == 0xFE0F && prev_offset > 0) { // skip over emoji variation selector