aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ports/SkFontHost_FreeType.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index 6aa2120..d77ebb9 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -695,6 +695,13 @@ void SkFontHost::FilterRec(SkScalerContext::Rec* rec) {
#ifdef SK_BUILD_FOR_ANDROID
uint32_t SkFontHost::GetUnitsPerEm(SkFontID fontID) {
SkAutoMutexAcquire ac(gFTMutex);
+ FT_Library libInit = NULL;
+ if (gFTCount == 0) {
+ if (!InitFreetype())
+ sk_throw();
+ libInit = gFTLibrary;
+ }
+ SkAutoTCallIProc<struct FT_LibraryRec_, FT_Done_FreeType> ftLib(libInit);
SkFaceRec *rec = ref_ft_face(fontID);
uint16_t unitsPerEm = 0;