CTFontManagerCopyAvailableFontFamilyNames is not always available (on iOS)
so write a wrapper for it.

fixes iOS build



git-svn-id: http://skia.googlecode.com/svn/trunk@8406 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index d204b13..2b24109 100755
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -13,6 +13,7 @@
 
 #ifdef SK_BUILD_FOR_IOS
 #include <CoreText/CoreText.h>
+#include <CoreText/CTFontManager.h>
 #include <CoreGraphics/CoreGraphics.h>
 #include <CoreFoundation/CoreFoundation.h>
 #endif
@@ -44,6 +45,17 @@
 
 class SkScalerContext_Mac;
 
+// CTFontManagerCopyAvailableFontFamilyNames() is not always available, so we
+// provide a wrapper here that will return an empty array if need be.
+static CFArrayRef SkCTFontManagerCopyAvailableFontFamilyNames() {
+#ifdef SK_BUILD_FOR_IOS
+    return CFArrayCreate(NULL, NULL, 0, NULL);
+#else
+    return CTFontManagerCopyAvailableFontFamilyNames();
+#endif
+}
+
+
 // Being templated and taking const T* prevents calling
 // CFSafeRelease(autoCFRelease) through implicit conversion.
 template <typename T> static void CFSafeRelease(/*CFTypeRef*/const T* cfTypeRef) {
@@ -1998,7 +2010,7 @@
 
     void lazyInit() {
         if (NULL == fNames) {
-            fNames = CTFontManagerCopyAvailableFontFamilyNames();
+            fNames = SkCTFontManagerCopyAvailableFontFamilyNames();
             fCount = fNames ? CFArrayGetCount(fNames) : 0;
         }
     }