Index: src/ports/SkFontMgr_android.cpp |
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp |
index 88045a4b2024a7819892a43d95e0ba11ca31bf10..45c787a930220974d885f7c36908c04849121c4f 100644 |
--- a/src/ports/SkFontMgr_android.cpp |
+++ b/src/ports/SkFontMgr_android.cpp |
@@ -12,6 +12,7 @@ |
#include "SkFontMgr_android.h" |
#include "SkFontMgr_android_parser.h" |
#include "SkFontStyle.h" |
+#include "SkPaint.h" |
#include "SkRefCnt.h" |
#include "SkString.h" |
#include "SkStream.h" |
@@ -19,7 +20,6 @@ |
#include "SkTDArray.h" |
#include "SkTSearch.h" |
#include "SkTemplates.h" |
-#include "SkTypeface.h" |
#include "SkTypefaceCache.h" |
#include <limits> |
@@ -407,7 +407,13 @@ protected: |
continue; |
} |
- if (face->charsToGlyphs(&character, SkTypeface::kUTF32_Encoding, NULL, 0)) { |
+ SkPaint paint; |
+ paint.setTypeface(face); |
+ paint.setTextEncoding(SkPaint::kUTF32_TextEncoding); |
+ |
+ uint16_t glyphID; |
+ paint.textToGlyphs(&character, sizeof(character), &glyphID); |
+ if (glyphID != 0) { |
return face.detach(); |
} |
} |