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

Side by Side Diff: src/ports/SkFontConfigParser_android.h

Issue 446473003: Parser for new fonts.xml format (Closed) Base URL: https://skia.googlesource.com/skia.git@fcparse-lmp-2
Patch Set: Complete basic implementation Created 6 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The Android Open Source Project 2 * Copyright 2011 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SKFONTCONFIGPARSER_ANDROID_H_ 8 #ifndef SKFONTCONFIGPARSER_ANDROID_H_
9 #define SKFONTCONFIGPARSER_ANDROID_H_ 9 #define SKFONTCONFIGPARSER_ANDROID_H_
10 10
11 #include "SkTypes.h" 11 #include "SkTypes.h"
12 12
13 #include "SkPaintOptionsAndroid.h" 13 #include "SkPaintOptionsAndroid.h"
14 #include "SkString.h" 14 #include "SkString.h"
15 #include "SkTDArray.h" 15 #include "SkTDArray.h"
16 16
17 struct FontFileInfo { 17 struct FontFileInfo {
18 FontFileInfo() : fIndex(0) { } 18 FontFileInfo() : fIndex(0) { }
19 19
20 SkString fFileName; 20 SkString fFileName;
21 int fIndex; 21 int fIndex;
22 SkPaintOptionsAndroid fPaintOptions; 22 SkPaintOptionsAndroid fPaintOptions;
23 int weight; // only used internally by SkFontConfigParser in LMP+
djsollen 2014/08/05 17:46:15 fWeight instead of weight. Also why is it interna
tomhudson 2014/08/05 19:35:35 Done.
23 }; 24 };
24 25
25 /** 26 /**
26 * The FontFamily data structure is created during parsing and handed back to 27 * The FontFamily data structure is created during parsing and handed back to
27 * Skia to fold into its representation of font families. fNames is the list of 28 * Skia to fold into its representation of font families. fNames is the list of
28 * font names that alias to a font family. fontFileArray is the list of informat ion 29 * font names that alias to a font family. fontFileArray is the list of informat ion
29 * about each file. Order is the priority order for the font. This is 30 * about each file. Order is the priority order for the font. This is
30 * used internally to determine the order in which to place fallback fonts as 31 * used internally to determine the order in which to place fallback fonts as
31 * they are read from the configuration files. 32 * they are read from the configuration files.
32 */ 33 */
33 struct FontFamily { 34 struct FontFamily {
34 FontFamily() : fIsFallbackFont(false), order(-1) {} 35 FontFamily() : fIsFallbackFont(false), order(-1),
36 variant(SkPaintOptionsAndroid::kDefault_Variant) {}
35 37
36 SkTArray<SkString> fNames; 38 SkTArray<SkString> fNames;
37 SkTArray<FontFileInfo> fFontFiles; 39 SkTArray<FontFileInfo> fFontFiles;
40 SkString language; // only used internally by SkFontConfigParser in LMP+
djsollen 2014/08/05 17:46:15 If we made this an SkLanguage param then I don't s
tomhudson 2014/08/05 19:35:35 PS2 has fLanguage and fVariant, but missed the SkS
38 bool fIsFallbackFont; 41 bool fIsFallbackFont;
39 int order; // only used internally by SkFontConfigParser 42 int order; // only used internally by SkFontConfigParser
43 SkPaintOptionsAndroid::FontVariant variant;
44 // only used internally by SkFontConfigParser in LMP+
40 }; 45 };
41 46
42 namespace SkFontConfigParser { 47 namespace SkFontConfigParser {
43 48
44 /** 49 /**
45 * Parses all system font configuration files and returns the results in an 50 * Parses all system font configuration files and returns the results in an
46 * array of FontFamily structures. 51 * array of FontFamily structures.
47 */ 52 */
48 void GetFontFamilies(SkTDArray<FontFamily*> &fontFamilies); 53 void GetFontFamilies(SkTDArray<FontFamily*> &fontFamilies);
49 54
50 /** 55 /**
51 * Parses all test font configuration files and returns the results in an 56 * Parses all test font configuration files and returns the results in an
52 * array of FontFamily structures. 57 * array of FontFamily structures.
53 */ 58 */
54 void GetTestFontFamilies(SkTDArray<FontFamily*> &fontFamilies, 59 void GetTestFontFamilies(SkTDArray<FontFamily*> &fontFamilies,
55 const char* testMainConfigFile, 60 const char* testMainConfigFile,
56 const char* testFallbackConfigFile); 61 const char* testFallbackConfigFile);
57 62
58 SkString GetLocale(); 63 SkString GetLocale();
59 64
60 } // SkFontConfigParser namespace 65 } // SkFontConfigParser namespace
61 66
62 #endif /* SKFONTCONFIGPARSER_ANDROID_H_ */ 67 #endif /* SKFONTCONFIGPARSER_ANDROID_H_ */
OLDNEW
« no previous file with comments | « no previous file | src/ports/SkFontConfigParser_android.cpp » ('j') | src/ports/SkFontConfigParser_android.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698