8#ifndef SkFontDescriptor_DEFINED
9#define SkFontDescriptor_DEFINED
28 const SkFixed* axis,
int axisCount,
32 , fPaletteIndex(paletteIndex)
33 , fAxisCount(axisCount)
34 , fPaletteOverrideCount(paletteOverrideCount)
36 , fPaletteOverrides(fPaletteOverrideCount)
38 for (
int i = 0;
i < fAxisCount; ++
i) {
41 for (
int i = 0;
i < fPaletteOverrideCount; ++
i) {
42 fPaletteOverrides[
i] = paletteOverrides[
i];
47 : fStream(that.fStream->duplicate())
49 , fPaletteIndex(that.fPaletteIndex)
50 , fAxisCount(that.fAxisCount)
51 , fPaletteOverrideCount(that.fPaletteOverrideCount)
53 , fPaletteOverrides(fPaletteOverrideCount)
55 for (
int i = 0;
i < fAxisCount; ++
i) {
56 fAxis[
i] = that.fAxis[
i];
58 for (
int i = 0;
i < fPaletteOverrideCount; ++
i) {
59 fPaletteOverrides[
i] = that.fPaletteOverrides[
i];
62 bool hasStream()
const {
return fStream !=
nullptr; }
63 std::unique_ptr<SkStreamAsset>
detachStream() {
return std::move(fStream); }
72 return fPaletteOverrides.
get();
76 std::unique_ptr<SkStreamAsset> fStream;
80 int fPaletteOverrideCount;
105 std::unique_ptr<SkStreamAsset>
dupStream()
const {
return fStream->duplicate(); }
110 return fVariation.
get();
114 return fPaletteEntryOverrides.
get();
120 std::unique_ptr<SkStreamAsset>
detachStream() {
return std::move(fStream); }
125 fCoordinateCount = coordinateCount;
126 return fVariation.
reset(coordinateCount);
129 fPaletteEntryOverrideCount = paletteEntryOverrideCount;
130 return fPaletteEntryOverrides.
reset(paletteEntryOverrideCount);
133 fFactoryId = factoryId;
152 std::unique_ptr<SkStreamAsset> fStream;
153 int fCollectionIndex = 0;
156 int fCoordinateCount = 0;
158 int fPaletteIndex = 0;
159 int fPaletteEntryOverrideCount = 0;
SkStreamAsset * getStream()
const SkFontArguments::Palette::Override * getPaletteOverrides() const
int getPaletteIndex() const
int getPaletteOverrideCount() const
SkStreamAsset const * getStream() const
const SkFixed * getAxis() const
SkFontData(const SkFontData &that)
std::unique_ptr< SkStreamAsset > detachStream()
SkFontData(std::unique_ptr< SkStreamAsset > stream, int index, int paletteIndex, const SkFixed *axis, int axisCount, const SkFontArguments::Palette::Override *paletteOverrides, int paletteOverrideCount)
const SkFontArguments::Palette::Override * getPaletteEntryOverrides() const
void setFullName(const char *name)
SkFontArguments::Palette::Override * setPaletteEntryOverrides(int paletteEntryOverrideCount)
static SkFontStyle::Width SkFontStyleWidthForWidthAxisValue(SkScalar width)
SkFontArguments::VariationPosition::Coordinate * setVariationCoordinates(int coordinateCount)
const char * getPostscriptName() const
void setFamilyName(const char *name)
void setStyle(SkFontStyle style)
int getCollectionIndex() const
SkFontStyle getStyle() const
void serialize(SkWStream *) const
std::unique_ptr< SkStreamAsset > dupStream() const
void setStream(std::unique_ptr< SkStreamAsset > stream)
void setPaletteIndex(int paletteIndex)
const SkFontArguments::VariationPosition::Coordinate * getVariation() const
void setFactoryId(SkTypeface::FactoryId factoryId)
const char * getFamilyName() const
static bool Deserialize(SkStream *, SkFontDescriptor *result)
std::unique_ptr< SkStreamAsset > detachStream()
void setCollectionIndex(int collectionIndex)
void setPostscriptName(const char *name)
int getVariationCoordinateCount() const
const char * getFullName() const
int getPaletteIndex() const
int getPaletteEntryOverrideCount() const
SkTypeface::FactoryId getFactoryId()
SkFontArguments getFontArguments() const
void set(const SkString &src)
const char * c_str() const
T * reset(size_t count=0)
DEF_SWITCHES_START aot vmservice shared library name
SkFontArguments & setCollectionIndex(int collectionIndex)
SkFontArguments & setVariationDesignPosition(VariationPosition position)