diff options
author | 2011-02-24 16:28:51 +0000 | |
---|---|---|
committer | 2011-02-24 16:28:51 +0000 | |
commit | 7b34ea61cea33e8790d4b2bd48a4e9c0bba066cd (patch) | |
tree | b1bb86b335ca42fc1fd0db5c90ec7e7aa07ef496 /src/ports | |
parent | 02878b844c5cd3f17d48842da3ccf44a66621501 (diff) |
Upstreaming code from android repository.
* fix for png decoder
* clean up for SkFontHost
reviewed by reed@google.com
git-svn-id: http://skia.googlecode.com/svn/trunk@847 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/ports')
-rw-r--r-- | src/ports/SkFontHost_FreeType.cpp | 4 | ||||
-rw-r--r-- | src/ports/SkFontHost_android.cpp | 15 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp index c1720cccca..1a22972bb2 100644 --- a/src/ports/SkFontHost_FreeType.cpp +++ b/src/ports/SkFontHost_FreeType.cpp @@ -1248,7 +1248,7 @@ SkTypeface::Style find_name_and_attributes(SkStream* stream, SkString* name, bool* isFixedWidth) { FT_Library library; if (FT_Init_FreeType(&library)) { - name->set(NULL); + name->reset(); return SkTypeface::kNormal; } @@ -1276,7 +1276,7 @@ SkTypeface::Style find_name_and_attributes(SkStream* stream, SkString* name, FT_Face face; if (FT_Open_Face(library, &args, 0, &face)) { FT_Done_FreeType(library); - name->set(NULL); + name->reset(); return SkTypeface::kNormal; } diff --git a/src/ports/SkFontHost_android.cpp b/src/ports/SkFontHost_android.cpp index 2c31dacd97..d01577d695 100644 --- a/src/ports/SkFontHost_android.cpp +++ b/src/ports/SkFontHost_android.cpp @@ -426,6 +426,8 @@ static const FontInitRec gSystemFonts[] = { { "DroidSansArabic.ttf", gFBNames }, { "DroidSansHebrew.ttf", gFBNames }, { "DroidSansThai.ttf", gFBNames }, + { "MTLmr3m.ttf", gFBNames }, // Motoya Japanese Font + { "MTLc3m.ttf", gFBNames }, // Motoya Japanese Font { "DroidSansJapanese.ttf", gFBNames }, { "DroidSansFallback.ttf", gFBNames } }; @@ -590,13 +592,6 @@ SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace, return tf; } -// static -SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics( - uint32_t fontID, bool perGlyphInfo) { - SkASSERT(!"SkFontHost::GetAdvancedTypefaceMetrics unimplemented"); - return NULL; -} - bool SkFontHost::ValidFontID(uint32_t fontID) { SkAutoMutexAcquire ac(gFamilyMutex); @@ -665,7 +660,11 @@ SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { SkString name; SkTypeface::Style style = find_name_and_attributes(stream, &name, &isFixedWidth); - return SkNEW_ARGS(StreamTypeface, (style, false, NULL, stream, isFixedWidth)); + if (!name.isEmpty()) { + return SkNEW_ARGS(StreamTypeface, (style, false, NULL, stream, isFixedWidth)); + } else { + return NULL; + } } SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) { |