aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontHost_mac.cpp
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2017-04-07 11:49:20 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-07 18:44:04 +0000
commit266dcb05995e2c06544c4a1456264bd9b86180f8 (patch)
tree60fc1dfadea529935edb274de8c019e66c739e16 /src/ports/SkFontHost_mac.cpp
parent40de6dad46874d03cc33a883797f20c665d7aa39 (diff)
SkTypeface:: populate_glyph_to_unicode uniformly across platforms
Change-Id: I7edce3c38b4dc0261d425c26a443df9a1f25b32e Reviewed-on: https://skia-review.googlesource.com/11786 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'src/ports/SkFontHost_mac.cpp')
-rw-r--r--src/ports/SkFontHost_mac.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index d13be5a03b..4c5added4c 100644
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -1423,8 +1423,10 @@ static void populate_glyph_to_unicode_slow(CTFontRef ctFont, CFIndex glyphCount,
while (glyphCount > 0) {
CGGlyph glyph;
if (CTFontGetGlyphsForCharacters(ctFont, &unichar, &glyph, 1)) {
- out[glyph] = unichar;
- --glyphCount;
+ if (out[glyph] != 0) {
+ out[glyph] = unichar;
+ --glyphCount;
+ }
}
if (++unichar == 0) {
break;