michael@0: /* michael@0: * Copyright 2011 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef SKFONTCONFIGPARSER_ANDROID_H_ michael@0: #define SKFONTCONFIGPARSER_ANDROID_H_ michael@0: michael@0: #include "SkTypes.h" michael@0: michael@0: #include "SkPaintOptionsAndroid.h" michael@0: #include "SkString.h" michael@0: #include "SkTDArray.h" michael@0: michael@0: struct FontFileInfo { michael@0: FontFileInfo() : fFileName(NULL) {} michael@0: michael@0: const char* fFileName; michael@0: SkPaintOptionsAndroid fPaintOptions; michael@0: }; michael@0: michael@0: /** michael@0: * The FontFamily data structure is created during parsing and handed back to michael@0: * Skia to fold into its representation of font families. fNames is the list of michael@0: * font names that alias to a font family. fontFileArray is the list of information michael@0: * about each file. Order is the priority order for the font. This is michael@0: * used internally to determine the order in which to place fallback fonts as michael@0: * they are read from the configuration files. michael@0: */ michael@0: struct FontFamily { michael@0: FontFamily() : fIsFallbackFont(false), order(-1) {} michael@0: michael@0: SkTDArray fNames; michael@0: SkTDArray fFontFiles; michael@0: bool fIsFallbackFont; michael@0: int order; // only used internally by SkFontConfigParser michael@0: }; michael@0: michael@0: namespace SkFontConfigParser { michael@0: michael@0: /** michael@0: * Parses all system font configuration files and returns the results in an michael@0: * array of FontFamily structures. michael@0: */ michael@0: void GetFontFamilies(SkTDArray &fontFamilies); michael@0: michael@0: /** michael@0: * Parses all test font configuration files and returns the results in an michael@0: * array of FontFamily structures. michael@0: */ michael@0: void GetTestFontFamilies(SkTDArray &fontFamilies, michael@0: const char* testMainConfigFile, michael@0: const char* testFallbackConfigFile); michael@0: michael@0: SkString GetLocale(); michael@0: michael@0: } // SkFontConfigParser namespace michael@0: michael@0: #endif /* SKFONTCONFIGPARSER_ANDROID_H_ */