Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1197)

Unified Diff: Source/core/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp

Issue 17080004: Move windows specific isFixedPitch to FontPlatformData (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
diff --git a/Source/core/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp b/Source/core/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
index 535a9a573585c415a675bc0103c49856afa26845..640b5d892601f6d9c7ad0c8122064472c38d2e60 100644
--- a/Source/core/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
+++ b/Source/core/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
@@ -127,26 +127,7 @@ bool SimpleFontData::containsCharacters(const UChar* characters, int length) con
void SimpleFontData::determinePitch()
{
- // TEXTMETRICS have this. Set m_treatAsFixedPitch based off that.
- HWndDC dc(0);
- 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 (FontPlatformData::ensureFontLoaded(m_platformData.hfont())) {
- // Retry GetTextMetrics.
- // FIXME: Handle gracefully the error if this call also fails.
- // See http://crbug.com/6401.
- if (!GetTextMetrics(dc, &textMetric))
- LOG_ERROR("Unable to get the text metrics after second attempt");
- }
- }
-
- m_treatAsFixedPitch = ((textMetric.tmPitchAndFamily & TMPF_FIXED_PITCH) == 0);
-
- SelectObject(dc, oldFont);
+ m_treatAsFixedPitch = platformData().isFixedPitch();
}
FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const

Powered by Google App Engine
This is Rietveld 408576698