Commit 83ff1e35 authored by mitz@apple.com's avatar mitz@apple.com

<rdar://problem/10475450> Synthetic bold is illegible under some scaling transforms

https://bugs.webkit.org/show_bug.cgi?id=78044

Reviewed by Beth Dakin.

Source/WebCore: 

Tests: fast/text/synthetic-bold-transformed-expected.html
       fast/text/synthetic-bold-transformed.html

* platform/graphics/mac/FontMac.mm:
(WebCore::Font::drawGlyphs): Changed to interpret syntheticBoldOffset as a length in device pixels.

LayoutTests: 

* fast/text/synthetic-bold-transformed-expected.html: Added.
* fast/text/synthetic-bold-transformed.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 41b8dda2
2012-02-07 Dan Bernstein <mitz@apple.com>
<rdar://problem/10475450> Synthetic bold is illegible under some scaling transforms
https://bugs.webkit.org/show_bug.cgi?id=78044
Reviewed by Beth Dakin.
* fast/text/synthetic-bold-transformed-expected.html: Added.
* fast/text/synthetic-bold-transformed.html: Added.
2012-02-07 Adam Klein <adamk@chromium.org>
Add JSC support for delivering mutations when the outermost script context exits
<div style="position: relative;">
<div style="-webkit-transform-origin: 0 0; -webkit-transform: scale(8); font-family: STSong;">|</div>
<div style="position: absolute; top: 0; -webkit-transform-origin: 0 0; -webkit-transform: translatex(1px) scale(8); font-family: STSong;">|</div>
</div>
<div style="-webkit-transform-origin: 0 0; -webkit-transform: scale(8); font-family: STSong; font-weight: bold;">|</div>
2012-02-07 Dan Bernstein <mitz@apple.com>
<rdar://problem/10475450> Synthetic bold is illegible under some scaling transforms
https://bugs.webkit.org/show_bug.cgi?id=78044
Reviewed by Beth Dakin.
Tests: fast/text/synthetic-bold-transformed-expected.html
fast/text/synthetic-bold-transformed.html
* platform/graphics/mac/FontMac.mm:
(WebCore::Font::drawGlyphs): Changed to interpret syntheticBoldOffset as a length in device pixels.
2012-02-07 Levi Weintraub <leviw@chromium.org>
Update LayoutUnit usage in ColumnInfo and RenderFrameSet
......@@ -222,7 +222,16 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
ColorSpace fillColorSpace = context->fillColorSpace();
context->getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
bool hasSimpleShadow = context->textDrawingMode() == TextModeFill && shadowColor.isValid() && !shadowBlur && !platformData.isColorBitmapFont() && (!context->shadowsIgnoreTransforms() || context->getCTM().isIdentityOrTranslationOrFlipped()) && !context->isInTransparencyLayer();
AffineTransform contextCTM = context->getCTM();
float syntheticBoldOffset = font->syntheticBoldOffset();
if (syntheticBoldOffset && !contextCTM.isIdentityOrTranslationOrFlipped()) {
FloatSize horizontalUnitSizeInDevicePixels = contextCTM.mapSize(FloatSize(1, 0));
float horizontalUnitLengthInDevicePixels = sqrtf(horizontalUnitSizeInDevicePixels.width() * horizontalUnitSizeInDevicePixels.width() + horizontalUnitSizeInDevicePixels.height() * horizontalUnitSizeInDevicePixels.height());
if (horizontalUnitLengthInDevicePixels)
syntheticBoldOffset /= horizontalUnitLengthInDevicePixels;
};
bool hasSimpleShadow = context->textDrawingMode() == TextModeFill && shadowColor.isValid() && !shadowBlur && !platformData.isColorBitmapFont() && (!context->shadowsIgnoreTransforms() || contextCTM.isIdentityOrTranslationOrFlipped()) && !context->isInTransparencyLayer();
if (hasSimpleShadow) {
// Paint simple shadows ourselves instead of relying on CG shadows, to avoid losing subpixel antialiasing.
context->clearShadow();
......@@ -233,14 +242,14 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
// If shadows are ignoring transforms, then we haven't applied the Y coordinate flip yet, so down is negative.
float shadowTextY = point.y() + shadowOffset.height() * (context->shadowsIgnoreTransforms() ? -1 : 1);
showGlyphsWithAdvances(FloatPoint(shadowTextX, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
if (font->syntheticBoldOffset())
showGlyphsWithAdvances(FloatPoint(shadowTextX + font->syntheticBoldOffset(), shadowTextY), font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
if (syntheticBoldOffset)
showGlyphsWithAdvances(FloatPoint(shadowTextX + syntheticBoldOffset, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
context->setFillColor(fillColor, fillColorSpace);
}
showGlyphsWithAdvances(point, font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
if (font->syntheticBoldOffset())
showGlyphsWithAdvances(FloatPoint(point.x() + font->syntheticBoldOffset(), point.y()), font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
if (syntheticBoldOffset)
showGlyphsWithAdvances(FloatPoint(point.x() + syntheticBoldOffset, point.y()), font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
if (hasSimpleShadow)
context->setShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
......
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