aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPaintPriv.cpp
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2018-02-20 09:57:58 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-20 20:40:23 +0000
commit5423f1f0c59b43b09ac216966b6af12f08955be7 (patch)
tree2cfa18baf8e61a4e849c235e29ae7e561bd4a29c /src/core/SkPaintPriv.cpp
parentee78dbe529d91d002b5b6f3889867791860736ba (diff)
Correct font metrics, bitmap glyph metrics and underline.
Correct ScaleFontMetrics to scale all of the metrics. Also update the test fonts, since they were created with the previously unscaled metrics. Fix the ascent, descent, and underline position for bitmap glyphs with FreeType. Change-Id: I8c2f6e9d6a7e86b0bb08dc619f62ffcce4ad2df2 Reviewed-on: https://skia-review.googlesource.com/108600 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Hal Canary <halcanary@google.com>
Diffstat (limited to 'src/core/SkPaintPriv.cpp')
-rw-r--r--src/core/SkPaintPriv.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/SkPaintPriv.cpp b/src/core/SkPaintPriv.cpp
index ad361a23c1..9cd5e4708d 100644
--- a/src/core/SkPaintPriv.cpp
+++ b/src/core/SkPaintPriv.cpp
@@ -63,11 +63,15 @@ void SkPaintPriv::ScaleFontMetrics(SkPaint::FontMetrics* metrics, SkScalar scale
metrics->fBottom *= scale;
metrics->fLeading *= scale;
metrics->fAvgCharWidth *= scale;
+ metrics->fMaxCharWidth *= scale;
metrics->fXMin *= scale;
metrics->fXMax *= scale;
metrics->fXHeight *= scale;
+ metrics->fCapHeight *= scale;
metrics->fUnderlineThickness *= scale;
metrics->fUnderlinePosition *= scale;
+ metrics->fStrikeoutThickness *= scale;
+ metrics->fStrikeoutPosition *= scale;
}
bool SkPaintPriv::ShouldDither(const SkPaint& p, SkColorType dstCT) {