summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/win/FontCGWin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/win/FontCGWin.cpp')
-rw-r--r--Source/WebCore/platform/graphics/win/FontCGWin.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/win/FontCGWin.cpp b/Source/WebCore/platform/graphics/win/FontCGWin.cpp
index 8012722..fe26c43 100644
--- a/Source/WebCore/platform/graphics/win/FontCGWin.cpp
+++ b/Source/WebCore/platform/graphics/win/FontCGWin.cpp
@@ -167,8 +167,12 @@ static void drawGDIGlyphs(GraphicsContext* graphicsContext, const SimpleFontData
drawIntoBitmap = true;
// We put slop into this rect, since glyphs can overflow the ascent/descent bounds and the left/right edges.
// FIXME: Can get glyphs' optical bounds (even from CG) to get this right.
- int lineGap = font->lineGap();
- textRect = IntRect(point.x() - (font->ascent() + font->descent()) / 2, point.y() - font->ascent() - lineGap, totalWidth + font->ascent() + font->descent(), font->lineSpacing());
+ const FontMetrics& fontMetrics = font->fontMetrics();
+ int lineGap = fontMetrics.lineGap();
+ textRect = IntRect(point.x() - (fontMetrics.ascent() + fontMetrics.descent()) / 2,
+ point.y() - fontMetrics.ascent() - lineGap,
+ totalWidth + fontMetrics.ascent() + fontMetrics.descent(),
+ fontMetrics.lineSpacing());
bitmap.set(graphicsContext->createWindowsBitmap(textRect.size()));
memset(bitmap->buffer(), 255, bitmap->bufferLength());
hdc = bitmap->hdc();
@@ -288,7 +292,7 @@ static void drawGDIGlyphs(GraphicsContext* graphicsContext, const SimpleFontData
buffer[i + 2] = fillColor.red();
buffer[i + 3] = alpha;
}
- graphicsContext->drawWindowsBitmap(bitmap.get(), textRect.topLeft());
+ graphicsContext->drawWindowsBitmap(bitmap.get(), textRect.location());
} else
graphicsContext->releaseWindowsContext(hdc, textRect, true, false);
}