| 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 #include "SkFontMgr_android_parser.h" | 8 #include "SkFontMgr_android_parser.h" |
| 9 #include "SkStream.h" | 9 #include "SkStream.h" |
| 10 #include "SkTDArray.h" | 10 #include "SkTDArray.h" |
| 11 #include "SkTSearch.h" | 11 #include "SkTSearch.h" |
| 12 #include "SkTypeface.h" | 12 #include "SkTemplates.h" |
| 13 | 13 |
| 14 #include <dirent.h> |
| 14 #include <expat.h> | 15 #include <expat.h> |
| 15 #include <dirent.h> | |
| 16 | 16 |
| 17 #include <stdlib.h> | 17 #include <stdlib.h> |
| 18 #include <string.h> |
| 18 | 19 |
| 19 #define LMP_SYSTEM_FONTS_FILE "/system/etc/fonts.xml" | 20 #define LMP_SYSTEM_FONTS_FILE "/system/etc/fonts.xml" |
| 20 #define OLD_SYSTEM_FONTS_FILE "/system/etc/system_fonts.xml" | 21 #define OLD_SYSTEM_FONTS_FILE "/system/etc/system_fonts.xml" |
| 21 #define FALLBACK_FONTS_FILE "/system/etc/fallback_fonts.xml" | 22 #define FALLBACK_FONTS_FILE "/system/etc/fallback_fonts.xml" |
| 22 #define VENDOR_FONTS_FILE "/vendor/etc/fallback_fonts.xml" | 23 #define VENDOR_FONTS_FILE "/vendor/etc/fallback_fonts.xml" |
| 23 | 24 |
| 24 #define LOCALE_FALLBACK_FONTS_SYSTEM_DIR "/system/etc" | 25 #define LOCALE_FALLBACK_FONTS_SYSTEM_DIR "/system/etc" |
| 25 #define LOCALE_FALLBACK_FONTS_VENDOR_DIR "/vendor/etc" | 26 #define LOCALE_FALLBACK_FONTS_VENDOR_DIR "/vendor/etc" |
| 26 #define LOCALE_FALLBACK_FONTS_PREFIX "fallback_fonts-" | 27 #define LOCALE_FALLBACK_FONTS_PREFIX "fallback_fonts-" |
| 27 #define LOCALE_FALLBACK_FONTS_SUFFIX ".xml" | 28 #define LOCALE_FALLBACK_FONTS_SUFFIX ".xml" |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 const char* tag = fTag.c_str(); | 788 const char* tag = fTag.c_str(); |
| 788 | 789 |
| 789 // strip off the rightmost "-.*" | 790 // strip off the rightmost "-.*" |
| 790 const char* parentTagEnd = strrchr(tag, '-'); | 791 const char* parentTagEnd = strrchr(tag, '-'); |
| 791 if (parentTagEnd == NULL) { | 792 if (parentTagEnd == NULL) { |
| 792 return SkLanguage(); | 793 return SkLanguage(); |
| 793 } | 794 } |
| 794 size_t parentTagLen = parentTagEnd - tag; | 795 size_t parentTagLen = parentTagEnd - tag; |
| 795 return SkLanguage(tag, parentTagLen); | 796 return SkLanguage(tag, parentTagLen); |
| 796 } | 797 } |
| OLD | NEW |