Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
SfntHeader Struct Reference

Public Member Functions

 SfntHeader ()
 
 ~SfntHeader ()
 
bool init (SkStream *stream, int ttcIndex)
 

Public Attributes

int fCount
 
SkSFNTDirEntryfDir
 

Detailed Description

Definition at line 108 of file SkFontStream.cpp.

Constructor & Destructor Documentation

◆ SfntHeader()

SfntHeader::SfntHeader ( )
inline

Definition at line 109 of file SkFontStream.cpp.

109: fCount(0), fDir(nullptr) {}
SkSFNTDirEntry * fDir

◆ ~SfntHeader()

SfntHeader::~SfntHeader ( )
inline

Definition at line 110 of file SkFontStream.cpp.

110{ sk_free(fDir); }
SK_API void sk_free(void *)

Member Function Documentation

◆ init()

bool SfntHeader::init ( SkStream stream,
int  ttcIndex 
)
inline

If it returns true, then fCount and fDir are properly initialized. Note: fDir will point to the raw array of SkSFNTDirEntry values, meaning they will still be in the file's native endianness (BE).

fDir will be automatically freed when this object is destroyed

Definition at line 118 of file SkFontStream.cpp.

118 {
119 stream->rewind();
120
121 size_t offsetToDir;
122 fCount = count_tables(stream, ttcIndex, &offsetToDir);
123 if (0 == fCount) {
124 return false;
125 }
126
127 stream->rewind();
128 if (!skip(stream, offsetToDir)) {
129 return false;
130 }
131
132 size_t size = fCount * sizeof(SkSFNTDirEntry);
133 fDir = reinterpret_cast<SkSFNTDirEntry*>(sk_malloc_throw(size));
134 return read(stream, fDir, size);
135 }
static bool read(SkStream *stream, void *buffer, size_t amount)
static bool skip(SkStream *stream, size_t amount)
static int count_tables(SkStream *stream, int ttcIndex, size_t *offsetToDir)
static void * sk_malloc_throw(size_t size)
Definition: SkMalloc.h:67
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

Member Data Documentation

◆ fCount

int SfntHeader::fCount

Definition at line 137 of file SkFontStream.cpp.

◆ fDir

SkSFNTDirEntry* SfntHeader::fDir

Definition at line 138 of file SkFontStream.cpp.


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