25#ifdef FT_CONFIG_OPTION_USE_BROTLI
27#include <brotli/decode.h>
39#define FT_COMPONENT sfwoff2
42#define READ_255USHORT( var ) FT_SET_ERROR( Read255UShort( stream, &var ) )
44#define READ_BASE128( var ) FT_SET_ERROR( ReadBase128( stream, &var ) )
47#define ROUND4( var ) ( ( var + 3 ) & ~3UL )
49#define WRITE_USHORT( p, v ) \
52 *(p)++ = (FT_Byte)( (v) >> 8 ); \
53 *(p)++ = (FT_Byte)( (v) >> 0 ); \
57#define WRITE_ULONG( p, v ) \
60 *(p)++ = (FT_Byte)( (v) >> 24 ); \
61 *(p)++ = (FT_Byte)( (v) >> 16 ); \
62 *(p)++ = (FT_Byte)( (v) >> 8 ); \
63 *(p)++ = (FT_Byte)( (v) >> 0 ); \
67#define WRITE_SHORT( p, v ) \
70 *(p)++ = (FT_Byte)( (v) >> 8 ); \
71 *(p)++ = (FT_Byte)( (v) >> 0 ); \
75#define WRITE_SFNT_BUF( buf, s ) \
76 write_buf( &sfnt, sfnt_size, &dest_offset, buf, s, memory )
78#define WRITE_SFNT_BUF_AT( offset, buf, s ) \
79 write_buf( &sfnt, sfnt_size, &offset, buf, s, memory )
81#define N_CONTOUR_STREAM 0
82#define N_POINTS_STREAM 1
85#define COMPOSITE_STREAM 4
87#define INSTRUCTION_STREAM 6
117 else if ( tag1 < tag2 )
128 const FT_Byte oneMoreByteCode1 = 255;
129 const FT_Byte oneMoreByteCode2 = 254;
141 if (
code == wordCode )
146 *
value = result_short;
149 else if (
code == oneMoreByteCode1 )
153 *
value = result_byte + lowestUCode;
156 else if (
code == oneMoreByteCode2 )
160 *
value = result_byte + lowestUCode * 2;
181 for (
i = 0;
i < 5; ++
i )
188 if (
i == 0 &&
code == 0x80 )
192 if (
result & 0xfe000000 )
198 if ( (
code & 0x80 ) == 0 )
231 FT_TRACE6((
"Reallocating %lu to %lu.\n",
263 FT_Byte zeroes[] = { 0, 0, 0 };
267 if ( dest_offset + 3 < dest_offset )
270 pad_bytes =
ROUND4( dest_offset ) - dest_offset;
278 *out_offset = dest_offset;
294 for (
i = 0;
i < aligned_size;
i += 4 )
301 if (
size != aligned_size )
304 for (
i = aligned_size ;
i <
size; ++
i )
319#ifdef FT_CONFIG_OPTION_USE_BROTLI
324 BrotliDecoderResult
result;
327 result = BrotliDecoderDecompress( src_size,
332 if (
result != BROTLI_DECODER_RESULT_SUCCESS ||
333 uncompressed_size != dst_size )
335 FT_ERROR((
"woff2_decompress: Stream length mismatch.\n" ));
339 FT_TRACE2((
"woff2_decompress: Brotli stream decompressed.\n" ));
344 FT_ERROR((
"woff2_decompress: Brotli support not available.\n" ));
345 return FT_THROW( Unimplemented_Feature );
359 for (
i = 0;
i < num_tables;
i++ )
383 *num_hmetrics = num_metrics;
395 return (
flag & 1 ) ? base_val : -base_val;
443 for (
i = 0;
i < n_points; ++
i )
452 else if (
flag < 120 )
454 else if (
flag < 124 )
460 if ( triplet_index + data_bytes >
in_size ||
461 triplet_index + data_bytes < triplet_index )
468 ( (
flag & 14 ) << 7 ) +
in[triplet_index] );
470 else if (
flag < 20 )
473 ( ( (
flag - 10 ) & 14 ) << 7 ) +
477 else if (
flag < 84 )
480 b1 =
in[triplet_index];
482 1 + ( b0 & 0x30 ) + (
b1 >> 4 ) );
484 1 + ( ( b0 & 0x0c ) << 2 ) + (
b1 & 0x0f ) );
486 else if (
flag < 120 )
490 1 + ( ( b0 / 12 ) << 8 ) +
in[triplet_index] );
492 1 + ( ( ( b0 % 12 ) >> 2 ) << 8 ) +
493 in[triplet_index + 1] );
495 else if (
flag < 124 )
497 b2 =
in[triplet_index + 1];
499 (
in[triplet_index] << 4 ) + (
b2 >> 4 ) );
501 ( (
b2 & 0x0f ) << 8 ) +
in[triplet_index + 2] );
506 (
in[triplet_index] << 8 ) +
507 in[triplet_index + 1] );
509 (
in[triplet_index + 2] << 8 ) +
510 in[triplet_index + 3] );
513 triplet_index += data_bytes;
526 *in_bytes_used = triplet_index;
541 FT_UInt flag_offset = 10 + ( 2 * n_contours ) + 2 + instruction_len;
555 for (
i = 0;
i < n_points; ++
i )
566 else if (
dx > -256 &&
dx < 256 )
576 else if (
dy > -256 &&
dy < 256 )
584 if (
flag == last_flag && repeat_count != 255 )
591 if ( repeat_count != 0 )
593 if ( flag_offset >= dst_size )
596 dst[flag_offset++] = repeat_count;
598 if ( flag_offset >= dst_size )
610 if ( repeat_count != 0 )
612 if ( flag_offset >= dst_size )
615 dst[flag_offset++] = repeat_count;
618 xy_bytes = x_bytes + y_bytes;
619 if ( xy_bytes < x_bytes ||
620 flag_offset + xy_bytes < flag_offset ||
621 flag_offset + xy_bytes > dst_size )
624 x_offset = flag_offset;
625 y_offset = flag_offset + x_bytes;
629 for (
i = 0;
i < n_points; ++
i )
637 else if (
dx > -256 &&
dx < 256 )
650 else if (
dy > -256 &&
dy < 256 )
662 *glyph_size = y_offset;
692 for (
i = 1;
i < n_points; ++
i )
758 *have_instructions = we_have_inst;
786 const FT_ULong offset_size = index_format ? 4 : 2;
789 if ( ( loca_values_size << 2 ) >> 2 != loca_values_size )
792 loca_buf_size = loca_values_size * offset_size;
797 for (
i = 0;
i < loca_values_size;
i++ )
815 *out_offset = dest_offset;
858 const FT_ULong glyf_start = *out_offset;
879 FT_TRACE4((
"num_glyphs = %u; index_format = %u\n",
880 num_glyphs, index_format ));
882 info->num_glyphs = num_glyphs;
888 expected_loca_length = ( index_format ? 4 : 2 ) *
890 if (
info->loca_table->dst_length != expected_loca_length )
893 offset = ( 2 + num_substreams ) * 4;
894 if (
offset >
info->glyf_table->TransformLength )
897 for (
i = 0;
i < num_substreams; ++
i )
904 if ( substream_size >
info->glyf_table->TransformLength -
offset )
909 substreams[
i].
size = substream_size;
911 FT_TRACE5((
" Substream %d: offset = %lu; size = %lu;\n",
923 bitmap_length = ( ( num_glyphs + 31U ) >> 5 ) << 2;
933 for (
i = 0;
i < num_glyphs; ++
i )
944 bbox_offset = bbox_bitmap_offset + (
i >> 3 );
948 if ( bbox_bitmap & ( 0x80 >> (
i & 7 ) ) )
957 if ( n_contours == 0xffff )
974 &have_instructions) )
977 if ( have_instructions )
985 size_needed = 12 + composite_size + instruction_size;
986 if ( glyph_buf_size < size_needed )
990 glyph_buf_size = size_needed;
993 pointer = glyph_buf + glyph_size;
1015 glyph_size += composite_size;
1017 if ( have_instructions )
1019 pointer = glyph_buf + glyph_size;
1028 glyph_size += instruction_size;
1031 else if ( n_contours > 0 )
1056 for (
j = 0;
j < n_contours; ++
j )
1060 n_points_arr[
j] = n_points_contour;
1062 if ( total_n_points + n_points_contour < total_n_points )
1064 total_n_points += n_points_contour;
1068 flag_size = total_n_points;
1083 triplet_bytes_used = 0;
1086 points_size = total_n_points;
1095 &triplet_bytes_used ) )
1107 if ( total_n_points >= ( 1 << 27 ) )
1111 ( 2 * n_contours ) +
1112 ( 5 * total_n_points ) +
1114 if ( glyph_buf_size < size_needed )
1118 glyph_buf_size = size_needed;
1121 pointer = glyph_buf + glyph_size;
1143 pointer = glyph_buf + glyph_size;
1146 for ( contour_ix = 0; contour_ix < n_contours; ++contour_ix )
1148 end_point += n_points_arr[contour_ix];
1149 if ( end_point >= 65536 )
1164 glyph_size += instruction_size;
1184 FT_ERROR((
"Empty glyph has a bbox.\n" ));
1189 loca_values[
i] = dest_offset - glyf_start;
1200 if ( n_contours > 0 )
1204 info->glyf_table->dst_length = dest_offset -
info->glyf_table->dst_offset;
1205 info->loca_table->dst_offset = dest_offset;
1208 loca_values[num_glyphs] =
info->glyf_table->dst_length;
1220 info->loca_table->dst_length = dest_offset -
info->loca_table->dst_offset;
1223 FT_TRACE4((
" dst_offset = %lu\n",
info->loca_table->dst_offset ));
1224 FT_TRACE4((
" dst_length = %lu\n",
info->loca_table->dst_length ));
1225 FT_TRACE4((
" checksum = %09lx\n", *loca_checksum ));
1229 *out_offset = dest_offset;
1282 FT_ERROR((
"`maxp' table is missing.\n" ));
1288 FT_ERROR((
"`head' table is missing.\n" ));
1292 if ( !
info->loca_table )
1294 FT_ERROR((
"`loca' table is missing.\n" ));
1305 info->num_glyphs = num_glyphs;
1315 offset_size = index_format ? 4 : 2;
1321 loca_offset =
info->loca_table->src_offset;
1323 for (
i = 0;
i < num_glyphs; ++
i )
1328 loca_offset += offset_size;
1340 glyf_offset = (
FT_ULong)( glyf_offset_short );
1341 glyf_offset = glyf_offset << 1;
1344 glyf_offset +=
info->glyf_table->src_offset;
1370 FT_ULong dest_offset = *out_offset;
1373 FT_Bool has_proportional_lsbs, has_monospace_lsbs;
1386 has_proportional_lsbs = ( hmtx_flags & 1 ) == 0;
1387 has_monospace_lsbs = ( hmtx_flags & 2 ) == 0;
1390 if ( ( hmtx_flags & 0xFC ) != 0 )
1394 if ( has_proportional_lsbs && has_monospace_lsbs )
1398 if ( ( num_hmetrics > num_glyphs ) ||
1399 ( num_hmetrics < 1 ) )
1403 if ( num_hmetrics < 1 )
1411 for (
i = 0;
i < num_hmetrics;
i++ )
1419 advance_widths[
i] = advance_width;
1423 for (
i = 0;
i < num_hmetrics;
i++ )
1428 if ( has_proportional_lsbs )
1440 for (
i = num_hmetrics;
i < num_glyphs;
i++ )
1445 if ( has_monospace_lsbs )
1457 hmtx_table_size = 2 * num_hmetrics + 2 * num_glyphs;
1463 for (
i = 0;
i < num_glyphs;
i++ )
1465 if (
i < num_hmetrics )
1483 *out_offset = dest_offset;
1524 FT_ULong dest_offset = 12 + num_tables * 16UL;
1543 FT_ERROR((
"One of `glyf'/`loca' tables missing.\n" ));
1553 FT_ERROR((
"Transformation mismatch"
1554 " between `glyf' and `loca' table." ));
1571 for ( nn = 0; nn < num_tables; nn++ )
1576 FT_TRACE3((
"Seeking to %ld with table size %ld.\n",
1587 if (
table.src_offset +
table.src_length > transformed_buf_size )
1597 info->num_hmetrics = num_hmetrics;
1605 if (
table.src_length < 12 )
1608 buf_cursor = transformed_buf +
table.src_offset + 8;
1613 table.dst_offset = dest_offset;
1620 table.src_length ) )
1625 FT_TRACE3((
"This table is transformed.\n" ));
1629 is_glyf_xform =
TRUE;
1630 table.dst_offset = dest_offset;
1651 if ( !is_glyf_xform )
1657 table.dst_offset = dest_offset;
1673 FT_ERROR((
"Unknown table transform.\n" ));
1680 buf_cursor = &table_entry[0];
1697 FT_ERROR((
"Table was partially written.\n" ));
1704 if ( !
info->head_table )
1706 FT_ERROR((
"`head' table is missing.\n" ));
1710 if (
info->head_table->dst_length < 12 )
1713 buf_cursor =
sfnt +
info->head_table->dst_offset + 8;
1714 font_checksum = 0xB1B0AFBA - font_checksum;
1718 FT_TRACE2((
"Final checksum = %09lx.\n", font_checksum ));
1752 FT_Int* face_instance_index,
1774 FT_UInt32 file_offset;
1786#define FT_STRUCTURE WOFF2_HeaderRec
1809 face_index =
FT_ABS( *face_instance_index ) & 0xFFFF;
1842 FT_ERROR((
"woff2_open_font: invalid WOFF2 header\n" ));
1846 FT_TRACE2((
"woff2_open_font: WOFF2 Header is valid.\n" ));
1857 " tag flags transform origLen transformLen offset\n"
1858 " -----------------------------------------------------------\n" ));
1869 if ( (
table->FlagByte & 0x3f ) == 0x3f )
1879 FT_ERROR((
"woff2_open_font: Unknown table tag." ));
1886 xform_version = (
table->FlagByte >> 6 ) & 0x03;
1891 if ( xform_version == 0 )
1894 else if ( xform_version != 0 )
1897 flags |= xform_version;
1911 FT_ERROR((
"woff2_open_font: Invalid loca `transformLength'.\n" ));
1917 if ( src_offset +
table->TransformLength < src_offset )
1919 FT_ERROR((
"woff2_open_font: invalid WOFF2 table directory.\n" ));
1924 table->src_offset = src_offset;
1926 src_offset +=
table->TransformLength;
1929 FT_TRACE2((
" %c%c%c%c %08d %08d %08ld %08ld %08ld\n",
1934 table->FlagByte & 0x3f,
1935 (
table->FlagByte >> 6 ) & 0x03,
1937 table->TransformLength,
1938 table->src_offset ));
1954 FT_TRACE2((
"Table directory parsed.\n" ));
1962 FT_TRACE2((
"Font is a TTC, reading collection directory.\n" ));
1988 for ( nn = 0; nn < woff2.
num_fonts; nn++ )
2001 FT_TRACE5((
"Number of tables in font %d: %d\n",
2004#ifdef FT_DEBUG_LEVEL_TRACE
2024 FT_ERROR((
"woff2_open_font: invalid table index\n" ));
2033 loca_index = table_index;
2035 glyf_index = table_index;
2038#ifdef FT_DEBUG_LEVEL_TRACE
2044 if ( glyf_index > 0 || loca_index > 0 )
2046 if ( glyf_index > loca_index ||
2047 loca_index - glyf_index != 1 )
2056 FT_TRACE2((
"WOFF2 collection directory is valid.\n" ));
2066 if ( file_offset > woff2.
length )
2101 if ( *face_instance_index < 0 )
2106 if ( *face_instance_index >= 0 )
2126 FT_TRACE4((
"Storing tables for TTC face index %d.\n", face_index ));
2127 for ( nn = 0; nn < ttc_font->
num_tables; nn++ )
2136 for ( nn = 0; nn < ttc_font->
num_tables; nn++ )
2137 indices[nn] = temp_indices[nn];
2156 sfnt_size = woff2.
length << 6;
2161 if (sfnt_size >= (1 << 26))
2162 sfnt_size = 1 << 26;
2164#ifdef FT_DEBUG_LEVEL_TRACE
2166 FT_TRACE4((
"adjusting estimate of uncompressed font size"
2183 FT_UInt searchRange, entrySelector, rangeShift,
x;
2195 searchRange = ( 1 << entrySelector ) * 16;
2196 rangeShift = ( woff2.
num_tables * 16 ) - searchRange;
2220 FT_ERROR((
"woff2_open_font: SFNT table lengths are too large.\n" ));
2256 FT_TRACE5((
"Trimming sfnt stream from %lu to %lu.\n",
2274 face->root.stream = sfnt_stream;
2275 face->root.face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM;
2278 if ( *face_instance_index >= 0 )
2279 *face_instance_index = 0;
2281 *face_instance_index = -1;
2283 FT_TRACE2((
"woff2_open_font: SFNT synthesized.\n" ));
2296 for ( nn = 0; nn < woff2.
num_fonts; nn++ )
2319#undef READ_255USHORT
2325#undef WRITE_SFNT_BUF
2326#undef WRITE_SFNT_BUF_AT
2328#undef N_CONTOUR_STREAM
2329#undef N_POINTS_STREAM
2332#undef COMPOSITE_STREAM
2334#undef INSTRUCTION_STREAM
#define FT_CALLBACK_DEF(x)
static cab_ULONG checksum(const cab_UBYTE *data, cab_UWORD bytes, cab_ULONG csum)
struct nls_table * tables
#define FT_FACE_FLAG_EXTERNAL_STREAM
#define FT_ASSERT(condition)
#define FT_ERROR(varformat)
#define FT_TRACE5(varformat)
#define FT_TRACE3(varformat)
#define FT_TRACE6(varformat)
#define FT_TRACE2(varformat)
#define FT_TRACE4(varformat)
#define FT_REALLOC(ptr, cursz, newsz)
#define FT_NEW_ARRAY(ptr, count)
#define FT_ALLOC(ptr, size)
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
#define FT_FRAME_ENTER(size)
#define FT_READ_USHORT(var)
#define FT_STREAM_SEEK(position)
#define FT_READ_ULONG(var)
FT_Stream_Close(FT_Stream stream)
#define FT_FRAME_ULONG(f)
#define FT_READ_BYTE(var)
#define FT_FRAME_SKIP_BYTES(count)
#define FT_STREAM_READ_FIELDS(fields, object)
#define FT_STREAM_SKIP(distance)
FT_Stream_Free(FT_Stream stream, FT_Int external)
#define FT_STREAM_READ(buffer, count)
#define FT_FRAME_START(size)
FT_Stream_OpenMemory(FT_Stream stream, const FT_Byte *base, FT_ULong size)
#define FT_FRAME_USHORT(f)
#define FT_READ_SHORT(var)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei GLenum const GLvoid * indices
GLsizei const GLvoid * pointer
GLenum GLuint GLint GLenum face
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLboolean GLboolean GLboolean GLboolean a
GLsizei const GLfloat * points
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static CRYPT_DATA_BLOB b2[]
static CRYPT_DATA_BLOB b1[]
static char memory[1024 *256]
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG in_size
static FT_Error ReadBase128(FT_Stream stream, FT_ULong *value)
static FT_Error woff2_decompress(FT_Byte *dst, FT_ULong dst_size, const FT_Byte *src, FT_ULong src_size)
#define WRITE_ULONG(p, v)
static void compute_bbox(FT_ULong n_points, const WOFF2_Point points, FT_Byte *dst, FT_UShort *src_x_min)
static FT_Error get_x_mins(FT_Stream stream, WOFF2_Table *tables, FT_UShort num_tables, WOFF2_Info info, FT_Memory memory)
#define INSTRUCTION_STREAM
static FT_Error read_num_hmetrics(FT_Stream stream, FT_UShort *num_hmetrics)
#define READ_255USHORT(var)
static WOFF2_Table find_table(WOFF2_Table *tables, FT_UShort num_tables, FT_ULong tag)
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 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_Int safe_int_addition(FT_Int a, FT_Int b, FT_Int *result)
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_ULong compute_ULong_sum(FT_Byte *buf, FT_ULong size)
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)
#define WRITE_SFNT_BUF(buf, s)
static FT_Error pad4(FT_Byte **sfnt_bytes, FT_ULong *sfnt_size, FT_ULong *out_offset, FT_Memory memory)
compare_tags(const void *a, const void *b)
static FT_Error store_points(FT_ULong n_points, const WOFF2_Point points, FT_UShort n_contours, FT_UShort instruction_len, FT_Byte *dst, FT_ULong dst_size, FT_ULong *glyph_size)
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)
#define WRITE_SFNT_BUF_AT(offset, buf, s)
static FT_Error Read255UShort(FT_Stream stream, FT_UShort *value)
#define READ_BASE128(var)
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)
#define WRITE_SHORT(p, v)
static void stream_close(FT_Stream stream)
static FT_Int with_sign(FT_Byte flag, FT_Int base_val)
#define WRITE_USHORT(p, v)
static FT_Error compositeGlyph_size(FT_Stream stream, FT_ULong offset, FT_ULong *size, FT_Bool *have_instructions)
woff2_open_font(FT_Stream stream, TT_Face face, FT_Int *face_instance_index, FT_Long *num_faces)
#define GLYF_THIS_Y_IS_SAME
#define FLAG_WE_HAVE_AN_X_AND_Y_SCALE
#define WOFF2_FLAGS_TRANSFORM
#define WOFF2_DEFAULT_MAX_SIZE
#define FLAG_ARG_1_AND_2_ARE_WORDS
#define FLAG_WE_HAVE_A_TWO_BY_TWO
#define FLAG_WE_HAVE_A_SCALE
#define WOFF2_DEFAULT_GLYPH_BUF
#define GLYF_THIS_X_IS_SAME
#define FLAG_MORE_COMPONENTS
#define CONTOUR_OFFSET_END_POINT
#define FLAG_WE_HAVE_INSTRUCTIONS
FT_Stream_CloseFunc close
FT_UShort * table_indices
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList