#include "sfwoff2.h"
#include "woff2tags.h"
#include <freetype/tttags.h>
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftstream.h>
#ifdef FT_CONFIG_OPTION_USE_BROTLI
#include <brotli/decode.h>
#undef FT_COMPONENT
#define FT_COMPONENT …
#define MAX_SFNT_SIZE …
#define READ_255USHORT …
#define READ_BASE128 …
#define ROUND4 …
#define WRITE_USHORT …
#define WRITE_ULONG …
#define WRITE_SHORT …
#define WRITE_SFNT_BUF …
#define WRITE_SFNT_BUF_AT …
#define N_CONTOUR_STREAM …
#define N_POINTS_STREAM …
#define FLAG_STREAM …
#define GLYPH_STREAM …
#define COMPOSITE_STREAM …
#define BBOX_STREAM …
#define INSTRUCTION_STREAM …
#define HAVE_OVERLAP_SIMPLE_BITMAP …
static void
stream_close( FT_Stream stream )
{ … }
FT_COMPARE_DEF( int )
compare_tags( const void* a,
const void* b )
{ … }
static FT_Error
Read255UShort( FT_Stream stream,
FT_UShort* value )
{ … }
static FT_Error
ReadBase128( FT_Stream stream,
FT_ULong* value )
{ … }
static FT_Error
write_buf( FT_Byte** dst_bytes,
FT_ULong* dst_size,
FT_ULong* offset,
FT_Byte* src,
FT_ULong size,
FT_Memory memory )
{ … }
static FT_Error
pad4( FT_Byte** sfnt_bytes,
FT_ULong* sfnt_size,
FT_ULong* out_offset,
FT_Memory memory )
{ … }
static FT_ULong
compute_ULong_sum( FT_Byte* buf,
FT_ULong size )
{ … }
static FT_Error
woff2_decompress( FT_Byte* dst,
FT_ULong dst_size,
const FT_Byte* src,
FT_ULong src_size )
{ … }
static WOFF2_Table
find_table( WOFF2_Table* tables,
FT_UShort num_tables,
FT_Tag tag )
{ … }
static FT_Error
read_num_hmetrics( FT_Stream stream,
FT_UShort* num_hmetrics )
{ … }
static FT_Int
with_sign( FT_Byte flag,
FT_Int base_val )
{ … }
static FT_Int
safe_int_addition( FT_Int a,
FT_Int b,
FT_Int* result )
{ … }
static FT_Error
triplet_decode( const FT_Byte* flags_in,
const FT_Byte* in,
FT_ULong in_size,
FT_ULong n_points,
WOFF2_Point result,
FT_ULong* in_bytes_used )
{ … }
static FT_Error
store_points( FT_ULong n_points,
const WOFF2_Point points,
FT_UShort n_contours,
FT_UShort instruction_len,
FT_Bool have_overlap,
FT_Byte* dst,
FT_ULong dst_size,
FT_ULong* glyph_size )
{ … }
static void
compute_bbox( FT_ULong n_points,
const WOFF2_Point points,
FT_Byte* dst,
FT_UShort* src_x_min )
{ … }
static FT_Error
compositeGlyph_size( FT_Stream stream,
FT_ULong offset,
FT_ULong* size,
FT_Bool* have_instructions )
{ … }
static FT_Error
store_loca( FT_ULong* loca_values,
FT_ULong loca_values_size,
FT_UShort index_format,
FT_ULong* checksum,
FT_Byte** sfnt_bytes,
FT_ULong* sfnt_size,
FT_ULong* out_offset,
FT_Memory memory )
{ … }
static FT_Error
reconstruct_glyf( FT_Stream stream,
FT_ULong* glyf_checksum,
FT_ULong* loca_checksum,
FT_Byte** sfnt_bytes,
FT_ULong* sfnt_size,
FT_ULong* out_offset,
WOFF2_Info info,
FT_Memory memory )
{ … }
static FT_Error
get_x_mins( FT_Stream stream,
WOFF2_Table* tables,
FT_UShort num_tables,
WOFF2_Info info,
FT_Memory memory )
{ … }
static FT_Error
reconstruct_hmtx( FT_Stream stream,
FT_UShort num_glyphs,
FT_UShort num_hmetrics,
FT_Short* x_mins,
FT_ULong* checksum,
FT_Byte** sfnt_bytes,
FT_ULong* sfnt_size,
FT_ULong* out_offset,
FT_Memory memory )
{ … }
static FT_Error
reconstruct_font( FT_Byte* transformed_buf,
FT_ULong transformed_buf_size,
WOFF2_Table* indices,
WOFF2_Header woff2,
WOFF2_Info info,
FT_Byte** sfnt_bytes,
FT_ULong* sfnt_size,
FT_Memory memory )
{ … }
FT_LOCAL_DEF( FT_Error )
woff2_open_font( FT_Stream stream,
TT_Face face,
FT_Int* face_instance_index,
FT_Long* num_faces )
{ … }
#undef READ_255USHORT
#undef READ_BASE128
#undef ROUND4
#undef WRITE_USHORT
#undef WRITE_ULONG
#undef WRITE_SHORT
#undef WRITE_SFNT_BUF
#undef WRITE_SFNT_BUF_AT
#undef N_CONTOUR_STREAM
#undef N_POINTS_STREAM
#undef FLAG_STREAM
#undef GLYPH_STREAM
#undef COMPOSITE_STREAM
#undef BBOX_STREAM
#undef INSTRUCTION_STREAM
#else
typedef int sfwoff2_dummy_;
#endif