Improve usability of SkAdvancedTypefaceMetrics for non PDF cases.

Change the code to fill out the metrics even if the font isn't embeddable. Previously, if the font wasn't embeddable, the code would set the type to not embeddable and return without filling out the rest of the metrics.

Review URL: http://codereview.appspot.com/3973053

git-svn-id: http://skia.googlecode.com/svn/trunk@758 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index fd6af07..1b1d47b 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -449,9 +449,7 @@
 
     bool cid = false;
     const char* fontType = FT_Get_X11_Font_Format(face);
-    if (!canEmbed(face)) {
-        info->fType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font;
-    } else if (strcmp(fontType, "Type 1") == 0) {
+    if (strcmp(fontType, "Type 1") == 0) {
         info->fType = SkAdvancedTypefaceMetrics::kType1_Font;
     } else if (strcmp(fontType, "CID Type 1") == 0) {
         info->fType = SkAdvancedTypefaceMetrics::kType1CID_Font;
@@ -468,12 +466,6 @@
         }
     }
 
-    if (info->fType == SkAdvancedTypefaceMetrics::kOther_Font ||
-            info->fType == SkAdvancedTypefaceMetrics::kNotEmbeddable_Font ||
-            !FT_IS_SCALABLE(face)) {
-        perGlyphInfo = false;
-    }
-
     SkASSERT(!FT_HAS_VERTICAL(face));
 #ifdef FT_IS_CID_KEYED
     SkASSERT(FT_IS_CID_KEYED(face) ==
@@ -550,7 +542,8 @@
     info->fBBox = SkIRect::MakeLTRB(face->bbox.xMin, face->bbox.yMax,
                                     face->bbox.xMax, face->bbox.yMin);
 
-    if (perGlyphInfo) {
+    if (perGlyphInfo && canEmbed(face) && FT_IS_SCALABLE(face) &&
+            info->fType != SkAdvancedTypefaceMetrics::kOther_Font) {
         if (FT_IS_FIXED_WIDTH(face)) {
             appendRange(&info->fGlyphWidths, 0);
             int16_t advance = face->max_advance_width;
@@ -592,6 +585,9 @@
         }
     }
 
+    if (!canEmbed(face))
+        info->fType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font;
+
     unref_ft_face(face);
     return info;
 }