OLD | NEW |
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 SkFontMgr_android_parser_DEFINED | 8 #ifndef SkFontMgr_android_parser_DEFINED |
9 #define SkFontMgr_android_parser_DEFINED | 9 #define SkFontMgr_android_parser_DEFINED |
10 | 10 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 namespace SkFontMgr_Android_Parser { | 108 namespace SkFontMgr_Android_Parser { |
109 | 109 |
110 /** Parses system font configuration files and appends result to fontFamilies. *
/ | 110 /** Parses system font configuration files and appends result to fontFamilies. *
/ |
111 void GetSystemFontFamilies(SkTDArray<FontFamily*>& fontFamilies); | 111 void GetSystemFontFamilies(SkTDArray<FontFamily*>& fontFamilies); |
112 | 112 |
113 /** Parses font configuration files and appends result to fontFamilies. */ | 113 /** Parses font configuration files and appends result to fontFamilies. */ |
114 void GetCustomFontFamilies(SkTDArray<FontFamily*>& fontFamilies, | 114 void GetCustomFontFamilies(SkTDArray<FontFamily*>& fontFamilies, |
115 const SkString& basePath, | 115 const SkString& basePath, |
116 const char* fontsXml, | 116 const char* fontsXml, |
117 const char* fallbackFontsXml, | 117 const char* fallbackFontsXml, |
118 const char* langFallbackFontsDir = NULL); | 118 const char* langFallbackFontsDir = nullptr); |
119 | 119 |
120 } // SkFontMgr_Android_Parser namespace | 120 } // SkFontMgr_Android_Parser namespace |
121 | 121 |
122 | 122 |
123 /** Parses a null terminated string into an integer type, checking for overflow. | 123 /** Parses a null terminated string into an integer type, checking for overflow. |
124 * http://www.w3.org/TR/html-markup/datatypes.html#common.data.integer.non-nega
tive-def | 124 * http://www.w3.org/TR/html-markup/datatypes.html#common.data.integer.non-nega
tive-def |
125 * | 125 * |
126 * If the string cannot be parsed into 'value', returns false and does not chan
ge 'value'. | 126 * If the string cannot be parsed into 'value', returns false and does not chan
ge 'value'. |
127 */ | 127 */ |
128 template <typename T> static bool parse_non_negative_integer(const char* s, T* v
alue) { | 128 template <typename T> static bool parse_non_negative_integer(const char* s, T* v
alue) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 } | 209 } |
210 if (negate) { | 210 if (negate) { |
211 n = -n; | 211 n = -n; |
212 frac = -frac; | 212 frac = -frac; |
213 } | 213 } |
214 *value = (n << N) + frac; | 214 *value = (n << N) + frac; |
215 return true; | 215 return true; |
216 } | 216 } |
217 | 217 |
218 #endif /* SkFontMgr_android_parser_DEFINED */ | 218 #endif /* SkFontMgr_android_parser_DEFINED */ |
OLD | NEW |