Index: src/ports/SkFontHost_FreeType.cpp |
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp |
index fe32ebb42a7fe33c7e7758738cc40f26f7afaa8d..935f353208244f66572d3dfb435ab73e6e505349 100644 |
--- a/src/ports/SkFontHost_FreeType.cpp |
+++ b/src/ports/SkFontHost_FreeType.cpp |
@@ -1384,6 +1384,7 @@ void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* mx, |
// pull from format-specific metrics as needed |
SkScalar ascent, descent, leading, xmin, xmax, ymin, ymax; |
+ SkScalar underlineThickness, underlinePosition; |
if (face->face_flags & FT_FACE_FLAG_SCALABLE) { // scalable outline font |
ascent = -SkIntToScalar(face->ascender) / upem; |
descent = -SkIntToScalar(face->descender) / upem; |
@@ -1392,6 +1393,8 @@ void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* mx, |
xmax = SkIntToScalar(face->bbox.xMax) / upem; |
ymin = -SkIntToScalar(face->bbox.yMin) / upem; |
ymax = -SkIntToScalar(face->bbox.yMax) / upem; |
+ underlineThickness = SkIntToScalar(face->underline_thickness) / upem; |
+ underlinePosition = SkIntToScalar(face->underline_position) / upem; |
// we may be able to synthesize x_height and cap_height from outline |
if (!x_height) { |
FT_BBox bbox; |
@@ -1416,6 +1419,8 @@ void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* mx, |
xmax = SkIntToScalar(face->available_sizes[fStrikeIndex].width) / xppem; |
ymin = descent + leading; |
ymax = ascent - descent; |
+ underlineThickness = 0; |
bungeman-skia
2014/02/17 19:10:06
Here is where the 'unknown' flag should be set (or
h.joshi
2014/02/18 05:48:48
Okey, will make required changes.
On 2014/02/17 1
|
+ underlinePosition = 0; |
} else { |
goto ERROR; |
} |
@@ -1447,6 +1452,8 @@ void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* mx, |
mx->fXMax = xmax; |
mx->fXHeight = x_height; |
mx->fCapHeight = cap_height; |
+ mx->fUnderlineThickness = underlineThickness; |
+ mx->fUnderlinePosition = underlinePosition; |
} |
if (my) { |
my->fTop = ymax * myy; |
@@ -1459,6 +1466,8 @@ void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* mx, |
my->fXMax = xmax; |
my->fXHeight = x_height; |
my->fCapHeight = cap_height; |
+ my->fUnderlineThickness = underlineThickness; |
+ my->fUnderlinePosition = underlinePosition; |
} |
} |