[Webkit-unassigned] [Bug 77067] Parenthesis in RTL fonts are not mirrored with SVG fonts

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 27 09:58:37 PST 2012


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





--- Comment #11 from Philip Rogers <pdr at google.com>  2012-01-27 09:58:37 PST ---
(In reply to comment #8)
> (From update of attachment 124241 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=124241&action=review
> 
> r- for the lacking ChangeLog, and as there's more to do I think:
> 
> > Source/WebCore/ChangeLog:8
> > +
> > +        Tests: svg/custom/glyph-selection-arabic-forms.svg
> 
> Needs a real ChangeLog :-)

Added!

> 
> > Source/WebCore/svg/SVGFontData.cpp:277
> > +        mirroredCharacters.append((UChar) mirroredChar(characters[i]));
> 
> You're casting from UChar32 to UChar here - doesn't this break any non-bmp glyphs?
> What you're supposed to do is using:
> 
>         UChar32 character = 0;
>         unsigned clusterLength = 0;
>         SurrogatePairAwareTextIterator textIterator(characters, 0, length, length);
>         while (textIterator.consume(character, clusterLength)) {
> 
> the SurrogatePairAwareTextIterator.. - see eg. SVGGlyphMap.h collectGlyphsForString(), where the 'remainingTextInRun' is being passed to.
> The mirroring needs to happen on UChar32 basis - you wouldn't want to mirror parts of a surrogate pair, but instead the full UTF-16 code point, if I get this right.
> 
> Then to create a String again, you need to decompose those potentially mirrored UTF-16 UChar32, back into two utf-8 UChar pairs.
> Now if mirroring the two parts of a surrogate pair, is the same as mirroring the full UChar32, then my comment is wrong, but I think this isn't the case.
> Please double check.

This was a completely valid thing to check (and the new test glyph-selection-non-bmp.svg now proves it) but it turns out that the cast isn't problematic because WTF:UChar is 16 bits (unlike the 8bit version we're both used to). This cast was actually already occurring in Font::normalizeSpaces, which works similarly to replaceMirroredCharacters.

-- 
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