/**************************************************************************** * * ttsvg.c * * OpenType SVG Color (specification). * * Copyright (C) 2022-2023 by * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. * * 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. * */ /************************************************************************** * * 'SVG' table specification: * * https://docs.microsoft.com/en-us/typography/opentype/spec/svg * */ #include <ft2build.h> #include <freetype/internal/ftstream.h> #include <freetype/internal/ftobjs.h> #include <freetype/internal/ftdebug.h> #include <freetype/tttags.h> #include <freetype/ftgzip.h> #include <freetype/otsvg.h> #ifdef FT_CONFIG_OPTION_SVG #include "ttsvg.h" /* NOTE: These table sizes are given by the specification. */ #define SVG_TABLE_HEADER_SIZE … #define SVG_DOCUMENT_RECORD_SIZE … #define SVG_DOCUMENT_LIST_MINIMUM_SIZE … #define SVG_MINIMUM_SIZE … Svg; /************************************************************************** * * The macro FT_COMPONENT is used in trace mode. It is an implicit * parameter of the FT_TRACE() and FT_ERROR() macros, usued to print/log * messages during execution. */ #undef FT_COMPONENT #define FT_COMPONENT … FT_LOCAL_DEF( FT_Error ) tt_face_load_svg( TT_Face face, FT_Stream stream ) { … } FT_LOCAL_DEF( void ) tt_face_free_svg( TT_Face face ) { … } Svg_doc; static Svg_doc extract_svg_doc( FT_Byte* stream ) { … } static FT_Int compare_svg_doc( Svg_doc doc, FT_UInt glyph_index ) { … } static FT_Error find_doc( FT_Byte* document_records, FT_UShort num_entries, FT_UInt glyph_index, FT_ULong *doc_offset, FT_ULong *doc_length, FT_UShort *start_glyph, FT_UShort *end_glyph ) { … } FT_LOCAL_DEF( FT_Error ) tt_face_load_svg_doc( FT_GlyphSlot glyph, FT_UInt glyph_index ) { … } #else /* !FT_CONFIG_OPTION_SVG */ /* ANSI C doesn't like empty source files */ typedef int tt_svg_dummy_; #endif /* !FT_CONFIG_OPTION_SVG */ /* END */