[webkit-dev] 48459: Glyphs in vertical text tests are rotated 90 degrees clockwise on Windows

Koji Ishii kojiishi at gluesoft.co.jp
Sun Mar 4 02:25:50 PST 2012


The patch isn't completed yet but I posted a work-in-progress patch to make sure I'm not mistaken in overall directions:
https://bugs.webkit.org/show_bug.cgi?id=48459#c44

Any comments are greatly appreciated.

Note that the patch isn't small; ~40k. I thought about splitting new classes (~20k) to a separate bug, but it won't run without changing callers, and it requires one additional API in platforms to read OpenType font files, so I'm not sure if it's a good thing or not. Any suggestions here are also appreciated.


Regards,
Koji

-----Original Message-----
From: webkit-dev-bounces at lists.webkit.org [mailto:webkit-dev-bounces at lists.webkit.org] On Behalf Of Koji Ishii
Sent: Wednesday, February 29, 2012 11:00 AM
To: David Kilzer
Cc: webkit-dev at lists.webkit.org
Subject: Re: [webkit-dev] 48459: Glyphs in vertical text tests are rotated 90 degrees clockwise on Windows

Thank you Dave, I'll go that way.

I'm thinking to write a code that parses OpenType tables only assuming platforms have an API to get specified OpenType tables as raw byte arrays. Hopefully other platforms can use the same code.

CSS is going to define its own glyph orientation definitions, and would like to add author-defined orientations in future levels, so I assume some of the Mac code today will move to the core in future. I'd like the patch well prepared to the move.

Regards,
Koji

-----Original Message-----
From: David Kilzer [mailto:ddkilzer at webkit.org]
Sent: Wednesday, February 29, 2012 1:03 AM
To: Koji Ishii
Cc: webkit-dev at lists.webkit.org; Ryosuke Niwa
Subject: Re: [webkit-dev] 48459: Glyphs in vertical text tests are rotated 90 degrees clockwise on Windows

WebKitSystemInterface is owned by Apple.

I would implement the fix without assuming that wkGetVerticalGlyphsForCharacters is available for Windows.

Dave


On Feb 26, 2012, at 4:46 AM, Koji Ishii wrote:

> I found another library issue for how to get vertical alternate glyphs.
> 
> Currently,
> 
> 1. Mac version of WebCoreSystemInterface.mm defines 
> wkGetVerticalGlyphsForCharacters API 2. Mac uses this function and 
> CoreText to draw vertical glyphs in GlyphPageTreeNodeMac.cpp 3.
> Windows version of WebKitSystemInterface.h doesn't have the API
> 
> Should I also write this one too? I'm asking because the module is different, but again I have no idea who owns WebKitSystemInterface.
> 
> The good part is that, the API probably uses not only 'vert' but also 'vrt2', the latter which recent CSS spec decided not to use, so we have more precise control to match to the current and coming spec.
> 
> The bad part is that, from experiences, we will probably face several issues due to broken fonts. It's not too hard to write the code from OpenType specs, but it might degrade stability since not all fonts conforms to OpenType spec very well.
> 
> 
> Regards,
> Koji
> 
> -----Original Message-----
> From: webkit-dev-bounces at lists.webkit.org
> [mailto:webkit-dev-bounces at lists.webkit.org] On Behalf Of Koji Ishii
> Sent: Saturday, February 25, 2012 5:50 AM
> To: Ryosuke Niwa
> Cc: webkit-dev at lists.webkit.org
> Subject: Re: [webkit-dev] 48459: Glyphs in vertical text tests are 
> rotated 90 degrees clockwise on Windows
> 
> Thank you Ryosuke for the prompt reply.
> 
>>> 1. Bring the CTFontGetVerticalTranslationsForGlyphs API to WebKitLibraries.
>>> 2. Use other libraries such as FreeType[2] to read related OpenType tables.
>>> 3. Read raw tables using GetFontData Win32 API and parse vhea/vorg/vmtx tables etc.
>> 
>> Option 3 seems most desirable since it doesn't introduce new dependencies. 
> 
> Okay...I was afraid of that, because then the patch becomes larger and it might make review harder. But if that's preferable than introducing new dependencies, I can look into that.
> 
> I checked other platforms quickly. Without knowing much of them, from 
> the submitted patches, APIs of Qt[1] and Gtk[2] look like similar to 
> the one on OS X, but it wasn't clear to me if the patches support 
> "upright" for non-CJK letters properly. Chromium Linux[3] doesn't have 
> a patch yet, and Chromium Windows[4] patch has the same issue (uses 
> @-font API.)
> 
> So guess is that if I were to write a function that calculates vertical translations from OpenType tables, it could be shared among some platforms.
> 
> I was thinking to put it into platform/graphics/win/OpenTypeUtilities.cpp, but should I put it into somewhere else?
> 
> [1] https://bugs.webkit.org/show_bug.cgi?id=51584
> [2] https://bugs.webkit.org/show_bug.cgi?id=50619
> [3] https://bugs.webkit.org/show_bug.cgi?id=69282
> [4] https://bugs.webkit.org/show_bug.cgi?id=51450
> 
> -----
> From: ryosuke.niwa at gmail.com [mailto:ryosuke.niwa at gmail.com] On Behalf 
> Of Ryosuke Niwa
> Sent: Saturday, February 25, 2012 5:20 AM
> To: Koji Ishii
> Cc: webkit-dev at lists.webkit.org
> Subject: Re: [webkit-dev] 48459: Glyphs in vertical text tests are 
> rotated 90 degrees clockwise on Windows
> 
> On Fri, Feb 24, 2012 at 12:14 PM, Koji Ishii <kojiishi at gluesoft.co.jp> wrote:
> I was looking into bug 48459: "Glyphs in vertical text tests are rotated 90 degrees clockwise on Windows"
> https://bugs.webkit.org/show_bug.cgi?id=48459
> 
> and found that it has two issues:
> 
> 1. It does not support text-orientation[1] property as OS X does.
> 
> 2. It uses @-font, which lets Windows do a magic to rotate some code points and apply 'vert' automatically. But that means WebKit has no control over the glyph orientations, and therefore orientation of some code points don't match to the one on OS X.
> 
> I think the correct fix for the bug is to port showGlyphsWithAdvances from FontMac.mm to FontCGWin.cpp.
> 
> But I then encounter an issue that WebKitLibraries does not support CTFontGetVerticalTranslationsForGlyphs API.
> 
> Since Windows doesn't have such API, possible options I can think of are:
> 
> 1. Bring the CTFontGetVerticalTranslationsForGlyphs API to WebKitLibraries.
> 2. Use other libraries such as FreeType[2] to read related OpenType tables.
> 3. Read raw tables using GetFontData Win32 API and parse vhea/vorg/vmtx tables etc.
> 
> Option 3 seems most desirable since it doesn't introduce new dependencies. 
> 
> - Ryosuke
> 
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

_______________________________________________
webkit-dev mailing list
webkit-dev at lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


More information about the webkit-dev mailing list