Commit 34f0b731 authored by hyatt@apple.com's avatar hyatt@apple.com

https://bugs.webkit.org/show_bug.cgi?id=56129, vertical text broken on Lion and Leopard.

Reviewed by Dan Bernstein.

Add Snow Leopard ifdefs for the scaling by point size and then the division by unitsPerEm to the
translationsTransform applied to the results from CTFontGetVerticalTranslationsForGlyphs, since
this is done already on Lion and Leopard.

* platform/graphics/mac/FontMac.mm:
(WebCore::showGlyphsWithAdvances):



git-svn-id: svn://svn.chromium.org/blink/trunk@80740 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent bc0396fb
2011-03-10 David Hyatt <hyatt@apple.com>
Reviewed by Dan Bernstein.
https://bugs.webkit.org/show_bug.cgi?id=56129, vertical text broken on Lion and Leopard.
Add Snow Leopard ifdefs for the scaling by point size and then the division by unitsPerEm to the
translationsTransform applied to the results from CTFontGetVerticalTranslationsForGlyphs, since
this is done already on Lion and Leopard.
* platform/graphics/mac/FontMac.mm:
(WebCore::showGlyphsWithAdvances):
2011-03-10 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r80701.
......
......@@ -66,11 +66,17 @@ static void showGlyphsWithAdvances(const FloatPoint& point, const SimpleFontData
CGAffineTransform runMatrix = CGAffineTransformConcat(savedMatrix, rotateLeftTransform);
CGContextSetTextMatrix(context, runMatrix);
#if defined(BUILDING_ON_SNOW_LEOPARD)
// CTFontGetVerticalTranslationsForGlyphs is different on Snow Leopard. It returns values for a font-size of 1
// without unitsPerEm applied. We have to apply a transform that scales up to the point size and that also
// divides by unitsPerEm.
CGAffineTransform translationsTransform = CGAffineTransformMake(platformData.m_size, 0, 0, platformData.m_size, 0, 0);
translationsTransform = CGAffineTransformConcat(translationsTransform, rotateLeftTransform);
CGFloat unitsPerEm = CGFontGetUnitsPerEm(platformData.cgFont());
translationsTransform = CGAffineTransformConcat(translationsTransform, CGAffineTransformMakeScale(1 / unitsPerEm, 1 / unitsPerEm));
#else
CGAffineTransform translationsTransform = rotateLeftTransform;
#endif
Vector<CGSize, 256> translations(count);
CTFontGetVerticalTranslationsForGlyphs(platformData.ctFont(), glyphs, translations.data(), count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment