Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1015)

Unified Diff: src/ports/SkFontConfigParser_android.h

Issue 887113002: Add factory for Android font manager. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove no longer wanted function. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/ports/SkTypeface_android.h ('k') | src/ports/SkFontConfigParser_android.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « include/ports/SkTypeface_android.h ('k') | src/ports/SkFontConfigParser_android.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698