diff options
author | Ben Wagner <bungeman@google.com> | 2017-11-07 15:47:01 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-11-08 15:01:16 +0000 |
commit | 1e26ba9e966b219005dc05e031f47457ae604cd3 (patch) | |
tree | 9be0ce1825b8daf004e73d636e5159218913f620 /gm | |
parent | 821ef188b34c03e531b138423f6bf8d54fbde736 (diff) |
Glyphs without paths don't draw with paths.
If a glyph doesn't have a path, don't try to draw it from the
non-existent path.
Bug: skia:4904
Change-Id: I8d7a061146b54c2f4a975280a6fb6ae3043ea82b
Reviewed-on: https://skia-review.googlesource.com/68216
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'gm')
-rw-r--r-- | gm/coloremoji.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gm/coloremoji.cpp b/gm/coloremoji.cpp index 7626f9a071..59db9a0fc2 100644 --- a/gm/coloremoji.cpp +++ b/gm/coloremoji.cpp @@ -84,12 +84,15 @@ protected: constexpr SkScalar textSizes[] = { 10, 30, 50, }; SkPaint::FontMetrics metrics; SkScalar y = 0; - for (const SkScalar& textSize : textSizes) { - paint.setTextSize(textSize); - paint.getFontMetrics(&metrics); - y += -metrics.fAscent; - canvas->drawString(text, 10, y, paint); - y += metrics.fDescent + metrics.fLeading; + for (const bool& fakeBold : { false, true }) { + paint.setFakeBoldText(fakeBold); + for (const SkScalar& textSize : textSizes) { + paint.setTextSize(textSize); + paint.getFontMetrics(&metrics); + y += -metrics.fAscent; + canvas->drawString(text, 10, y, paint); + y += metrics.fDescent + metrics.fLeading; + } } y += 20; |