31#include FT_INTERNAL_DEBUG_H
32#include FT_INTERNAL_STREAM_H
33#include FT_TRUETYPE_TAGS_H
37#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
43#define BASE_GLYPH_SIZE 6
45#define COLR_HEADER_SIZE 14
48 typedef struct BaseGlyphRecord_
80#define FT_COMPONENT ttcolr
95 FT_ULong base_glyph_offset, layer_offset;
101 return FT_THROW( Invalid_File_Format );
119 if ( colr->version != 0 )
127 if ( colr->num_base_glyphs * BASE_GLYPH_SIZE >
136 if ( colr->num_layers * LAYER_SIZE >
table_size - layer_offset )
139 colr->base_glyphs = (
FT_Byte*)(
table + base_glyph_offset );
165 Colr* colr = (Colr*)
face->colr;
177 find_base_glyph_record(
FT_Byte* base_glyph_begin,
189 FT_Byte*
p = base_glyph_begin + mid * BASE_GLYPH_SIZE;
194 if ( gid < glyph_id )
196 else if (gid > glyph_id )
219 Colr* colr = (Colr*)
face->colr;
220 BaseGlyphRecord glyph_record;
234 if ( !find_base_glyph_record( colr->base_glyphs,
235 colr->num_base_glyphs,
240 if ( glyph_record.num_layers )
241 iterator->num_layers = glyph_record.num_layers;
245 offset = LAYER_SIZE * glyph_record.first_layer_index;
246 if (
offset + LAYER_SIZE * glyph_record.num_layers > colr->table_size )
259 ( *acolor_index != 0xFFFF &&
260 *acolor_index >=
face->palette_data.num_palette_entries ) )
309 FT_Int x_min, x_max, y_min, y_max;
363 dstSlot->
format = FT_GLYPH_FORMAT_BITMAP;
367 if ( color_index == 0xFFFF )
369 if (
face->have_foreground_color )
371 b =
face->foreground_color.blue;
372 g =
face->foreground_color.green;
373 r =
face->foreground_color.red;
378 if (
face->palette_data.palette_flags &&
379 (
face->palette_data.palette_flags[
face->palette_index] &
400 b =
face->palette[color_index].blue;
401 g =
face->palette[color_index].green;
402 r =
face->palette[color_index].red;
403 alpha =
face->palette[color_index].alpha;
419 int fb =
b *
fa / 255;
420 int fg =
g *
fa / 255;
421 int fr =
r *
fa / 255;
425 int bb =
dst[4 *
x + 0];
426 int bg =
dst[4 *
x + 1];
427 int br =
dst[4 *
x + 2];
428 int ba =
dst[4 *
x + 3];
static const WCHAR version[]
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define FT_PALETTE_FOR_DARK_BACKGROUND
#define FT_ALLOC(ptr, size)
#define FT_MEM_COPY(dest, source, count)
#define FT_MEM_ZERO(dest, count)
#define FT_GLYPH_OWN_BITMAP
ft_glyphslot_alloc_bitmap(FT_GlyphSlot slot, FT_ULong size)
ft_glyphslot_set_bitmap(FT_GlyphSlot slot, FT_Byte *buffer)
#define FT_FRAME_RELEASE(bytes)
#define FT_NEXT_USHORT(buffer)
#define FT_FRAME_EXTRACT(size, bytes)
#define FT_NEXT_ULONG(buffer)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLint GLint GLint GLint GLint x
GLclampf GLclampf GLclampf alpha
GLint GLint GLint GLint GLint GLint y
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLdouble GLdouble GLdouble GLdouble q
GLenum GLuint GLint GLenum face
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
static char memory[1024 *256]
FT_Slot_Internal internal
tt_face_free_colr(TT_Face face)
FT_BEGIN_HEADER tt_face_load_colr(TT_Face face, FT_Stream stream)
tt_face_get_colr_layer(TT_Face face, FT_UInt base_glyph, FT_UInt *aglyph_index, FT_UInt *acolor_index, FT_LayerIterator *iterator)
tt_face_colr_blend_layer(TT_Face face, FT_UInt color_index, FT_GlyphSlot dstSlot, FT_GlyphSlot srcSlot)