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

Unified Diff: src/ports/SkFontHost_win.cpp

Issue 17502006: Add maxCharWidth and a compile flag to use old metrics (needed by Blink). (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
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
« no previous file with comments | « include/core/SkPaint.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_win.cpp
===================================================================
--- src/ports/SkFontHost_win.cpp (revision 9701)
+++ src/ports/SkFontHost_win.cpp (working copy)
@@ -839,7 +839,9 @@
SkASSERT(fDDC);
+#ifndef SK_GDI_ALWAYS_USE_TEXTMETRICS_FOR_FONT_METRICS
if (fType == SkScalerContext_Windows::kBitmap_Type) {
+#endif
if (mx) {
mx->fTop = SkIntToScalar(-fTM.tmAscent);
mx->fAscent = SkIntToScalar(-fTM.tmAscent);
@@ -855,9 +857,15 @@
my->fBottom = SkIntToScalar(fTM.tmDescent);
my->fLeading = SkIntToScalar(fTM.tmExternalLeading);
my->fAvgCharWidth = SkIntToScalar(fTM.tmAveCharWidth);
+ my->fMaxCharWidth = SkIntToScalar(fTM.tmMaxCharWidth);
+ my->fXMin = 0;
+ my->fXMax = my->fMaxCharWidth;
+ //my->fXHeight = 0;
}
+#ifndef SK_GDI_ALWAYS_USE_TEXTMETRICS_FOR_FONT_METRICS
return;
}
+#endif
OUTLINETEXTMETRIC otm;
@@ -879,12 +887,17 @@
}
if (my) {
+#ifndef SK_GDI_ALWAYS_USE_TEXTMETRICS_FOR_FONT_METRICS
my->fTop = -fScale * otm.otmrcFontBox.top;
my->fAscent = -fScale * otm.otmAscent;
my->fDescent = -fScale * otm.otmDescent;
my->fBottom = -fScale * otm.otmrcFontBox.bottom;
my->fLeading = fScale * otm.otmLineGap;
my->fAvgCharWidth = fScale * otm.otmTextMetrics.tmAveCharWidth;
+ my->fMaxCharWidth = fScale * otm.otmTextMetrics.tmMaxCharWidth;
+ my->fXMin = fScale * otm.otmrcFontBox.left;
+ my->fXMax = fScale * otm.otmrcFontBox.right;
+#endif
my->fXHeight = fScale * otm.otmsXHeight;
}
}
« no previous file with comments | « include/core/SkPaint.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698