summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
diff options
context:
space:
mode:
authorFeng Qian <fqian@google.com>2009-06-17 12:12:20 -0700
committerFeng Qian <fqian@google.com>2009-06-17 12:12:20 -0700
commit5f1ab04193ad0130ca8204aadaceae083aca9881 (patch)
tree5a92cd389e2cfe7fb67197ce14b38469462379f8 /WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
parent194315e5a908cc8ed67d597010544803eef1ac59 (diff)
downloadexternal_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.zip
external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.gz
external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.bz2
Get WebKit r44544.
Diffstat (limited to 'WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp')
-rw-r--r--WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp b/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
index 06e997f..6f5ce90 100644
--- a/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
@@ -54,11 +54,11 @@ static inline float scaleEmToUnits(float x, int unitsPerEm)
void SimpleFontData::platformInit()
{
HDC dc = GetDC(0);
- HGDIOBJ oldFont = SelectObject(dc, m_font.hfont());
+ HGDIOBJ oldFont = SelectObject(dc, m_platformData.hfont());
TEXTMETRIC textMetric = {0};
if (!GetTextMetrics(dc, &textMetric)) {
- if (ChromiumBridge::ensureFontLoaded(m_font.hfont())) {
+ if (ChromiumBridge::ensureFontLoaded(m_platformData.hfont())) {
// Retry GetTextMetrics.
// FIXME: Handle gracefully the error if this call also fails.
// See http://crbug.com/6401.
@@ -91,6 +91,11 @@ void SimpleFontData::platformInit()
ReleaseDC(0, dc);
}
+void SimpleFontData::platformCharWidthInit()
+{
+ // charwidths are set in platformInit.
+}
+
void SimpleFontData::platformDestroy()
{
// We don't hash this on Win32, so it's effectively owned by us.
@@ -102,7 +107,7 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
{
if (!m_smallCapsFontData) {
LOGFONT winFont;
- GetObject(m_font.hfont(), sizeof(LOGFONT), &winFont);
+ GetObject(m_platformData.hfont(), sizeof(LOGFONT), &winFont);
float smallCapsSize = 0.70f * fontDescription.computedSize();
// Unlike WebKit trunk, we don't multiply the size by 32. That seems
// to be some kind of artifact of their CG backend, or something.
@@ -125,13 +130,13 @@ void SimpleFontData::determinePitch()
{
// TEXTMETRICS have this. Set m_treatAsFixedPitch based off that.
HDC dc = GetDC(0);
- HGDIOBJ oldFont = SelectObject(dc, m_font.hfont());
+ HGDIOBJ oldFont = SelectObject(dc, m_platformData.hfont());
// Yes, this looks backwards, but the fixed pitch bit is actually set if the font
// is *not* fixed pitch. Unbelievable but true.
TEXTMETRIC textMetric = {0};
if (!GetTextMetrics(dc, &textMetric)) {
- if (ChromiumBridge::ensureFontLoaded(m_font.hfont())) {
+ if (ChromiumBridge::ensureFontLoaded(m_platformData.hfont())) {
// Retry GetTextMetrics.
// FIXME: Handle gracefully the error if this call also fails.
// See http://crbug.com/6401.
@@ -149,12 +154,12 @@ void SimpleFontData::determinePitch()
float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
{
HDC dc = GetDC(0);
- HGDIOBJ oldFont = SelectObject(dc, m_font.hfont());
+ HGDIOBJ oldFont = SelectObject(dc, m_platformData.hfont());
int width = 0;
if (!GetCharWidthI(dc, glyph, 1, 0, &width)) {
// Ask the browser to preload the font and retry.
- if (ChromiumBridge::ensureFontLoaded(m_font.hfont())) {
+ if (ChromiumBridge::ensureFontLoaded(m_platformData.hfont())) {
// FIXME: Handle gracefully the error if this call also fails.
// See http://crbug.com/6401.
if (!GetCharWidthI(dc, glyph, 1, 0, &width))