Flutter Engine
The Flutter Engine
|
#include "include/core/SkFontMgr.h"
#include "include/core/SkStream.h"
#include "include/private/base/SkFixed.h"
#include "include/private/base/SkMalloc.h"
#include "include/private/base/SkTDArray.h"
#include "include/private/base/SkTLogic.h"
#include "include/private/base/SkTemplates.h"
#include "src/base/SkTSearch.h"
#include "src/core/SkOSFile.h"
#include "src/ports/SkFontMgr_android_parser.h"
#include <expat.h>
#include <stdlib.h>
#include <string.h>
#include <memory>
Go to the source code of this file.
Classes | |
struct | TagHandler |
struct | FamilyData |
Namespaces | |
namespace | lmpParser |
namespace | jbParser |
Macros | |
#define | LMP_SYSTEM_FONTS_FILE "/system/etc/fonts.xml" |
#define | OLD_SYSTEM_FONTS_FILE "/system/etc/system_fonts.xml" |
#define | FALLBACK_FONTS_FILE "/system/etc/fallback_fonts.xml" |
#define | VENDOR_FONTS_FILE "/vendor/etc/fallback_fonts.xml" |
#define | LOCALE_FALLBACK_FONTS_SYSTEM_DIR "/system/etc" |
#define | LOCALE_FALLBACK_FONTS_VENDOR_DIR "/vendor/etc" |
#define | LOCALE_FALLBACK_FONTS_PREFIX "fallback_fonts-" |
#define | LOCALE_FALLBACK_FONTS_SUFFIX ".xml" |
#define | SK_FONT_FILE_PREFIX "/fonts/" |
#define | MEMEQ(c, s, n) memeq(c, s, sizeof(c) - 1, n) |
#define | ATTS_NON_NULL(a, i) (a[i] != nullptr && a[i+1] != nullptr) |
#define | SK_FONTMGR_ANDROID_PARSER_PREFIX "[SkFontMgr Android Parser] " |
#define | SK_FONTCONFIGPARSER_WARNING(message, ...) |
Functions | |
static bool | memeq (const char *s1, const char *s2, size_t n1, size_t n2) |
static bool | is_whitespace (char c) |
static void | trim_string (SkString *s) |
static void | parse_space_separated_languages (const char *value, size_t valueLen, TArray< SkLanguage, true > &languages) |
static FontFamily * | lmpParser::find_family (FamilyData *self, const SkString &familyName) |
static void XMLCALL | start_element_handler (void *data, const char *tag, const char **attributes) |
static void XMLCALL | end_element_handler (void *data, const char *tag) |
static void XMLCALL | xml_entity_decl_handler (void *data, const XML_Char *entityName, int is_parameter_entity, const XML_Char *value, int value_length, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName) |
static int | parse_config_file (const char *filename, SkTDArray< FontFamily * > &families, const SkString &basePath, bool isFallback) |
static int | append_system_font_families (SkTDArray< FontFamily * > &fontFamilies, const SkString &basePath) |
static void | append_fallback_font_families_for_locale (SkTDArray< FontFamily * > &fallbackFonts, const char *dir, const SkString &basePath) |
static void | append_system_fallback_font_families (SkTDArray< FontFamily * > &fallbackFonts, const SkString &basePath) |
static void | mixin_vendor_fallback_font_families (SkTDArray< FontFamily * > &fallbackFonts, const SkString &basePath) |
Variables | |
static const TagHandler | lmpParser::axisHandler |
static const TagHandler | lmpParser::fontHandler |
static const TagHandler | lmpParser::familyHandler |
static const TagHandler | lmpParser::aliasHandler |
static const TagHandler | lmpParser::familySetHandler |
static const TagHandler | jbParser::fileHandler |
static const TagHandler | jbParser::fileSetHandler |
static const TagHandler | jbParser::nameHandler |
static const TagHandler | jbParser::nameSetHandler |
static const TagHandler | jbParser::familyHandler |
static const TagHandler | jbParser::familySetHandler |
static const TagHandler | topLevelHandler |
static const XML_Memory_Handling_Suite | sk_XML_alloc |
Definition at line 127 of file SkFontMgr_android_parser.cpp.
#define FALLBACK_FONTS_FILE "/system/etc/fallback_fonts.xml" |
Definition at line 32 of file SkFontMgr_android_parser.cpp.
#define LMP_SYSTEM_FONTS_FILE "/system/etc/fonts.xml" |
Definition at line 30 of file SkFontMgr_android_parser.cpp.
#define LOCALE_FALLBACK_FONTS_PREFIX "fallback_fonts-" |
Definition at line 37 of file SkFontMgr_android_parser.cpp.
#define LOCALE_FALLBACK_FONTS_SUFFIX ".xml" |
Definition at line 38 of file SkFontMgr_android_parser.cpp.
#define LOCALE_FALLBACK_FONTS_SYSTEM_DIR "/system/etc" |
Definition at line 35 of file SkFontMgr_android_parser.cpp.
#define LOCALE_FALLBACK_FONTS_VENDOR_DIR "/vendor/etc" |
Definition at line 36 of file SkFontMgr_android_parser.cpp.
Definition at line 125 of file SkFontMgr_android_parser.cpp.
#define OLD_SYSTEM_FONTS_FILE "/system/etc/system_fonts.xml" |
Definition at line 31 of file SkFontMgr_android_parser.cpp.
#define SK_FONT_FILE_PREFIX "/fonts/" |
Definition at line 41 of file SkFontMgr_android_parser.cpp.
#define SK_FONTCONFIGPARSER_WARNING | ( | message, | |
... | |||
) |
Definition at line 131 of file SkFontMgr_android_parser.cpp.
#define SK_FONTMGR_ANDROID_PARSER_PREFIX "[SkFontMgr Android Parser] " |
Definition at line 129 of file SkFontMgr_android_parser.cpp.
#define VENDOR_FONTS_FILE "/vendor/etc/fallback_fonts.xml" |
Definition at line 33 of file SkFontMgr_android_parser.cpp.
|
static |
In some versions of Android prior to Android 4.2 (JellyBean MR1 at API Level 17) the fallback fonts for certain locales were encoded in their own XML files with a suffix that identified the locale. We search the provided directory for those files,add all of their entries to the fallback chain, and include the locale as part of each entry.
Definition at line 722 of file SkFontMgr_android_parser.cpp.
|
static |
Definition at line 760 of file SkFontMgr_android_parser.cpp.
|
static |
Returns the version of the system font file actually found, negative if none.
Definition at line 704 of file SkFontMgr_android_parser.cpp.
|
static |
Definition at line 601 of file SkFontMgr_android_parser.cpp.
|
static |
Definition at line 138 of file SkFontMgr_android_parser.cpp.
|
static |
Definition at line 122 of file SkFontMgr_android_parser.cpp.
|
static |
Definition at line 769 of file SkFontMgr_android_parser.cpp.
|
static |
This function parses the given filename and stores the results in the given families array. Returns the version of the file, negative if the file does not exist.
Definition at line 647 of file SkFontMgr_android_parser.cpp.
|
static |
Definition at line 157 of file SkFontMgr_android_parser.cpp.
|
static |
Definition at line 579 of file SkFontMgr_android_parser.cpp.
|
static |
Definition at line 142 of file SkFontMgr_android_parser.cpp.
|
static |
Definition at line 622 of file SkFontMgr_android_parser.cpp.
|
static |
Definition at line 637 of file SkFontMgr_android_parser.cpp.
|
static |
Definition at line 553 of file SkFontMgr_android_parser.cpp.