Bug 51012 - Kana should be part of CJK Ideographs in WebCore/platform/graphics/Font.cpp
Summary: Kana should be part of CJK Ideographs in WebCore/platform/graphics/Font.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 50365 50619
  Show dependency treegraph
 
Reported: 2010-12-13 21:57 PST by Koan-Sin Tan
Modified: 2010-12-14 19:48 PST (History)
6 users (show)

See Also:


Attachments
Kata not displayed right in vertical text (110.93 KB, image/png)
2010-12-13 21:57 PST, Koan-Sin Tan
no flags Details
Proposed patch (3.77 KB, patch)
2010-12-13 22:14 PST, Koan-Sin Tan
no flags Details | Formatted Diff | Diff
Proposed patch (3.83 KB, patch)
2010-12-13 23:54 PST, Koan-Sin Tan
no flags Details | Formatted Diff | Diff
kana displayed correctly after the patch is applied (89.28 KB, image/png)
2010-12-14 01:03 PST, Koan-Sin Tan
no flags Details
modified patch with expected result added (107.41 KB, patch)
2010-12-14 16:55 PST, Koan-Sin Tan
no flags Details | Formatted Diff | Diff
patch with expected results (107.41 KB, patch)
2010-12-14 17:02 PST, Koan-Sin Tan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Koan-Sin Tan 2010-12-13 21:57:23 PST
Created attachment 76497 [details]
Kata not displayed right in vertical text

Katakana and hiragana should be considered part of CJK Ideographs, otherwise they are not displayed correctly in vertical writing
Comment 1 Koan-Sin Tan 2010-12-13 22:14:33 PST
Created attachment 76500 [details]
Proposed patch

Add the following to CJK ideographs:
hiragana: U+3040 - U+309F
katakana: U+30A0 - U+30FF
Halfwidth and Fullwidth Forms: U+FF00 - U+FFEF

Glyphs in Halfwidth and Fullwidth Forms are widely used in CJK. They are mostly used in CJK, I think.
Comment 2 Koan-Sin Tan 2010-12-13 23:54:39 PST
Created attachment 76508 [details]
Proposed patch

Same as 76500, updated to change WebCore::Font::isCJKIdeographOrSymbol introduced in http://trac.webkit.org/changeset/74005 instead of WebCore::Font::isCJKIdeograph
Comment 3 Koan-Sin Tan 2010-12-14 01:03:15 PST
Created attachment 76510 [details]
kana displayed correctly after the patch is applied

Yes, I know it's broken font, but sometimes people use broken font :-)
Comment 4 Alexey Proskuryakov 2010-12-14 12:04:31 PST
Comment on attachment 76508 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=76508&action=review

All these checks look slow. I don't know if this is a practical problem.

> LayoutTests/ChangeLog:8
> +        Test if kana displayed correctly in vertical text with broken font.

The test should have expected results, see <http://webkit.org/coding/contributing.html>.
Comment 5 Koan-Sin Tan 2010-12-14 15:11:49 PST
(In reply to comment #4)
> (From update of attachment 76508 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=76508&action=review
> 
> All these checks look slow. I don't know if this is a practical problem.

you have to deal with it anyway, right?
how about combining checks of contiguous blocks, such as hiragana and katakana?
or try to come up some magic arithmetic?

> > LayoutTests/ChangeLog:8
> > +        Test if kana displayed correctly in vertical text with broken font.
> 
> The test should have expected results, see <http://webkit.org/coding/contributing.html>.

Will do that, thanks.
Comment 6 Alexey Proskuryakov 2010-12-14 15:15:40 PST
This was just a comment in passing, please don't implement any optimizations unless profiling show that this is hot code.
Comment 7 Koan-Sin Tan 2010-12-14 16:55:47 PST
Created attachment 76594 [details]
modified patch with expected result added

Same as 76508. Added expected results.
Comment 8 Koan-Sin Tan 2010-12-14 17:02:35 PST
Created attachment 76597 [details]
patch with expected results

Same as 76594. Deleted a stupid \n introduced by copy-and-paste
Comment 9 WebKit Commit Bot 2010-12-14 19:48:18 PST
Comment on attachment 76597 [details]
patch with expected results

Clearing flags on attachment: 76597

Committed r74096: <http://trac.webkit.org/changeset/74096>
Comment 10 WebKit Commit Bot 2010-12-14 19:48:25 PST
All reviewed patches have been landed.  Closing bug.