Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkFontData Class Reference

#include <SkFontDescriptor.h>

Public Member Functions

 SkFontData (std::unique_ptr< SkStreamAsset > stream, int index, int paletteIndex, const SkFixed *axis, int axisCount, const SkFontArguments::Palette::Override *paletteOverrides, int paletteOverrideCount)
 
 SkFontData (const SkFontData &that)
 
bool hasStream () const
 
std::unique_ptr< SkStreamAssetdetachStream ()
 
SkStreamAssetgetStream ()
 
SkStreamAsset const * getStream () const
 
int getIndex () const
 
int getAxisCount () const
 
const SkFixedgetAxis () const
 
int getPaletteIndex () const
 
int getPaletteOverrideCount () const
 
const SkFontArguments::Palette::OverridegetPaletteOverrides () const
 

Detailed Description

Definition at line 24 of file SkFontDescriptor.h.

Constructor & Destructor Documentation

◆ SkFontData() [1/2]

SkFontData::SkFontData ( std::unique_ptr< SkStreamAsset stream,
int  index,
int  paletteIndex,
const SkFixed axis,
int  axisCount,
const SkFontArguments::Palette::Override paletteOverrides,
int  paletteOverrideCount 
)
inline

Makes a copy of the data in 'axis'.

Definition at line 27 of file SkFontDescriptor.h.

30 : fStream(std::move(stream))
31 , fIndex(index)
32 , fPaletteIndex(paletteIndex)
33 , fAxisCount(axisCount)
34 , fPaletteOverrideCount(paletteOverrideCount)
35 , fAxis(fAxisCount)
36 , fPaletteOverrides(fPaletteOverrideCount)
37 {
38 for (int i = 0; i < fAxisCount; ++i) {
39 fAxis[i] = axis[i];
40 }
41 for (int i = 0; i < fPaletteOverrideCount; ++i) {
42 fPaletteOverrides[i] = paletteOverrides[i];
43 }
44 }

◆ SkFontData() [2/2]

SkFontData::SkFontData ( const SkFontData that)
inline

Definition at line 46 of file SkFontDescriptor.h.

47 : fStream(that.fStream->duplicate())
48 , fIndex(that.fIndex)
49 , fPaletteIndex(that.fPaletteIndex)
50 , fAxisCount(that.fAxisCount)
51 , fPaletteOverrideCount(that.fPaletteOverrideCount)
52 , fAxis(fAxisCount)
53 , fPaletteOverrides(fPaletteOverrideCount)
54 {
55 for (int i = 0; i < fAxisCount; ++i) {
56 fAxis[i] = that.fAxis[i];
57 }
58 for (int i = 0; i < fPaletteOverrideCount; ++i) {
59 fPaletteOverrides[i] = that.fPaletteOverrides[i];
60 }
61 }

Member Function Documentation

◆ detachStream()

std::unique_ptr< SkStreamAsset > SkFontData::detachStream ( )
inline

Definition at line 63 of file SkFontDescriptor.h.

63{ return std::move(fStream); }

◆ getAxis()

const SkFixed * SkFontData::getAxis ( ) const
inline

Definition at line 68 of file SkFontDescriptor.h.

68{ return fAxis.get(); }

◆ getAxisCount()

int SkFontData::getAxisCount ( ) const
inline

Definition at line 67 of file SkFontDescriptor.h.

67{ return fAxisCount; }

◆ getIndex()

int SkFontData::getIndex ( ) const
inline

Definition at line 66 of file SkFontDescriptor.h.

66{ return fIndex; }

◆ getPaletteIndex()

int SkFontData::getPaletteIndex ( ) const
inline

Definition at line 69 of file SkFontDescriptor.h.

69{ return fPaletteIndex; }

◆ getPaletteOverrideCount()

int SkFontData::getPaletteOverrideCount ( ) const
inline

Definition at line 70 of file SkFontDescriptor.h.

70{ return fPaletteOverrideCount; }

◆ getPaletteOverrides()

const SkFontArguments::Palette::Override * SkFontData::getPaletteOverrides ( ) const
inline

Definition at line 71 of file SkFontDescriptor.h.

71 {
72 return fPaletteOverrides.get();
73 }

◆ getStream() [1/2]

SkStreamAsset * SkFontData::getStream ( )
inline

Definition at line 64 of file SkFontDescriptor.h.

64{ return fStream.get(); }

◆ getStream() [2/2]

SkStreamAsset const * SkFontData::getStream ( ) const
inline

Definition at line 65 of file SkFontDescriptor.h.

65{ return fStream.get(); }

◆ hasStream()

bool SkFontData::hasStream ( ) const
inline

Definition at line 62 of file SkFontDescriptor.h.

62{ return fStream != nullptr; }

The documentation for this class was generated from the following file: