/**************************************************************************** * * gxvtrak.c * * TrueTypeGX/AAT trak table validation (body). * * Copyright (C) 2004-2023 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * * 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. * */ /**************************************************************************** * * gxvalid is derived from both gxlayout module and otvalid module. * Development of gxlayout is supported by the Information-technology * Promotion Agency(IPA), Japan. * */ #include "gxvalid.h" #include "gxvcommn.h" /************************************************************************** * * 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 … /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** Data and Types *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ /* * referred track table format specification: * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6trak.html * last update was 1996. * ---------------------------------------------- * [MINIMUM HEADER]: GXV_TRAK_SIZE_MIN * version (fixed: 32bit) = 0x00010000 * format (uint16: 16bit) = 0 is only defined (1996) * horizOffset (uint16: 16bit) * vertOffset (uint16: 16bit) * reserved (uint16: 16bit) = 0 * ---------------------------------------------- * [VARIABLE BODY]: * horizData * header ( 2 + 2 + 4 * trackTable + nTracks * ( 4 + 2 + 2 ) * sizeTable + nSizes * 4 ) * ---------------------------------------------- * vertData * header ( 2 + 2 + 4 * trackTable + nTracks * ( 4 + 2 + 2 ) * sizeTable + nSizes * 4 ) * ---------------------------------------------- */ GXV_trak_Data; #define GXV_TRAK_DATA( FIELD ) … /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** UTILITY FUNCTIONS *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ static void gxv_trak_trackTable_validate( FT_Bytes table, FT_Bytes limit, FT_UShort nTracks, GXV_Validator gxvalid ) { … } static void gxv_trak_trackData_validate( FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid ) { … } /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** trak TABLE *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ FT_LOCAL_DEF( void ) gxv_trak_validate( FT_Bytes table, FT_Face face, FT_Validator ftvalid ) { … } /* END */