class SkFontData;
class SkFontDescriptor;
class SkScalerContext;
-struct SkScalerContextRec;
-struct SkScalerContextEffects;
class SkStream;
class SkStreamAsset;
-class SkAdvancedTypefaceMetrics;
class SkWStream;
+struct SkAdvancedTypefaceMetrics;
+struct SkScalerContextEffects;
+struct SkScalerContextRec;
typedef uint32_t SkFontID;
/** Machine endian. */
}
protected:
- // The type of advance data wanted.
- enum PerGlyphInfo {
- kNo_PerGlyphInfo = 0x0, // Don't populate any per glyph info.
- kGlyphNames_PerGlyphInfo = 0x1, // Populate glyph names (Type 1 only).
- kToUnicode_PerGlyphInfo = 0x2 // Populate ToUnicode table, ignored
- // for Type 1 fonts
- };
-
/** uniqueID must be unique and non-zero
*/
SkTypeface(const SkFontStyle& style, bool isFixedPitch = false);
virtual SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
const SkDescriptor*) const = 0;
virtual void onFilterRec(SkScalerContextRec*) const = 0;
+ virtual std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const;
+
+ enum PerGlyphInfo {
+ kNo_PerGlyphInfo = 0x0,
+ kGlyphNames_PerGlyphInfo = 0x1,
+ kToUnicode_PerGlyphInfo = 0x2
+ };
virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
- PerGlyphInfo,
- const uint32_t* glyphIDs,
- uint32_t glyphIDsCount) const = 0;
+ PerGlyphInfo, const uint32_t*, uint32_t) const {
+ return nullptr;
+ }
virtual SkStreamAsset* onOpenStream(int* ttcIndex) const = 0;
// TODO: make pure virtual.
friend class GrPathRendering;
friend class GrGLPathRendering;
- /** Retrieve detailed typeface metrics. Used by the PDF backend.
- @param perGlyphInfo Indicate what glyph specific information (advances,
- names, etc.) should be populated.
- @param glyphIDs For per-glyph info, specify subset of the font by
- giving glyph ids. Each integer represents a glyph
- id. Passing NULL means all glyphs in the font.
- @param glyphIDsCount Number of elements in subsetGlyphIds. Ignored if
- glyphIDs is NULL.
- @return The returned object has already been referenced.
- */
- SkAdvancedTypefaceMetrics* getAdvancedTypefaceMetrics(
- PerGlyphInfo,
- const uint32_t* glyphIDs = NULL,
- uint32_t glyphIDsCount = 0) const;
+ /** Retrieve detailed typeface metrics. Used by the PDF backend. */
+ std::unique_ptr<SkAdvancedTypefaceMetrics> getAdvancedMetrics() const;
private:
SkFontID fUniqueID;
typedef SkWeakRefCnt INHERITED;
};
-
-namespace skstd {
-template <> struct is_bitmask_enum<SkTypeface::PerGlyphInfo> : std::true_type {};
-}
-
#endif
The SkAdvancedTypefaceMetrics class is used by the PDF backend to correctly
embed typefaces. This class is created and filled in with information by
- SkTypeface::getAdvancedTypefaceMetrics.
+ SkTypeface::getAdvancedMetrics.
*/
-class SkAdvancedTypefaceMetrics : public SkRefCnt {
-public:
-
- SkAdvancedTypefaceMetrics()
- : fType(SkAdvancedTypefaceMetrics::kOther_Font)
- , fFlags((FontFlags)0)
- , fStyle((StyleFlags)0)
- , fItalicAngle(0)
- , fAscent(0)
- , fDescent(0)
- , fStemV(0)
- , fCapHeight(0)
- , fBBox(SkIRect::MakeEmpty()) {}
-
+struct SkAdvancedTypefaceMetrics {
+ SkAdvancedTypefaceMetrics() {}
+ SkAdvancedTypefaceMetrics(const SkAdvancedTypefaceMetrics&) = delete;
+ SkAdvancedTypefaceMetrics& operator=(const SkAdvancedTypefaceMetrics&) = delete;
~SkAdvancedTypefaceMetrics() {}
SkString fFontName;
// The type of the underlying font program. This field determines which
// of the following fields are valid. If it is kOther_Font the per glyph
// information will never be populated.
- FontType fType;
+ FontType fType = kOther_Font;
enum FontFlags : uint8_t {
kMultiMaster_FontFlag = 0x01, //!<May be true for Type1, CFF, or TrueType fonts.
kNotEmbeddable_FontFlag = 0x02, //!<May not be embedded.
kNotSubsettable_FontFlag = 0x04, //!<May not be subset.
};
- FontFlags fFlags; // Global font flags.
+ FontFlags fFlags = (FontFlags)0; // Global font flags.
// These enum values match the values used in the PDF file format.
enum StyleFlags : uint32_t {
kSmallCaps_Style = 0x00020000,
kForceBold_Style = 0x00040000
};
- StyleFlags fStyle; // Font style characteristics.
+ StyleFlags fStyle = (StyleFlags)0; // Font style characteristics.
- int16_t fItalicAngle; // Counterclockwise degrees from vertical of the
- // dominant vertical stroke for an Italic face.
+ int16_t fItalicAngle = 0; // Counterclockwise degrees from vertical of the
+ // dominant vertical stroke for an Italic face.
// The following fields are all in font units.
- int16_t fAscent; // Max height above baseline, not including accents.
- int16_t fDescent; // Max depth below baseline (negative).
- int16_t fStemV; // Thickness of dominant vertical stem.
- int16_t fCapHeight; // Height (from baseline) of top of flat capitals.
+ int16_t fAscent = 0; // Max height above baseline, not including accents.
+ int16_t fDescent = 0; // Max depth below baseline (negative).
+ int16_t fStemV = 0; // Thickness of dominant vertical stem.
+ int16_t fCapHeight = 0; // Height (from baseline) of top of flat capitals.
- SkIRect fBBox; // The bounding box of all glyphs (in font units).
+ SkIRect fBBox = {0, 0, 0, 0}; // The bounding box of all glyphs (in font units).
// The names of each glyph, only populated for postscript fonts.
SkTArray<SkString> fGlyphNames;
- // The mapping from glyph to Unicode, only populated if
- // kToUnicode_PerGlyphInfo is passed to GetAdvancedTypefaceMetrics.
+ // The mapping from glyph to Unicode; array indices are glyph ids.
SkTDArray<SkUnichar> fGlyphToUnicode;
-
-private:
- typedef SkRefCnt INHERITED;
};
namespace skstd {
return nullptr;
}
void onFilterRec(SkScalerContextRec*) const override { }
- virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
- PerGlyphInfo,
- const uint32_t*, uint32_t) const override { return nullptr; }
+ std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override {
+ return nullptr;
+ }
void onGetFontDescriptor(SkFontDescriptor*, bool*) const override { }
virtual int onCharsToGlyphs(const void* chars, Encoding encoding,
uint16_t glyphs[], int glyphCount) const override {
this->onGetFamilyName(name);
}
-SkAdvancedTypefaceMetrics* SkTypeface::getAdvancedTypefaceMetrics(
- PerGlyphInfo info,
- const uint32_t* glyphIDs,
- uint32_t glyphIDsCount) const {
- SkAdvancedTypefaceMetrics* result =
- this->onGetAdvancedTypefaceMetrics(info, glyphIDs, glyphIDsCount);
+std::unique_ptr<SkAdvancedTypefaceMetrics> SkTypeface::getAdvancedMetrics() const {
+ std::unique_ptr<SkAdvancedTypefaceMetrics> result = this->onGetAdvancedMetrics();
if (result && result->fType == SkAdvancedTypefaceMetrics::kTrueType_Font) {
SkOTTableOS2::Version::V2::Type::Field fsType;
constexpr SkFontTableTag os2Tag = SkTEndian_SwapBE32(SkOTTableOS2::TAG);
fm.fXMax * invTextSize, fm.fBottom * invTextSize);
return true;
}
+
+std::unique_ptr<SkAdvancedTypefaceMetrics> SkTypeface::onGetAdvancedMetrics() const {
+ return nullptr;
+}
* found in the LICENSE file.
*/
+#include "SkAdvancedTypefaceMetrics.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkGlyph.h"
rec->fMaskFormat = SkMask::kARGB32_Format;
}
-SkAdvancedTypefaceMetrics* SkRandomTypeface::onGetAdvancedTypefaceMetrics(
- PerGlyphInfo info,
- const uint32_t* glyphIDs,
- uint32_t glyphIDsCount) const {
- return fProxy->getAdvancedTypefaceMetrics(info, glyphIDs, glyphIDsCount);
+std::unique_ptr<SkAdvancedTypefaceMetrics> SkRandomTypeface::onGetAdvancedMetrics() const {
+ return fProxy->getAdvancedMetrics();
}
SkStreamAsset* SkRandomTypeface::onOpenStream(int* ttcIndex) const {
SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
const SkDescriptor*) const override;
void onFilterRec(SkScalerContextRec*) const override;
- SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
- PerGlyphInfo,
- const uint32_t* glyphIDs,
- uint32_t glyphIDsCount) const override;
+ std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override;
SkStreamAsset* onOpenStream(int* ttcIndex) const override;
void onGetFontDescriptor(SkFontDescriptor*, bool* isLocal) const override;
rec->setHinting(SkPaint::kNo_Hinting);
}
-SkAdvancedTypefaceMetrics* SkTestTypeface::onGetAdvancedTypefaceMetrics(
- PerGlyphInfo ,
- const uint32_t* glyphIDs,
- uint32_t glyphIDsCount) const {
-// pdf only
- SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics;
+std::unique_ptr<SkAdvancedTypefaceMetrics> SkTestTypeface::onGetAdvancedMetrics() const { // pdf only
+ std::unique_ptr<SkAdvancedTypefaceMetrics> info(new SkAdvancedTypefaceMetrics);
info->fFontName.set(fTestFont->fName);
int glyphCount = this->onCountGlyphs();
SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
const SkDescriptor* desc) const override;
void onFilterRec(SkScalerContextRec* rec) const override;
- SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
- PerGlyphInfo,
- const uint32_t* glyphIDs,
- uint32_t glyphIDsCount) const override;
+ std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override;
SkStreamAsset* onOpenStream(int* ttcIndex) const override {
return nullptr;
#include "SkTHash.h"
#include "SkBitmapKey.h"
-class SkAdvancedTypefaceMetrics;
class SkPDFFont;
+struct SkAdvancedTypefaceMetrics;
/**
* The SkPDFCanon canonicalizes objects across PDF pages
SkTHashMap<SkBitmapKey, sk_sp<SkPDFObject>> fPDFBitmapMap;
- SkTHashMap<uint32_t, sk_sp<SkAdvancedTypefaceMetrics>> fTypefaceMetrics;
+ SkTHashMap<uint32_t, std::unique_ptr<SkAdvancedTypefaceMetrics>> fTypefaceMetrics;
SkTHashMap<uint32_t, sk_sp<SkPDFDict>> fFontDescriptors;
SkTHashMap<uint64_t, sk_sp<SkPDFFont>> fFontMap;
#include "SkData.h"
#include "SkGlyphCache.h"
-#include "SkPaint.h"
+#include "SkMakeUnique.h"
#include "SkPDFCanon.h"
#include "SkPDFConvertType1FontStream.h"
#include "SkPDFDevice.h"
+#include "SkPDFFont.h"
#include "SkPDFMakeCIDGlyphWidthsArray.h"
#include "SkPDFMakeToUnicodeCmap.h"
-#include "SkPDFFont.h"
#include "SkPDFUtils.h"
+#include "SkPaint.h"
#include "SkRefCnt.h"
#include "SkScalar.h"
#include "SkStream.h"
SkPDFCanon* canon) {
SkASSERT(typeface);
SkFontID id = typeface->uniqueID();
- if (sk_sp<SkAdvancedTypefaceMetrics>* ptr = canon->fTypefaceMetrics.find(id)) {
+ if (std::unique_ptr<SkAdvancedTypefaceMetrics>* ptr = canon->fTypefaceMetrics.find(id)) {
return ptr->get(); // canon retains ownership.
}
int count = typeface->countGlyphs();
canon->fTypefaceMetrics.set(id, nullptr);
return nullptr;
}
- sk_sp<SkAdvancedTypefaceMetrics> metrics(
- typeface->getAdvancedTypefaceMetrics(
- SkTypeface::kGlyphNames_PerGlyphInfo | SkTypeface::kToUnicode_PerGlyphInfo,
- nullptr, 0));
+ std::unique_ptr<SkAdvancedTypefaceMetrics> metrics = typeface->getAdvancedMetrics();
if (!metrics) {
- metrics = sk_make_sp<SkAdvancedTypefaceMetrics>();
+ metrics = skstd::make_unique<SkAdvancedTypefaceMetrics>();
}
return canon->fTypefaceMetrics.set(id, std::move(metrics))->get();
}
SkTypeface* typeface,
SkGlyphID glyphID);
- /** Uses (kGlyphNames_PerGlyphInfo | kToUnicode_PerGlyphInfo) to get
- * SkAdvancedTypefaceMetrics, and caches the result.
+ /** Gets SkAdvancedTypefaceMetrics, and caches the result.
* @param typeface can not be nullptr.
* @return nullptr only when typeface is bad.
*/
}
}
-SkAdvancedTypefaceMetrics* SkTypeface_FreeType::onGetAdvancedTypefaceMetrics(
- PerGlyphInfo perGlyphInfo,
- const uint32_t* glyphIDs,
- uint32_t glyphIDsCount) const {
+std::unique_ptr<SkAdvancedTypefaceMetrics> SkTypeface_FreeType::onGetAdvancedMetrics() const {
AutoFTAccess fta(this);
FT_Face face = fta.face();
if (!face) {
return nullptr;
}
- SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics;
+ std::unique_ptr<SkAdvancedTypefaceMetrics> info(new SkAdvancedTypefaceMetrics);
info->fFontName.set(FT_Get_Postscript_Name(face));
if (FT_HAS_MULTIPLE_MASTERS(face)) {
info->fBBox = SkIRect::MakeLTRB(face->bbox.xMin, face->bbox.yMax,
face->bbox.xMax, face->bbox.yMin);
- if (!FT_IS_SCALABLE(face)) {
- perGlyphInfo = kNo_PerGlyphInfo;
- }
+ bool perGlyphInfo = FT_IS_SCALABLE(face);
- if (perGlyphInfo & kGlyphNames_PerGlyphInfo &&
- info->fType == SkAdvancedTypefaceMetrics::kType1_Font)
- {
+ if (perGlyphInfo && info->fType == SkAdvancedTypefaceMetrics::kType1_Font) {
// Postscript fonts may contain more than 255 glyphs, so we end up
// using multiple font descriptions with a glyph ordering. Record
// the name of each glyph.
}
}
- if (perGlyphInfo & kToUnicode_PerGlyphInfo &&
+ if (perGlyphInfo &&
info->fType != SkAdvancedTypefaceMetrics::kType1_Font &&
face->num_charmaps)
{
virtual SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
const SkDescriptor*) const override;
void onFilterRec(SkScalerContextRec*) const override;
- SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
- PerGlyphInfo, const uint32_t*, uint32_t) const override;
+ std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override;
int onGetUPEM() const override;
bool onGetKerningPairAdjustments(const uint16_t glyphs[], int count,
int32_t adjustments[]) const override;
const SkDescriptor*) const override;
void onFilterRec(SkScalerContextRec*) const override;
void onGetFontDescriptor(SkFontDescriptor*, bool*) const override;
- SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
- PerGlyphInfo, const uint32_t* glyphIDs, uint32_t glyphIDsCount) const override;
+ std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override;
int onCharsToGlyphs(const void* chars, Encoding,
uint16_t glyphs[], int glyphCount) const override;
int onCountGlyphs() const override;
dst->resize(strlen(dst->c_str()));
}
-SkAdvancedTypefaceMetrics* SkTypeface_Mac::onGetAdvancedTypefaceMetrics(
- PerGlyphInfo perGlyphInfo,
- const uint32_t* glyphIDs,
- uint32_t glyphIDsCount) const {
+std::unique_ptr<SkAdvancedTypefaceMetrics> SkTypeface_Mac::onGetAdvancedMetrics() const {
AUTO_CG_LOCK();
UniqueCFRef<CTFontRef> ctFont =
ctfont_create_exact_copy(fFontRef.get(), CTFontGetUnitsPerEm(fFontRef.get()), nullptr);
- SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics;
+ std::unique_ptr<SkAdvancedTypefaceMetrics> info(new SkAdvancedTypefaceMetrics);
{
UniqueCFRef<CFStringRef> fontName(CTFontCopyPostScriptName(ctFont.get()));
CFIndex glyphCount = CTFontGetGlyphCount(ctFont.get());
- if (perGlyphInfo & kToUnicode_PerGlyphInfo) {
- populate_glyph_to_unicode(ctFont.get(), glyphCount, &info->fGlyphToUnicode);
- }
+ populate_glyph_to_unicode(ctFont.get(), glyphCount, &info->fGlyphToUnicode);
// If it's not a truetype font, mark it as 'other'. Assume that TrueType
// fonts always have both glyf and loca tables. At the least, this is what
SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
const SkDescriptor*) const override;
void onFilterRec(SkScalerContextRec*) const override;
- SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
- PerGlyphInfo, const uint32_t*, uint32_t) const override;
+ std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override;
void onGetFontDescriptor(SkFontDescriptor*, bool*) const override;
int onCharsToGlyphs(const void* chars, Encoding encoding,
uint16_t glyphs[], int glyphCount) const override;
*isLocalStream = this->fSerializeAsStream;
}
-SkAdvancedTypefaceMetrics* LogFontTypeface::onGetAdvancedTypefaceMetrics(
- PerGlyphInfo perGlyphInfo,
- const uint32_t* glyphIDs,
- uint32_t glyphIDsCount) const {
+std::unique_ptr<SkAdvancedTypefaceMetrics> LogFontTypeface::onGetAdvancedMetrics() const {
LOGFONT lf = fLogFont;
- SkAdvancedTypefaceMetrics* info = nullptr;
+ std::unique_ptr<SkAdvancedTypefaceMetrics> info(nullptr);
HDC hdc = CreateCompatibleDC(nullptr);
HFONT font = CreateFontIndirect(&lf);
}
glyphCount = calculateGlyphCount(hdc, fLogFont);
- info = new SkAdvancedTypefaceMetrics;
+ info.reset(new SkAdvancedTypefaceMetrics);
tchar_to_skstring(lf.lfFaceName, &info->fFontName);
// If bit 1 is set, the font may not be embedded in a document.
// If bit 1 is clear, the font can be embedded.
info->fFlags |= SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag;
}
- if (perGlyphInfo & kToUnicode_PerGlyphInfo) {
- populate_glyph_to_unicode(hdc, glyphCount, &(info->fGlyphToUnicode));
- }
+ populate_glyph_to_unicode(hdc, glyphCount, &(info->fGlyphToUnicode));
if (glyphCount > 0 &&
(otm.otmTextMetrics.tmPitchAndFamily & TMPF_TRUETYPE)) {
this->INHERITED::onFilterRec(rec);
}
- SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(PerGlyphInfo perGlyphInfo,
- const uint32_t* glyphIDs,
- uint32_t glyphIDsCount) const override
- {
- SkAdvancedTypefaceMetrics* info =
- this->INHERITED::onGetAdvancedTypefaceMetrics(perGlyphInfo, glyphIDs, glyphIDsCount);
+ std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override {
+ std::unique_ptr<SkAdvancedTypefaceMetrics> info =
+ this->INHERITED::onGetAdvancedMetrics();
// Simulated fonts shouldn't be considered to be of the type of their data.
if (get_matrix(fPattern, FC_MATRIX) || get_bool(fPattern, FC_EMBOLDEN)) {
SkTDArray<SkUnichar>(glyphToUni, maxGlyph + 1).swap(*glyphToUnicode);
}
-SkAdvancedTypefaceMetrics* DWriteFontTypeface::onGetAdvancedTypefaceMetrics(
- PerGlyphInfo perGlyphInfo,
- const uint32_t* glyphIDs,
- uint32_t glyphIDsCount) const {
+std::unique_ptr<SkAdvancedTypefaceMetrics> DWriteFontTypeface::onGetAdvancedMetrics() const {
- SkAdvancedTypefaceMetrics* info = nullptr;
+ std::unique_ptr<SkAdvancedTypefaceMetrics> info(nullptr);
HRESULT hr = S_OK;
DWRITE_FONT_METRICS dwfm;
fDWriteFontFace->GetMetrics(&dwfm);
- info = new SkAdvancedTypefaceMetrics;
+ info.reset(new SkAdvancedTypefaceMetrics);
info->fAscent = SkToS16(dwfm.ascent);
info->fDescent = SkToS16(dwfm.descent);
hr = sk_wchar_to_skstring(familyName.get(), familyNameLen, &info->fFontName);
- if (perGlyphInfo & kToUnicode_PerGlyphInfo) {
- populate_glyph_to_unicode(fDWriteFontFace.get(), glyphCount, &(info->fGlyphToUnicode));
- }
+ populate_glyph_to_unicode(fDWriteFontFace.get(), glyphCount, &(info->fGlyphToUnicode));
DWRITE_FONT_FACE_TYPE fontType = fDWriteFontFace->GetType();
if (fontType != DWRITE_FONT_FACE_TYPE_TRUETYPE &&
SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
const SkDescriptor*) const override;
void onFilterRec(SkScalerContextRec*) const override;
- SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
- PerGlyphInfo, const uint32_t*, uint32_t) const override;
+ std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override;
void onGetFontDescriptor(SkFontDescriptor*, bool*) const override;
int onCharsToGlyphs(const void* chars, Encoding encoding,
uint16_t glyphs[], int glyphCount) const override;
* found in the LICENSE file.
*/
+#include "SkAdvancedTypefaceMetrics.h"
#include "SkCommandLineFlags.h"
+#include "SkFont.h"
#include "SkFontMgr.h"
+#include "SkPaint.h"
#include "SkTypeface.h"
#include "Test.h"
-#include "SkFont.h"
-#include "SkPaint.h"
-
#include <initializer_list>
#include <limits>
#include <vector>
return nullptr;
}
void onFilterRec(SkScalerContextRec*) const override { }
- virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
- PerGlyphInfo,
- const uint32_t*, uint32_t) const override { return nullptr; }
+ std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override {
+ return nullptr;
+ }
void onGetFontDescriptor(SkFontDescriptor*, bool*) const override { }
virtual int onCharsToGlyphs(const void* chars, Encoding encoding,
uint16_t glyphs[], int glyphCount) const override {
* found in the LICENSE file.
*/
+#include "SkAdvancedTypefaceMetrics.h"
#include "SkData.h"
#include "SkFixed.h"
#include "SkFontMgr.h"
return nullptr;
}
void onFilterRec(SkScalerContextRec*) const override { }
- virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
- PerGlyphInfo,
- const uint32_t*, uint32_t) const override { return nullptr; }
+ std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override {
+ return nullptr;
+ }
void onGetFontDescriptor(SkFontDescriptor*, bool*) const override { }
virtual int onCharsToGlyphs(const void* chars, Encoding encoding,
uint16_t glyphs[], int glyphCount) const override {