implement CreateTypefaceFromFile
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 26 Feb 2013 17:11:07 +0000 (17:11 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 26 Feb 2013 17:11:07 +0000 (17:11 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@7869 2bbb7eff-a529-9590-31e7-b0007b416f81

src/ports/SkFontHost_fontconfig.cpp

index 60f6060b64368c653ca8186799b044c9912a5d13..913d6efff61311eceb58a85bb9d248d7d532f90d 100644 (file)
@@ -187,8 +187,14 @@ SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) {
 }
 
 SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) {
-    SkASSERT(!"SkFontHost::CreateTypefaceFromFile unimplemented");
-    return NULL;
+    SkTypeface* face = NULL;
+    SkFILEStream* stream = SkNEW_ARGS(SkFILEStream, (path));
+
+    if (stream->isValid()) {
+        face = CreateTypefaceFromStream(stream);
+    }
+    stream->unref();
+    return face;
 }
 
 uint32_t SkFontHost::NextLogicalFont(SkFontID curr, SkFontID orig) {