Bug 1011369 - Implement loose|normal|strict line-break values by remapping the linebreak class of affected characters. r=m_kato

Differential Revision: https://phabricator.services.mozilla.com/D30787
This commit is contained in:
Jonathan Kew
2019-05-20 20:46:57 +00:00
parent b429ed9568
commit ecc8ac7280
2 changed files with 215 additions and 117 deletions

View File

@@ -138,6 +138,20 @@ inline bool IsEastAsianWidthFWH(uint32_t aCh) {
return false;
}
inline bool IsEastAsianWidthAFW(uint32_t aCh) {
switch (u_getIntPropertyValue(aCh, UCHAR_EAST_ASIAN_WIDTH)) {
case U_EA_AMBIGUOUS:
case U_EA_FULLWIDTH:
case U_EA_WIDE:
return true;
case U_EA_HALFWIDTH:
case U_EA_NARROW:
case U_EA_NEUTRAL:
return false;
}
return false;
}
inline bool IsDefaultIgnorable(uint32_t aCh) {
return u_hasBinaryProperty(aCh, UCHAR_DEFAULT_IGNORABLE_CODE_POINT);
}