Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright 2011 The Android Open Source Project |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 5 | * found in the LICENSE file. |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef SKFONTCONFIGPARSER_ANDROID_H_ |
michael@0 | 9 | #define SKFONTCONFIGPARSER_ANDROID_H_ |
michael@0 | 10 | |
michael@0 | 11 | #include "SkTypes.h" |
michael@0 | 12 | |
michael@0 | 13 | #include "SkPaintOptionsAndroid.h" |
michael@0 | 14 | #include "SkString.h" |
michael@0 | 15 | #include "SkTDArray.h" |
michael@0 | 16 | |
michael@0 | 17 | struct FontFileInfo { |
michael@0 | 18 | FontFileInfo() : fFileName(NULL) {} |
michael@0 | 19 | |
michael@0 | 20 | const char* fFileName; |
michael@0 | 21 | SkPaintOptionsAndroid fPaintOptions; |
michael@0 | 22 | }; |
michael@0 | 23 | |
michael@0 | 24 | /** |
michael@0 | 25 | * The FontFamily data structure is created during parsing and handed back to |
michael@0 | 26 | * Skia to fold into its representation of font families. fNames is the list of |
michael@0 | 27 | * font names that alias to a font family. fontFileArray is the list of information |
michael@0 | 28 | * about each file. Order is the priority order for the font. This is |
michael@0 | 29 | * used internally to determine the order in which to place fallback fonts as |
michael@0 | 30 | * they are read from the configuration files. |
michael@0 | 31 | */ |
michael@0 | 32 | struct FontFamily { |
michael@0 | 33 | FontFamily() : fIsFallbackFont(false), order(-1) {} |
michael@0 | 34 | |
michael@0 | 35 | SkTDArray<const char*> fNames; |
michael@0 | 36 | SkTDArray<FontFileInfo*> fFontFiles; |
michael@0 | 37 | bool fIsFallbackFont; |
michael@0 | 38 | int order; // only used internally by SkFontConfigParser |
michael@0 | 39 | }; |
michael@0 | 40 | |
michael@0 | 41 | namespace SkFontConfigParser { |
michael@0 | 42 | |
michael@0 | 43 | /** |
michael@0 | 44 | * Parses all system font configuration files and returns the results in an |
michael@0 | 45 | * array of FontFamily structures. |
michael@0 | 46 | */ |
michael@0 | 47 | void GetFontFamilies(SkTDArray<FontFamily*> &fontFamilies); |
michael@0 | 48 | |
michael@0 | 49 | /** |
michael@0 | 50 | * Parses all test font configuration files and returns the results in an |
michael@0 | 51 | * array of FontFamily structures. |
michael@0 | 52 | */ |
michael@0 | 53 | void GetTestFontFamilies(SkTDArray<FontFamily*> &fontFamilies, |
michael@0 | 54 | const char* testMainConfigFile, |
michael@0 | 55 | const char* testFallbackConfigFile); |
michael@0 | 56 | |
michael@0 | 57 | SkString GetLocale(); |
michael@0 | 58 | |
michael@0 | 59 | } // SkFontConfigParser namespace |
michael@0 | 60 | |
michael@0 | 61 | #endif /* SKFONTCONFIGPARSER_ANDROID_H_ */ |