36#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
42#define BASE_GLYPH_SIZE 6U
44#define COLR_HEADER_SIZE 14U
47 typedef struct BaseGlyphRecord_
79#define FT_COMPONENT ttcolr
94 FT_ULong base_glyph_offset, layer_offset;
100 return FT_THROW( Invalid_File_Format );
118 if ( colr->version != 0 )
126 if ( colr->num_base_glyphs * BASE_GLYPH_SIZE >
135 if ( colr->num_layers * LAYER_SIZE >
table_size - layer_offset )
138 colr->base_glyphs = (
FT_Byte*)(
table + base_glyph_offset );
164 Colr* colr = (Colr*)
face->colr;
176 find_base_glyph_record(
FT_Byte* base_glyph_begin,
188 FT_Byte*
p = base_glyph_begin + mid * BASE_GLYPH_SIZE;
193 if ( gid < glyph_id )
195 else if (gid > glyph_id )
218 Colr* colr = (Colr*)
face->colr;
219 BaseGlyphRecord glyph_record;
233 if ( !find_base_glyph_record( colr->base_glyphs,
234 colr->num_base_glyphs,
239 if ( glyph_record.num_layers )
240 iterator->num_layers = glyph_record.num_layers;
244 offset = LAYER_SIZE * glyph_record.first_layer_index;
245 if (
offset + LAYER_SIZE * glyph_record.num_layers > colr->table_size )
258 ( *acolor_index != 0xFFFF &&
259 *acolor_index >=
face->palette_data.num_palette_entries ) )
308 FT_Int x_min, x_max, y_min, y_max;
362 dstSlot->
format = FT_GLYPH_FORMAT_BITMAP;
366 if ( color_index == 0xFFFF )
368 if (
face->have_foreground_color )
370 b =
face->foreground_color.blue;
371 g =
face->foreground_color.green;
372 r =
face->foreground_color.red;
377 if (
face->palette_data.palette_flags &&
378 (
face->palette_data.palette_flags[
face->palette_index] &
399 b =
face->palette[color_index].blue;
400 g =
face->palette[color_index].green;
401 r =
face->palette[color_index].red;
402 alpha =
face->palette[color_index].alpha;
418 int fb =
b *
fa / 255;
419 int fg =
g *
fa / 255;
420 int fr =
r *
fa / 255;
424 int bb =
dst[4 *
x + 0];
425 int bg =
dst[4 *
x + 1];
426 int br =
dst[4 *
x + 2];
427 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)