#include "include/core/SkFontStyle.h"
#include "include/core/SkStream.h"
#include "include/core/SkString.h"
#include "include/core/SkTypeface.h"
#include "include/private/base/SkFixed.h"
#include "include/private/base/SkMutex.h"
#include "include/private/base/SkTArray.h"
#include "include/private/base/SkTDArray.h"
#include "include/private/base/SkTemplates.h"
#include "src/base/SkAutoMalloc.h"
#include "src/base/SkBuffer.h"
#include "src/ports/SkFontConfigInterface_direct.h"
#include <fontconfig/fontconfig.h>
#include <unistd.h>
namespace {
static SkMutex& f_c_mutex() { … }
struct FCLocker { … };
UniqueFCConfig;
}
size_t SkFontConfigInterface::FontIdentity::writeToMemory(void* addr) const { … }
size_t SkFontConfigInterface::FontIdentity::readFromMemory(const void* addr,
size_t size) { … }
#ifdef SK_DEBUG
static void make_iden(SkFontConfigInterface::FontIdentity* iden) { … }
static void test_writeToMemory(const SkFontConfigInterface::FontIdentity& iden0,
int initValue) { … }
static void fontconfiginterface_unittest() { … }
#endif
static const char* get_string(FcPattern* pattern, const char field[], int index = 0) { … }
namespace {
enum FontEquivClass
{ … };
FontEquivClass GetFontEquivClass(const char* fontname)
{ … }
bool IsMetricCompatibleReplacement(const char* font_a, const char* font_b)
{ … }
bool IsFallbackFontAllowed(const SkString& family) { … }
static int get_int(FcPattern* pattern, const char object[], int missing) { … }
static int map_range(SkScalar value,
SkScalar old_min, SkScalar old_max,
SkScalar new_min, SkScalar new_max)
{ … }
struct MapRanges { … };
static SkScalar map_ranges(SkScalar val, MapRanges const ranges[], int rangesCount) { … }
#ifndef FC_WEIGHT_DEMILIGHT
#define FC_WEIGHT_DEMILIGHT …
#endif
static SkFontStyle skfontstyle_from_fcpattern(FcPattern* pattern) { … }
static void fcpattern_from_skfontstyle(SkFontStyle style, FcPattern* pattern) { … }
}
#define kMaxFontFamilyLength …
#ifdef SK_FONT_CONFIG_INTERFACE_ONLY_ALLOW_SFNT_FONTS
const char* kFontFormatTrueType = …;
const char* kFontFormatCFF = …;
#endif
SkFontConfigInterfaceDirect::SkFontConfigInterfaceDirect(FcConfig* fc) : … { … }
SkFontConfigInterfaceDirect::~SkFontConfigInterfaceDirect() { … }
bool SkFontConfigInterfaceDirect::isAccessible(const char* filename) { … }
bool SkFontConfigInterfaceDirect::isValidPattern(FcPattern* pattern) { … }
FcPattern* SkFontConfigInterfaceDirect::MatchFont(FcFontSet* font_set,
const char* post_config_family,
const SkString& family) { … }
bool SkFontConfigInterfaceDirect::matchFamilyName(const char familyName[],
SkFontStyle style,
FontIdentity* outIdentity,
SkString* outFamilyName,
SkFontStyle* outStyle) { … }
SkStreamAsset* SkFontConfigInterfaceDirect::openStream(const FontIdentity& identity) { … }