[Webkit-unassigned] [Bug 108881] Canvas fillText and measureText handle ideographic spaces differently

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 10 12:40:00 PDT 2013


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


Darin Adler <darin at apple.com> changed:

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




--- Comment #79 from Darin Adler <darin at apple.com>  2013-09-10 12:39:12 PST ---
(From update of attachment 211185)
View in context: https://bugs.webkit.org/attachment.cgi?id=211185&action=review

> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:2133
> +    unsigned textLength = text.length();
> +    Vector<UChar> charVector(textLength);
> +    memcpy(charVector.data(), text.characters(), textLength * sizeof(UChar));
> +
> +    charVector[i++] = ' ';
> +
> +    for (; i < textLength; ++i) {
> +        if (isSpaceThatNeedsReplacing(charVector[i]))
> +            charVector[i] = ' ';
> +    }
> +    text = String::adopt(charVector);

If it ever matters, some day we might want to return to this and make an optimized path for 8-bit character strings; this implementation as is will have a side effect of expanding any strings with a space that needs replacing to 16-bit characters.

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