Bug 235257

Summary: Two bopomofo tone marks are not moved to the correct place in vertical text with a particular bopomofo font
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: TextAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, mmaxfield, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://cmex-30.github.io/Bopomofo_on_Web/testpage/index.html
Attachments:
Description Flags
Reduction
none
Patch
darin: review+
Needs attribution for font creator
none
Patch for committing none

Description Myles C. Maxfield 2022-01-14 16:53:19 PST
See https://cmex-30.github.io/Bopomofo_on_Web/testpage/index.html

In the last box, these two characters are not placed correctly:

- ˫ U+02EB MODIFIER LETTER YANG DEPARTING TONE MARK
- ˪ U+02EA MODIFIER LETTER YIN DEPARTING TONE MARK

Compare the positioning to Chrome.
Comment 1 Radar WebKit Bug Importer 2022-01-14 16:54:08 PST
<rdar://problem/87625596>
Comment 2 Myles C. Maxfield 2022-01-14 16:56:12 PST
Created attachment 449233 [details]
Reduction
Comment 3 Myles C. Maxfield 2022-01-14 16:56:28 PST
(The attached reduction needs the custom font from https://cmex-30.github.io/Bopomofo_on_Web/testpage/index.html)
Comment 4 Myles C. Maxfield 2022-01-16 13:11:08 PST
For some reason we're getting two different Font objects in FontCascade::drawGlyphBuffer() which point to the same CTFont
Comment 5 Myles C. Maxfield 2022-01-16 13:15:02 PST
m_font.glyphDataForCharacter() is reporting different Font objects for those characters. They point to the same CTFont though.
Comment 6 Myles C. Maxfield 2022-01-16 13:29:48 PST
I see what's happening. The FontCascade::isCJKIdeographOrSymbol() check in FontCascadeFonts::glyphDataForVariant() is returning true for the modifiers but false for the regular characters.
Comment 7 Myles C. Maxfield 2022-01-16 13:52:26 PST
Created attachment 449287 [details]
Patch
Comment 8 Darin Adler 2022-01-16 13:55:21 PST
Comment on attachment 449287 [details]
Patch

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

> Source/WebCore/ChangeLog:16
> +        No new tests because this requires a custom font to test.

We need to do something about this; maybe make some more custom fonts for the WebKit test suite. That situation is high risk for the project, I think. I’d even like to see this kind of thing tested in WPT.
Comment 9 Myles C. Maxfield 2022-02-02 19:32:21 PST
Created attachment 450730 [details]
Needs attribution for font creator
Comment 10 Myles C. Maxfield 2022-02-03 18:21:50 PST
Created attachment 450845 [details]
Patch for committing
Comment 11 Myles C. Maxfield 2022-02-03 18:53:23 PST
Committed r289101 (246798@trunk): <https://commits.webkit.org/246798@trunk>