webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Typedefs | Functions | Variables
woff2 Namespace Reference

Classes

class  Buffer
 
struct  Font
 
struct  FontCollection
 
class  Glyph
 
struct  Point
 
struct  Table
 
class  WOFF2MemoryOut
 
class  WOFF2Out
 
struct  WOFF2Params
 
class  WOFF2StringOut
 

Typedefs

typedef unsigned int uint32
 

Functions

string GetFileContent (string filename)
 
void SetFileContents (string filename, string::iterator start, string::iterator end)
 
bool ReadTrueTypeFont (Buffer *file, const uint8_t *data, size_t len, Font *font)
 
bool ReadCollectionFont (Buffer *file, const uint8_t *data, size_t len, Font *font, std::map< uint32_t, Font::Table *> *all_tables)
 
bool ReadTrueTypeCollection (Buffer *file, const uint8_t *data, size_t len, FontCollection *font_collection)
 
bool ReadFont (const uint8_t *data, size_t len, Font *font)
 
bool ReadFontCollection (const uint8_t *data, size_t len, FontCollection *font_collection)
 
size_t FontFileSize (const Font &font)
 
size_t FontCollectionFileSize (const FontCollection &font_collection)
 
bool WriteFont (const Font &font, uint8_t *dst, size_t dst_size)
 
bool WriteTableRecord (const Font::Table *table, size_t *offset, uint8_t *dst, size_t dst_size)
 
bool WriteTable (const Font::Table &table, size_t *offset, uint8_t *dst, size_t dst_size)
 
bool WriteFont (const Font &font, size_t *offset, uint8_t *dst, size_t dst_size)
 
bool WriteFontCollection (const FontCollection &font_collection, uint8_t *dst, size_t dst_size)
 
int NumGlyphs (const Font &font)
 
int IndexFormat (const Font &font)
 
bool GetGlyphData (const Font &font, int glyph_index, const uint8_t **glyph_data, size_t *glyph_size)
 
bool RemoveDigitalSignature (Font *font)
 
bool ReadCompositeGlyphData (Buffer *buffer, Glyph *glyph)
 
bool ReadGlyph (const uint8_t *data, size_t len, Glyph *glyph)
 
bool StoreGlyph (const Glyph &glyph, uint8_t *dst, size_t *dst_size)
 
bool NormalizeGlyphs (Font *font)
 
bool NormalizeOffsets (Font *font)
 
bool FixChecksums (Font *font)
 
bool NormalizeWithoutFixingChecksums (Font *font)
 
bool NormalizeFont (Font *font)
 
bool NormalizeFontCollection (FontCollection *font_collection)
 
int Log2Floor (uint32 n)
 
template<typename T >
T Round4 (T value)
 
size_t StoreU32 (uint8_t *dst, size_t offset, uint32_t x)
 
size_t Store16 (uint8_t *dst, size_t offset, int x)
 
void StoreU32 (uint32_t val, size_t *offset, uint8_t *dst)
 
void Store16 (int val, size_t *offset, uint8_t *dst)
 
void StoreBytes (const uint8_t *data, size_t len, size_t *offset, uint8_t *dst)
 
bool TransformGlyfAndLocaTables (Font *font)
 
bool TransformHmtxTable (Font *font)
 
size_t Size255UShort (uint16_t value)
 
void Write255UShort (std::vector< uint8_t > *out, int value)
 
void Store255UShort (int val, size_t *offset, uint8_t *dst)
 
bool Read255UShort (Buffer *buf, unsigned int *value)
 
bool ReadBase128 (Buffer *buf, uint32_t *value)
 
size_t Base128Size (size_t n)
 
void StoreBase128 (size_t len, size_t *offset, uint8_t *dst)
 
uint32_t ComputeULongSum (const uint8_t *buf, size_t size)
 
size_t CollectionHeaderSize (uint32_t header_version, uint32_t num_fonts)
 
size_t ComputeWOFF2FinalSize (const uint8_t *data, size_t length)
 
bool ConvertWOFF2ToTTF (uint8_t *result, size_t result_length, const uint8_t *data, size_t length)
 
bool ConvertWOFF2ToTTF (const uint8_t *data, size_t length, WOFF2Out *out)
 
size_t MaxWOFF2CompressedSize (const uint8_t *data, size_t length)
 
size_t MaxWOFF2CompressedSize (const uint8_t *data, size_t length, const string &extended_metadata)
 
uint32_t CompressedBufferSize (uint32_t original_size)
 
bool TransformFontCollection (FontCollection *font_collection)
 
bool ConvertTTFToWOFF2 (const uint8_t *data, size_t length, uint8_t *result, size_t *result_length)
 
bool ConvertTTFToWOFF2 (const uint8_t *data, size_t length, uint8_t *result, size_t *result_length, const WOFF2Params &params)
 

Variables

const uint32_t kKnownTags [63]
 
const unsigned int kWoff2FlagsTransform = 1 << 8
 
const size_t kDefaultMaxSize = 30 * 1024 * 1024
 

Typedef Documentation

◆ uint32

typedef unsigned int woff2::uint32

Function Documentation

◆ Base128Size()

size_t woff2::Base128Size ( size_t  n)

◆ CollectionHeaderSize()

size_t woff2::CollectionHeaderSize ( uint32_t  header_version,
uint32_t  num_fonts 
)

◆ CompressedBufferSize()

uint32_t woff2::CompressedBufferSize ( uint32_t  original_size)

◆ ComputeULongSum()

uint32_t woff2::ComputeULongSum ( const uint8_t buf,
size_t  size 
)

◆ ComputeWOFF2FinalSize()

size_t woff2::ComputeWOFF2FinalSize ( const uint8_t data,
size_t  length 
)

◆ ConvertTTFToWOFF2() [1/2]

bool woff2::ConvertTTFToWOFF2 ( const uint8_t data,
size_t  length,
uint8_t result,
size_t result_length 
)

◆ ConvertTTFToWOFF2() [2/2]

bool woff2::ConvertTTFToWOFF2 ( const uint8_t data,
size_t  length,
uint8_t result,
size_t result_length,
const WOFF2Params params 
)

◆ ConvertWOFF2ToTTF() [1/2]

bool woff2::ConvertWOFF2ToTTF ( uint8_t result,
size_t  result_length,
const uint8_t data,
size_t  length 
)

◆ ConvertWOFF2ToTTF() [2/2]

bool woff2::ConvertWOFF2ToTTF ( const uint8_t data,
size_t  length,
WOFF2Out out 
)

◆ FixChecksums()

bool woff2::FixChecksums ( Font font)

◆ FontCollectionFileSize()

size_t woff2::FontCollectionFileSize ( const FontCollection font_collection)

◆ FontFileSize()

size_t woff2::FontFileSize ( const Font font)

◆ GetFileContent()

string woff2::GetFileContent ( string  filename)
inline

◆ GetGlyphData()

bool woff2::GetGlyphData ( const Font font,
int  glyph_index,
const uint8_t **  glyph_data,
size_t glyph_size 
)

◆ IndexFormat()

int woff2::IndexFormat ( const Font font)

◆ Log2Floor()

int woff2::Log2Floor ( uint32  n)
inline

◆ MaxWOFF2CompressedSize() [1/2]

size_t woff2::MaxWOFF2CompressedSize ( const uint8_t data,
size_t  length 
)

◆ MaxWOFF2CompressedSize() [2/2]

size_t woff2::MaxWOFF2CompressedSize ( const uint8_t data,
size_t  length,
const string extended_metadata 
)

◆ NormalizeFont()

bool woff2::NormalizeFont ( Font font)

◆ NormalizeFontCollection()

bool woff2::NormalizeFontCollection ( FontCollection font_collection)

◆ NormalizeGlyphs()

bool woff2::NormalizeGlyphs ( Font font)

◆ NormalizeOffsets()

bool woff2::NormalizeOffsets ( Font font)

◆ NormalizeWithoutFixingChecksums()

bool woff2::NormalizeWithoutFixingChecksums ( Font font)

◆ NumGlyphs()

int woff2::NumGlyphs ( const Font font)

◆ Read255UShort()

bool woff2::Read255UShort ( Buffer buf,
unsigned int *  value 
)

◆ ReadBase128()

bool woff2::ReadBase128 ( Buffer buf,
uint32_t value 
)

◆ ReadCollectionFont()

bool woff2::ReadCollectionFont ( Buffer file,
const uint8_t data,
size_t  len,
Font font,
std::map< uint32_t, Font::Table *> *  all_tables 
)

◆ ReadCompositeGlyphData()

bool woff2::ReadCompositeGlyphData ( Buffer buffer,
Glyph glyph 
)

◆ ReadFont()

bool woff2::ReadFont ( const uint8_t data,
size_t  len,
Font font 
)

◆ ReadFontCollection()

bool woff2::ReadFontCollection ( const uint8_t data,
size_t  len,
FontCollection font_collection 
)

◆ ReadGlyph()

bool woff2::ReadGlyph ( const uint8_t data,
size_t  len,
Glyph glyph 
)

◆ ReadTrueTypeCollection()

bool woff2::ReadTrueTypeCollection ( Buffer file,
const uint8_t data,
size_t  len,
FontCollection font_collection 
)

◆ ReadTrueTypeFont()

bool woff2::ReadTrueTypeFont ( Buffer file,
const uint8_t data,
size_t  len,
Font font 
)

◆ RemoveDigitalSignature()

bool woff2::RemoveDigitalSignature ( Font font)

◆ Round4()

template<typename T >
T woff2::Round4 ( T  value)

◆ SetFileContents()

void woff2::SetFileContents ( string  filename,
string::iterator  start,
string::iterator  end 
)
inline

◆ Size255UShort()

size_t woff2::Size255UShort ( uint16_t  value)

◆ Store16() [1/2]

size_t woff2::Store16 ( uint8_t dst,
size_t  offset,
int  x 
)
inline

◆ Store16() [2/2]

void woff2::Store16 ( int  val,
size_t offset,
uint8_t dst 
)
inline

◆ Store255UShort()

void woff2::Store255UShort ( int  val,
size_t offset,
uint8_t dst 
)

◆ StoreBase128()

void woff2::StoreBase128 ( size_t  len,
size_t offset,
uint8_t dst 
)

◆ StoreBytes()

void woff2::StoreBytes ( const uint8_t data,
size_t  len,
size_t offset,
uint8_t dst 
)
inline

◆ StoreGlyph()

bool woff2::StoreGlyph ( const Glyph glyph,
uint8_t dst,
size_t dst_size 
)

◆ StoreU32() [1/2]

size_t woff2::StoreU32 ( uint8_t dst,
size_t  offset,
uint32_t  x 
)
inline

◆ StoreU32() [2/2]

void woff2::StoreU32 ( uint32_t  val,
size_t offset,
uint8_t dst 
)
inline

◆ TransformFontCollection()

bool woff2::TransformFontCollection ( FontCollection font_collection)

◆ TransformGlyfAndLocaTables()

bool woff2::TransformGlyfAndLocaTables ( Font font)

◆ TransformHmtxTable()

bool woff2::TransformHmtxTable ( Font font)

◆ Write255UShort()

void woff2::Write255UShort ( std::vector< uint8_t > *  out,
int  value 
)

◆ WriteFont() [1/2]

bool woff2::WriteFont ( const Font font,
uint8_t dst,
size_t  dst_size 
)

◆ WriteFont() [2/2]

bool woff2::WriteFont ( const Font font,
size_t offset,
uint8_t dst,
size_t  dst_size 
)

◆ WriteFontCollection()

bool woff2::WriteFontCollection ( const FontCollection font_collection,
uint8_t dst,
size_t  dst_size 
)

◆ WriteTable()

bool woff2::WriteTable ( const Font::Table table,
size_t offset,
uint8_t dst,
size_t  dst_size 
)

◆ WriteTableRecord()

bool woff2::WriteTableRecord ( const Font::Table table,
size_t offset,
uint8_t dst,
size_t  dst_size 
)

Variable Documentation

◆ kDefaultMaxSize

const size_t woff2::kDefaultMaxSize = 30 * 1024 * 1024

◆ kKnownTags

const uint32_t woff2::kKnownTags

◆ kWoff2FlagsTransform

const unsigned int woff2::kWoff2FlagsTransform = 1 << 8