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

Unified Diff: src/ports/SkFontHost_win_dw.cpp

Issue 152073003: Adding code to calculate Underline Thickness from Font Metrics, this will be useful when Skia is us… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixing comments for Underline Patch Created 6 years, 10 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
« include/core/SkPaint.h ('K') | « src/ports/SkFontHost_win.cpp ('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_dw.cpp
diff --git a/src/ports/SkFontHost_win_dw.cpp b/src/ports/SkFontHost_win_dw.cpp
index b9f69bdb3ca26857be1acb5dec13a829d648d05e..f68a3d0638f72c7fe9e856ea3b37fae9e80e8919 100644
--- a/src/ports/SkFontHost_win_dw.cpp
+++ b/src/ports/SkFontHost_win_dw.cpp
@@ -874,6 +874,11 @@ void SkScalerContext_DW::generateFontMetrics(SkPaint::FontMetrics* mx,
mx->fBottom = mx->fDescent;
mx->fLeading = fRec.fTextSize * SkIntToScalar(dwfm.lineGap) / upem;
mx->fXHeight = fRec.fTextSize * SkIntToScalar(dwfm.xHeight) / upem;
+ mx->fUnderlineThickness = fRec.fTextSize * SkIntToScalar(dwfm.underlinePosition) / upem;
+ mx->fUnderlinePosition = fRec.fTextSize * SkIntToScalar(dwfm.underlineThickness) / upem;
+
+ mx->validate(SkPaint::FontMetrics::kUnderlineThinknessIsValid_Flag);
+ mx->validate(SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag);
}
if (my) {
@@ -883,6 +888,11 @@ void SkScalerContext_DW::generateFontMetrics(SkPaint::FontMetrics* mx,
my->fBottom = my->fDescent;
my->fLeading = fRec.fTextSize * SkIntToScalar(dwfm.lineGap) / upem;
my->fXHeight = fRec.fTextSize * SkIntToScalar(dwfm.xHeight) / upem;
+ my->fUnderlineThickness = fRec.fTextSize * SkIntToScalar(dwfm.underlinePosition) / upem;
+ my->fUnderlinePosition = fRec.fTextSize * SkIntToScalar(dwfm.underlineThickness) / upem;
+
+ my->validate(SkPaint::FontMetrics::kUnderlineThinknessIsValid_Flag);
+ my->validate(SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag);
}
}
« include/core/SkPaint.h ('K') | « src/ports/SkFontHost_win.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698