check-point (early) for fontmgr stuff, not called.



git-svn-id: http://skia.googlecode.com/svn/trunk/include@8377 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/ports/SkFontMgr.h b/ports/SkFontMgr.h
index b3d3813..8f1c4a6 100644
--- a/ports/SkFontMgr.h
+++ b/ports/SkFontMgr.h
@@ -22,21 +22,11 @@
     SkTypeface* createTypeface(int index) const;
 };
 
-class SkFontFamilySet : public SkRefCnt {
-public:
-    int count() const;
-    void getName(int index, SkString* familyName) const;
-    SkFontStyleSet* refStyleSet(int index) const;
-};
-
 class SkFontMgr : public SkRefCnt {
 public:
-    /**
-     *  Return a fontfamily set, which can iterate all of the font families
-     *  available to this fontmgr. The caller is responsible for calling unref()
-     *  on the returned object. Will never return NULL.
-     */
-    SkFontFamilySet* createFamilySet();
+    int countFamilies();
+    void getFamilyName(int index, SkString* familyName);
+    SkFontStyleSet* createStyleSet(int index);
 
     /**
      *  Find the closest matching typeface to the specified familyName and style
@@ -46,6 +36,8 @@
      */
     SkTypeface* matchFamilyStyle(const char familyName[], const SkFontStyle&);
 
+    SkTypeface* matchFaceStyle(const SkTypeface*, const SkFontStyle&);
+
     /**
      *  Create a typeface for the specified data and TTC index (pass 0 for none)
      *  or NULL if the data is not recognized. The caller must call unref() on
@@ -68,7 +60,30 @@
      */
     SkTypeface* createFromFile(const char path[], int ttcIndex = 0);
 
+    /**
+     *  Return a ref to the default fontmgr. The caller must call unref() on
+     *  the returned object.
+     */
+    static SkFontMgr* RefDefault();
+
+protected:
+    virtual int onCountFamilies() = 0;
+    virtual void onGetFamilyName(int index, SkString* familyName) = 0;
+    virtual SkFontStyleSet* onCreateStyleSet(int index) = 0;
+
+    virtual SkTypeface* onMatchFamilyStyle(const char familyName[],
+                                           const SkFontStyle&) = 0;
+    virtual SkTypeface* onMatchFaceStyle(const SkTypeface*,
+                                         const SkFontStyle&) = 0;
+
+    virtual SkTypeface* onCreateFromData(SkData*, int ttcIndex) = 0;
+    virtual SkTypeface* onCreateFromStream(SkStream*, int ttcIndex) = 0;
+    virtual SkTypeface* onCreateFromFile(const char path[], int ttcIndex) = 0;
+    
 private:
+    static SkFontMgr* Factory();    // implemented by porting layer
+    static SkMutex* Mutex();        // implemented by porting layer
+    
     typedef SkRefCnt INHERITED;
 };
 
diff --git a/ports/SkFontStyle.h b/ports/SkFontStyle.h
index f145a6e..1279024 100644
--- a/ports/SkFontStyle.h
+++ b/ports/SkFontStyle.h
@@ -5,8 +5,8 @@
  * found in the LICENSE file.
  */
 
-#ifndef SkFontMgr_DEFINED
-#define SkFontMgr_DEFINED
+#ifndef SkFontStyle_DEFINED
+#define SkFontStyle_DEFINED
 
 #include "SkTypes.h"