/**************************************************************************** * * ttcpal.c * * TrueType and OpenType color palette support (body). * * Copyright (C) 2018-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Originally written by Shao Yu Zhang <[email protected]>. * * This file is part of the FreeType project, and may only be used, * modified, and distributed under the terms of the FreeType project * license, LICENSE.TXT. By continuing to use, modify, or distribute * this file you indicate that you have read the license and * understand and accept it fully. * */ /************************************************************************** * * `CPAL' table specification: * * https://www.microsoft.com/typography/otspec/cpal.htm * */ #include <freetype/internal/ftdebug.h> #include <freetype/internal/ftstream.h> #include <freetype/tttags.h> #include <freetype/ftcolor.h> #ifdef TT_CONFIG_OPTION_COLOR_LAYERS #include "ttcpal.h" /* NOTE: These are the table sizes calculated through the specs. */ #define CPAL_V0_HEADER_BASE_SIZE … #define COLOR_SIZE … /* all data from `CPAL' not covered in FT_Palette_Data */ Cpal; /************************************************************************** * * The macro FT_COMPONENT is used in trace mode. It is an implicit * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log * messages during execution. */ #undef FT_COMPONENT #define FT_COMPONENT … FT_LOCAL_DEF( FT_Error ) tt_face_load_cpal( TT_Face face, FT_Stream stream ) { … } FT_LOCAL_DEF( void ) tt_face_free_cpal( TT_Face face ) { … } FT_LOCAL_DEF( FT_Error ) tt_face_palette_set( TT_Face face, FT_UInt palette_index ) { … } #else /* !TT_CONFIG_OPTION_COLOR_LAYERS */ /* ANSI C doesn't like empty source files */ typedef int tt_cpal_dummy_; #endif /* !TT_CONFIG_OPTION_COLOR_LAYERS */ /* EOF */