Index: src/ports/SkFontConfigParser_android.h |
diff --git a/src/ports/SkFontConfigParser_android.h b/src/ports/SkFontConfigParser_android.h |
index 5ce53e7777511fe3da6c7e0592c75217188d9d24..d77ca15e7acdeb5475ad1191d5069c5ea1931799 100644 |
--- a/src/ports/SkFontConfigParser_android.h |
+++ b/src/ports/SkFontConfigParser_android.h |
@@ -8,6 +8,7 @@ |
#ifndef SKFONTCONFIGPARSER_ANDROID_H_ |
#define SKFONTCONFIGPARSER_ANDROID_H_ |
+#include "SkFontMgr_android.h" |
#include "SkString.h" |
#include "SkTDArray.h" |
@@ -62,9 +63,9 @@ typedef uint32_t FontVariant; |
struct FontFileInfo { |
FontFileInfo() : fIndex(0), fWeight(0) { } |
- SkString fFileName; |
- int fIndex; |
- int fWeight; |
+ SkString fFileName; |
+ int fIndex; |
+ int fWeight; |
}; |
/** |
@@ -75,34 +76,32 @@ struct FontFileInfo { |
* Android distinguishes "fallback" fonts to support non-ASCII character sets. |
*/ |
struct FontFamily { |
- FontFamily() |
+ FontFamily(const SkString& basePath, bool isFallbackFont) |
: fVariant(kDefault_FontVariant) |
, fOrder(-1) |
- , fIsFallbackFont(false) { } |
- |
- SkTArray<SkString> fNames; |
- SkTArray<FontFileInfo> fFonts; |
- SkLanguage fLanguage; |
- FontVariant fVariant; |
- int fOrder; // internal to SkFontConfigParser |
- bool fIsFallbackFont; |
+ , fIsFallbackFont(isFallbackFont) |
+ , fBasePath(basePath) |
+ { } |
+ |
+ SkTArray<SkString> fNames; |
+ SkTArray<FontFileInfo> fFonts; |
+ SkLanguage fLanguage; |
+ FontVariant fVariant; |
+ int fOrder; // internal to SkFontConfigParser |
+ bool fIsFallbackFont; |
+ const SkString fBasePath; |
}; |
namespace SkFontConfigParser { |
-/** |
- * Parses all system font configuration files and returns the results in an |
- * array of FontFamily structures. |
- */ |
-void GetFontFamilies(SkTDArray<FontFamily*>& fontFamilies); |
+/** Parses system font configuration files and appends result to fontFamilies. */ |
+void GetSystemFontFamilies(SkTDArray<FontFamily*>& fontFamilies); |
-/** |
- * Parses all test font configuration files and returns the results in an |
- * array of FontFamily structures. |
- */ |
-void GetTestFontFamilies(SkTDArray<FontFamily*>& fontFamilies, |
- const char* testMainConfigFile, |
- const char* testFallbackConfigFile); |
+/** Parses font configuration files and appends result to fontFamilies. */ |
+void GetCustomFontFamilies(SkTDArray<FontFamily*>& fontFamilies, |
+ const SkString& basePath, |
+ const char* fontsXml, |
+ const char* fallbackFontsXml); |
} // SkFontConfigParser namespace |