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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 7 05:05:56 PDT 2013


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





--- Comment #5 from Rashmi Shyamasundar <rashmi.s2 at samsung.com>  2013-08-07 05:05:34 PST ---
The function isSpaceOrNewline returns true for the below characters

1. Ascii characters - U+0020, 0xD, 0xC, 0xB, 0xA,  0x9
2. All unicode white space characters

According to http://en.wikipedia.org/wiki/Mapping_of_Unicode_characters#Whitespace_characters :-

Unicode designates the legacy control characters U+0009 through U+000D and U+0085 as whitespace characters, as well as all characters whose General Category property value is Separator. There are 26 total whitespace characters as of Unicode 6.0.0.

Hence U+3000(ideographic space character) is a white space character according to Unicode. And, the function isSpaceOrNewline() returns true for U+3000.

But, the character U+3000 should not be replaced with U+0020 according to the text preparation algorithm - http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#text-preparation-algorithm . 

Hence, I have defined a new function :-

The function isSpaceOrNewline returns true for the below characters

1. Ascii characters - U+0020, 0xD, 0xC, 0xB, 0xA,  0x9
2. All unicode white space characters

According to http://en.wikipedia.org/wiki/Mapping_of_Unicode_characters#Whitespace_characters :-

Unicode designates the legacy control characters U+0009 through U+000D and U+0085 as whitespace characters, as well as all characters whose General Category property value is Separator. There are 26 total whitespace characters as of Unicode 6.0.0.

Hence U+3000(ideographic space character) is a white space character according to Unicode. And, the function isSpaceOrNewline() returns true for U+3000.

But, the character U+3000 should not be replaced with U+0020 according to the text preparation algorithm - http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#text-preparation-algorithm . 

Hence, I have defined a new function :-

static inline bool shouldSpaceBeReplaced(UChar c)
{
return (c == 0x0009 || c == 0x000A || c == 0x000C || c == 0x000D) ? true : false;
}

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