with a range of punctuation characters.
rdar://problem/30108391
Created attachment 299286 [details] Patch
Alternatively we could pass in a list of ranges, but i don't think the complexity is justified at this point (maybe when some other properties need to include/exclude certain unicode ranges)
Comment on attachment 299286 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=299286&action=review > Source/WebCore/rendering/SimpleLineLayout.cpp:157 > + // Include characters up to Latin Extended-B and some punctuation range when text is justified. > + bool isLatinIncludingExtendedB = character <= 0x01FF; > + bool isPunctuationRange = character >= 0x2010 && character <= 0x2027; > + if (!(isLatinIncludingExtendedB || isPunctuationRange)) > + SET_REASON_AND_RETURN_IF_NEEDED(FlowHasJustifiedNonLatinText, reasons, includeReasons); > + } You could also do this with ICU methods, something along the lines of auto block = ublock_getCode(character); bool ok = block <= UBLOCK_LATIN_EXTENDED_B || block == UBLOCK_GENERAL_PUNCTUATION ... Not sure if it is better. I suppose the range could be wider too.
(In reply to comment #4) > Comment on attachment 299286 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=299286&action=review > > > Source/WebCore/rendering/SimpleLineLayout.cpp:157 > > + // Include characters up to Latin Extended-B and some punctuation range when text is justified. > > + bool isLatinIncludingExtendedB = character <= 0x01FF; > > + bool isPunctuationRange = character >= 0x2010 && character <= 0x2027; > > + if (!(isLatinIncludingExtendedB || isPunctuationRange)) > > + SET_REASON_AND_RETURN_IF_NEEDED(FlowHasJustifiedNonLatinText, reasons, includeReasons); > > + } > > You could also do this with ICU methods, something along the lines of > > auto block = ublock_getCode(character); > bool ok = block <= UBLOCK_LATIN_EXTENDED_B || block == > UBLOCK_GENERAL_PUNCTUATION > ... > > Not sure if it is better. > > I suppose the range could be wider too. or narrower too. (0x2010, 0x2027) is a subset of the general punctuation range.
Comment on attachment 299286 [details] Patch Clearing flags on attachment: 299286 Committed r210948: <http://trac.webkit.org/changeset/210948>
All reviewed patches have been landed. Closing bug.