[Webkit-unassigned] [Bug 79961] Font fallback in cr-win is wrong for string contains zero-width-space

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 21 11:19:43 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=79961


Xiaomei Ji <xji at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #130881|review+                     |review?
               Flag|                            |




--- Comment #12 from Xiaomei Ji <xji at chromium.org>  2012-03-21 11:19:43 PST ---
(From update of attachment 130881)
View in context: https://bugs.webkit.org/attachment.cgi?id=130881&action=review

>> Source/WebCore/platform/graphics/Font.h:232
>> +    static bool treatAsZeroWidthSpaceInComplexScript(UChar c) { return c < 0x20 || (c >= 0x7F && c < 0xA0) || c == softHyphen || c == zeroWidthSpace || (c >= 0x200e && c <= 0x200f) || (c >= 0x202a && c <= 0x202e) || c == zeroWidthNoBreakSpace || c == objectReplacementCharacter; }
> 
> Are there any other callers of this function?

treatedAsZeroWidthSpaceInComplexScript is only used in graphics/chromium/UniscribeHelper.cpp and Font::treatedAsZeroWidthSpace().

The bug is directly caused by that zeroWidthSpace (U+200B) itself is not handled the same way as those characters that could be treated as zero-width-space-in-complex-script in cr-win code. So, adding zeroWidthSpace here fixes the cr-win bug.

The above change also makes Font::treatAsZeroWidthSpace() returns true for  zeroWidthSpace (U+200B).
Font::treatAsZeroWidthSpace()  is used in Font()::normalizeSpaces(), normalizeSpacesAndMirrorChars() in HarfBuzzShaperBase.cpp,  in which, the character is normalized to zeroWidthSpace if it could be treatAsZeroWidthSapce(), so the above change will keep the functionality.

Font::treatAsZeroWidthSpace()  is also used in graphics/mac/ComplexTextController.cpp and graphics/win/UniscribeController.cpp, in which, zeroWidthSpace is handled separately but in the same way as other characters that can be treatedAsZeroWidthSpace(). so, above change (plus the updated code in this patch for those 2 files) will keep the functionality too.

There are no other usages.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list