TL;DR: Why is the graphics context rotated when drawing vertical text?<div><br></div><div>Skia ports use text-on-path to draw vertical text. This is slow, and sometimes doesn't look very good, for instance when rendering fast/writing-mode/text-orientation-basic.html .</div>
<div><br></div><div>To fix this, I added vertical text support on Skia's Mac port. With the current version, you can set a flag in the paint, so that drawing a line of text goes from top to bottom instead of from left to right. Setting the font and text size to match text-orientation-basic.html causes Skia to generate identical output when compared to Safari.</div>
<div><br></div><div>Plugging this into WebKit, I was surprised that while the glyphs draw down the page, each glyph is rotated 90 degrees from what I expected. While I can fix this by rotating the graphics context one way and rotating the glyph positions the opposite way, I wonder if there's a way to avoid the rotation altogether.</div>
<div><br></div><div>From reading online commentary and the implementation in FontMac.mm, there appears to be some confusion about how to get CoreText to draw vertically. I found that it is only necessary to rotate the advance and the vertical offsets to compute the proper text metrics; the change from horizontal text drawing is minimal. You can see that here: <a href="http://codereview.appspot.com/5375053">http://codereview.appspot.com/5375053</a></div>
<div><br></div><div>The extra rotations may be a consequence of Skia on Mac using some Mac font code in a way that wasn't intended -- I just don't know where to look to find the code.</div><div><br></div><div>Thanks</div>
<div>Cary</div>