aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontHost_mac.cpp
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2014-09-24 11:04:41 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-24 11:04:41 -0700
commit7b09aab7130c174c6a2dd4becedbddaa6cf7945d (patch)
tree9c618e8db4d27b6a871e290491b912de55778192 /src/ports/SkFontHost_mac.cpp
parent2456b7681aea8d91072186b17f8209955846f2f7 (diff)
Correct glyph with non-bmp from typeface on Mac.
CTFontGetGlyphsForChars puts the glyph id at the index of the lead surrogate as is documented in comments, but the code is looking at the index of the trail surrogate. BUG=skia:2960 R=mtklein@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/596413002
Diffstat (limited to 'src/ports/SkFontHost_mac.cpp')
-rwxr-xr-xsrc/ports/SkFontHost_mac.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 5386ac3f3e..aae7464e25 100755
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -1981,10 +1981,10 @@ int SkTypeface_Mac::onCharsToGlyphs(const void* chars, Encoding encoding,
if (srcCount > glyphCount) {
int extra = 0;
for (int i = 0; i < glyphCount; ++i) {
+ compactedGlyphs[i] = macGlyphs[i + extra];
if (SkUTF16_IsHighSurrogate(src[i + extra])) {
++extra;
}
- compactedGlyphs[i] = macGlyphs[i + extra];
}
}