Home | History | Annotate | Download | only in core

Lines Matching defs:SkTypeface

17 #include "SkTypeface.h"
20 SkTypeface::SkTypeface(const SkFontStyle& style, bool isFixedPitch)
23 SkTypeface::~SkTypeface() { }
26 extern void WhitelistSerializeTypeface(const SkTypeface*, SkWStream* );
32 sk_sp<SkTypeface> (*gCreateTypefaceDelegate)(const char[], SkFontStyle) = nullptr;
34 void (*gSerializeTypefaceDelegate)(const SkTypeface*, SkWStream* ) = SK_TYPEFACE_DELEGATE;
35 sk_sp<SkTypeface> (*gDeserializeTypefaceDelegate)(SkStream* ) = nullptr;
41 class SkEmptyTypeface : public SkTypeface {
43 static sk_sp<SkTypeface> Make() { return sk_sp<SkTypeface>(new SkEmptyTypeface); }
45 SkEmptyTypeface() : SkTypeface(SkFontStyle(), true) { }
66 class EmptyLocalizedStrings : public SkTypeface::LocalizedStrings {
68 bool next(SkTypeface::LocalizedString*) override { return false; }
73 SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const override {
89 SkFontStyle SkTypeface::FromOldStyle(Style oldStyle) {
90 return SkFontStyle((oldStyle & SkTypeface::kBold) ? SkFontStyle::kBold_Weight
93 (oldStyle & SkTypeface::kItalic) ? SkFontStyle::kItalic_Slant
97 SkTypeface* SkTypeface::GetDefaultTypeface(Style style) {
99 static sk_sp<SkTypeface> defaults[4];
110 sk_sp<SkTypeface> SkTypeface::MakeDefault() {
114 uint32_t SkTypeface::UniqueID(const SkTypeface* face) {
121 bool SkTypeface::Equal(const SkTypeface* facea, const SkTypeface* faceb) {
122 return facea == faceb || SkTypeface::UniqueID(facea) == SkTypeface::UniqueID(faceb);
127 sk_sp<SkTypeface> SkTypeface::MakeFromName(const char name[],
130 sk_sp<SkTypeface> result = (*gCreateTypefaceDelegate)(name, fontStyle);
139 return sk_ref_sp(GetDefaultTypeface(static_cast<SkTypeface::Style>(
140 (fontStyle.slant() == SkFontStyle::kItalic_Slant ? SkTypeface::kItalic :
141 SkTypeface::kNormal) |
142 (fontStyle.weight() == SkFontStyle::kBold_Weight ? SkTypeface::kBold :
143 SkTypeface::kNormal))));
149 sk_sp<SkTypeface> SkTypeface::MakeFromStream(SkStreamAsset* stream, int index) {
154 sk_sp<SkTypeface> SkTypeface::MakeFromFontData(std::unique_ptr<SkFontData> data) {
159 sk_sp<SkTypeface> SkTypeface::MakeFromFile(const char path[], int index) {
166 void SkTypeface::serialize(SkWStream* wstream) const {
182 sk_sp<SkTypeface> SkTypeface::MakeDeserialize(SkStream* stream) {
194 sk_sp<SkTypeface> typeface(SkTypeface::MakeFromFontData(std::move(data)));
200 return SkTypeface::MakeFromName(desc.getFamilyName(), desc.getStyle());
205 int SkTypeface::getVariationDesignPosition(
211 int SkTypeface::countTables() const {
215 int SkTypeface::getTableTags(SkFontTableTag tags[]) const {
219 size_t SkTypeface::getTableSize(SkFontTableTag tag) const {
223 size_t SkTypeface::getTableData(SkFontTableTag tag, size_t offset, size_t length,
228 SkStreamAsset* SkTypeface::openStream(int* ttcIndex) const {
237 std::unique_ptr<SkFontData> SkTypeface::makeFontData() const {
242 std::unique_ptr<SkFontData> SkTypeface::onMakeFontData() const {
248 int SkTypeface::charsToGlyphs(const void* chars, Encoding encoding,
262 int SkTypeface::countGlyphs() const {
266 int SkTypeface::getUnitsPerEm() const {
271 bool SkTypeface::getKerningPairAdjustments(const uint16_t glyphs[], int count,
285 SkTypeface::LocalizedStrings* SkTypeface::createFamilyNameIterator() const {
289 void SkTypeface::getFamilyName(SkString* name) const {
294 std::unique_ptr<SkAdvancedTypefaceMetrics> SkTypeface::getAdvancedMetrics() const {
312 bool SkTypeface::onGetKerningPairAdjustments(const uint16_t glyphs[], int count,
322 SkRect SkTypeface::getBounds() const {
331 bool SkTypeface::onComputeBounds(SkRect* bounds) const {
338 paint.setTypeface(sk_ref_sp(const_cast<SkTypeface*>(this)));
364 std::unique_ptr<SkAdvancedTypefaceMetrics> SkTypeface::onGetAdvancedMetrics() const {