2018-06-03 09:01:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* gxvcommn.c
|
|
|
|
*
|
|
|
|
* TrueTypeGX/AAT common tables validation (body).
|
|
|
|
*
|
2021-01-17 07:18:48 +01:00
|
|
|
* Copyright (C) 2004-2021 by
|
2018-06-03 09:01:17 +02:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
#include "gxvcommn.h"
|
|
|
|
|
|
|
|
|
2018-06-03 09:01:17 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2005-08-24 06:31:31 +02:00
|
|
|
#undef FT_COMPONENT
|
2018-08-15 18:13:17 +02:00
|
|
|
#define FT_COMPONENT gxvcommon
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** 16bit offset sorter *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
static int
|
|
|
|
gxv_compare_ushort_offset( FT_UShort* a,
|
|
|
|
FT_UShort* b )
|
|
|
|
{
|
|
|
|
if ( *a < *b )
|
2008-08-23 21:54:06 +02:00
|
|
|
return -1;
|
2005-08-24 06:31:31 +02:00
|
|
|
else if ( *a > *b )
|
2008-08-23 21:54:06 +02:00
|
|
|
return 1;
|
2005-08-24 06:31:31 +02:00
|
|
|
else
|
2008-08-23 21:54:06 +02:00
|
|
|
return 0;
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
FT_LOCAL_DEF( void )
|
2005-08-24 06:31:31 +02:00
|
|
|
gxv_set_length_by_ushort_offset( FT_UShort* offset,
|
|
|
|
FT_UShort** length,
|
|
|
|
FT_UShort* buff,
|
|
|
|
FT_UInt nmemb,
|
|
|
|
FT_UShort limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_UInt i;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
for ( i = 0; i < nmemb; i++ )
|
|
|
|
*(length[i]) = 0;
|
|
|
|
|
|
|
|
for ( i = 0; i < nmemb; i++ )
|
|
|
|
buff[i] = offset[i];
|
|
|
|
buff[nmemb] = limit;
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
ft_qsort( buff, ( nmemb + 1 ), sizeof ( FT_UShort ),
|
2005-08-24 06:31:31 +02:00
|
|
|
( int(*)(const void*, const void*) )gxv_compare_ushort_offset );
|
|
|
|
|
|
|
|
if ( buff[nmemb] > limit )
|
|
|
|
FT_INVALID_OFFSET;
|
|
|
|
|
|
|
|
for ( i = 0; i < nmemb; i++ )
|
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_UInt j;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
for ( j = 0; j < nmemb; j++ )
|
|
|
|
if ( buff[j] == offset[i] )
|
|
|
|
break;
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( j == nmemb )
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_INVALID_OFFSET;
|
|
|
|
|
2005-09-28 09:34:45 +02:00
|
|
|
*(length[i]) = (FT_UShort)( buff[j + 1] - buff[j] );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
if ( 0 != offset[i] && 0 == *(length[i]) )
|
|
|
|
FT_INVALID_OFFSET;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** 32bit offset sorter *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
static int
|
|
|
|
gxv_compare_ulong_offset( FT_ULong* a,
|
|
|
|
FT_ULong* b )
|
|
|
|
{
|
|
|
|
if ( *a < *b )
|
2008-08-23 21:54:06 +02:00
|
|
|
return -1;
|
2005-08-24 06:31:31 +02:00
|
|
|
else if ( *a > *b )
|
2008-08-23 21:54:06 +02:00
|
|
|
return 1;
|
2005-08-24 06:31:31 +02:00
|
|
|
else
|
2008-08-23 21:54:06 +02:00
|
|
|
return 0;
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
FT_LOCAL_DEF( void )
|
2005-08-24 06:31:31 +02:00
|
|
|
gxv_set_length_by_ulong_offset( FT_ULong* offset,
|
|
|
|
FT_ULong** length,
|
|
|
|
FT_ULong* buff,
|
|
|
|
FT_UInt nmemb,
|
|
|
|
FT_ULong limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid)
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_UInt i;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
for ( i = 0; i < nmemb; i++ )
|
|
|
|
*(length[i]) = 0;
|
|
|
|
|
|
|
|
for ( i = 0; i < nmemb; i++ )
|
|
|
|
buff[i] = offset[i];
|
|
|
|
buff[nmemb] = limit;
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
ft_qsort( buff, ( nmemb + 1 ), sizeof ( FT_ULong ),
|
2005-08-24 06:31:31 +02:00
|
|
|
( int(*)(const void*, const void*) )gxv_compare_ulong_offset );
|
|
|
|
|
|
|
|
if ( buff[nmemb] > limit )
|
|
|
|
FT_INVALID_OFFSET;
|
|
|
|
|
|
|
|
for ( i = 0; i < nmemb; i++ )
|
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_UInt j;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
for ( j = 0; j < nmemb; j++ )
|
|
|
|
if ( buff[j] == offset[i] )
|
|
|
|
break;
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( j == nmemb )
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_INVALID_OFFSET;
|
|
|
|
|
|
|
|
*(length[i]) = buff[j + 1] - buff[j];
|
|
|
|
|
|
|
|
if ( 0 != offset[i] && 0 == *(length[i]) )
|
|
|
|
FT_INVALID_OFFSET;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** scan value array and get min & max *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
FT_LOCAL_DEF( void )
|
2005-08-24 06:31:31 +02:00
|
|
|
gxv_array_getlimits_byte( FT_Bytes table,
|
|
|
|
FT_Bytes limit,
|
|
|
|
FT_Byte* min,
|
|
|
|
FT_Byte* max,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_Bytes p = table;
|
|
|
|
|
|
|
|
|
|
|
|
*min = 0xFF;
|
|
|
|
*max = 0x00;
|
|
|
|
|
|
|
|
while ( p < limit )
|
|
|
|
{
|
|
|
|
FT_Byte val;
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_LIMIT_CHECK( 1 );
|
|
|
|
val = FT_NEXT_BYTE( p );
|
|
|
|
|
* src/base/Jamfile: adding src/base/ftgxval.c
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c, src/gxvalid/gxvfeat.c,
src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c,
src/gxvalid/gxvmort.c, src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c, src/gxvalid/gxvmort5.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/sfnt/sfdriver.c, src/truetype/ttgload.c:
removing _many_ compiler warnings when compiling with Visual C++
at maximum level (/W4)
2005-09-23 15:22:10 +02:00
|
|
|
*min = (FT_Byte)FT_MIN( *min, val );
|
|
|
|
*max = (FT_Byte)FT_MAX( *max, val );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
gxvalid->subtable_length = (FT_ULong)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
FT_LOCAL_DEF( void )
|
2005-08-24 06:31:31 +02:00
|
|
|
gxv_array_getlimits_ushort( FT_Bytes table,
|
|
|
|
FT_Bytes limit,
|
|
|
|
FT_UShort* min,
|
|
|
|
FT_UShort* max,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_Bytes p = table;
|
|
|
|
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
*min = 0xFFFFU;
|
2005-08-24 06:31:31 +02:00
|
|
|
*max = 0x0000;
|
|
|
|
|
|
|
|
while ( p < limit )
|
|
|
|
{
|
|
|
|
FT_UShort val;
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_LIMIT_CHECK( 2 );
|
|
|
|
val = FT_NEXT_USHORT( p );
|
|
|
|
|
2005-09-28 09:34:45 +02:00
|
|
|
*min = (FT_Byte)FT_MIN( *min, val );
|
|
|
|
*max = (FT_Byte)FT_MAX( *max, val );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
gxvalid->subtable_length = (FT_ULong)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** BINSEARCHHEADER *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
typedef struct GXV_BinSrchHeader_
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_UShort unitSize;
|
|
|
|
FT_UShort nUnits;
|
|
|
|
FT_UShort searchRange;
|
|
|
|
FT_UShort entrySelector;
|
|
|
|
FT_UShort rangeShift;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
} GXV_BinSrchHeader;
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gxv_BinSrchHeader_check_consistency( GXV_BinSrchHeader* binSrchHeader,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_UShort searchRange;
|
|
|
|
FT_UShort entrySelector;
|
|
|
|
FT_UShort rangeShift;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
if ( binSrchHeader->unitSize == 0 )
|
|
|
|
FT_INVALID_DATA;
|
|
|
|
|
|
|
|
if ( binSrchHeader->nUnits == 0 )
|
|
|
|
{
|
|
|
|
if ( binSrchHeader->searchRange == 0 &&
|
|
|
|
binSrchHeader->entrySelector == 0 &&
|
|
|
|
binSrchHeader->rangeShift == 0 )
|
|
|
|
return;
|
|
|
|
else
|
|
|
|
FT_INVALID_DATA;
|
|
|
|
}
|
|
|
|
|
|
|
|
for ( searchRange = 1, entrySelector = 1;
|
2005-08-31 18:29:51 +02:00
|
|
|
( searchRange * 2 ) <= binSrchHeader->nUnits &&
|
|
|
|
searchRange < 0x8000U;
|
2005-08-24 06:31:31 +02:00
|
|
|
searchRange *= 2, entrySelector++ )
|
|
|
|
;
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
entrySelector--;
|
* src/base/Jamfile: adding src/base/ftgxval.c
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c, src/gxvalid/gxvfeat.c,
src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c,
src/gxvalid/gxvmort.c, src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c, src/gxvalid/gxvmort5.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/sfnt/sfdriver.c, src/truetype/ttgload.c:
removing _many_ compiler warnings when compiling with Visual C++
at maximum level (/W4)
2005-09-23 15:22:10 +02:00
|
|
|
searchRange = (FT_UShort)( searchRange * binSrchHeader->unitSize );
|
|
|
|
rangeShift = (FT_UShort)( binSrchHeader->nUnits * binSrchHeader->unitSize
|
|
|
|
- searchRange );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
if ( searchRange != binSrchHeader->searchRange ||
|
|
|
|
entrySelector != binSrchHeader->entrySelector ||
|
|
|
|
rangeShift != binSrchHeader->rangeShift )
|
|
|
|
{
|
|
|
|
GXV_TRACE(( "Inconsistency found in BinSrchHeader\n" ));
|
|
|
|
GXV_TRACE(( "originally: unitSize=%d, nUnits=%d, "
|
|
|
|
"searchRange=%d, entrySelector=%d, "
|
|
|
|
"rangeShift=%d\n",
|
|
|
|
binSrchHeader->unitSize, binSrchHeader->nUnits,
|
|
|
|
binSrchHeader->searchRange, binSrchHeader->entrySelector,
|
|
|
|
binSrchHeader->rangeShift ));
|
|
|
|
GXV_TRACE(( "calculated: unitSize=%d, nUnits=%d, "
|
|
|
|
"searchRange=%d, entrySelector=%d, "
|
|
|
|
"rangeShift=%d\n",
|
|
|
|
binSrchHeader->unitSize, binSrchHeader->nUnits,
|
|
|
|
searchRange, entrySelector, rangeShift ));
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* parser & validator of BinSrchHeader
|
|
|
|
* which is used in LookupTable format 2, 4, 6.
|
|
|
|
*
|
|
|
|
* Essential parameters (unitSize, nUnits) are returned by
|
|
|
|
* given pointer, others (searchRange, entrySelector, rangeShift)
|
2005-08-31 18:29:51 +02:00
|
|
|
* can be calculated by essential parameters, so they are just
|
2005-08-24 06:31:31 +02:00
|
|
|
* validated and discarded.
|
|
|
|
*
|
|
|
|
* However, wrong values in searchRange, entrySelector, rangeShift
|
|
|
|
* won't cause fatal errors, because these parameters might be
|
|
|
|
* only used in old m68k font driver in MacOS.
|
|
|
|
* -- suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
|
|
|
|
*/
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( void )
|
|
|
|
gxv_BinSrchHeader_validate( FT_Bytes table,
|
|
|
|
FT_Bytes limit,
|
|
|
|
FT_UShort* unitSize_p,
|
|
|
|
FT_UShort* nUnits_p,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_Bytes p = table;
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_BinSrchHeader binSrchHeader;
|
|
|
|
|
|
|
|
|
|
|
|
GXV_NAME_ENTER( "BinSrchHeader validate" );
|
|
|
|
|
|
|
|
if ( *unitSize_p == 0 )
|
|
|
|
{
|
|
|
|
GXV_LIMIT_CHECK( 2 );
|
|
|
|
binSrchHeader.unitSize = FT_NEXT_USHORT( p );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
binSrchHeader.unitSize = *unitSize_p;
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( *nUnits_p == 0 )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
GXV_LIMIT_CHECK( 2 );
|
|
|
|
binSrchHeader.nUnits = FT_NEXT_USHORT( p );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
binSrchHeader.nUnits = *nUnits_p;
|
|
|
|
|
|
|
|
GXV_LIMIT_CHECK( 2 + 2 + 2 );
|
|
|
|
binSrchHeader.searchRange = FT_NEXT_USHORT( p );
|
|
|
|
binSrchHeader.entrySelector = FT_NEXT_USHORT( p );
|
|
|
|
binSrchHeader.rangeShift = FT_NEXT_USHORT( p );
|
|
|
|
GXV_TRACE(( "nUnits %d\n", binSrchHeader.nUnits ));
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxv_BinSrchHeader_check_consistency( &binSrchHeader, gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
if ( *unitSize_p == 0 )
|
|
|
|
*unitSize_p = binSrchHeader.unitSize;
|
|
|
|
|
|
|
|
if ( *nUnits_p == 0 )
|
2005-08-31 18:29:51 +02:00
|
|
|
*nUnits_p = binSrchHeader.nUnits;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
gxvalid->subtable_length = (FT_ULong)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** LOOKUP TABLE *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
#define GXV_LOOKUP_VALUE_LOAD( P, SIGNSPEC ) \
|
|
|
|
( P += 2, gxv_lookup_value_load( P - 2, SIGNSPEC ) )
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
static GXV_LookupValueDesc
|
2018-08-04 06:39:11 +02:00
|
|
|
gxv_lookup_value_load( FT_Bytes p,
|
|
|
|
GXV_LookupValue_SignSpec signspec )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
GXV_LookupValueDesc v;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
if ( signspec == GXV_LOOKUPVALUE_UNSIGNED )
|
|
|
|
v.u = FT_NEXT_USHORT( p );
|
|
|
|
else
|
|
|
|
v.s = FT_NEXT_SHORT( p );
|
|
|
|
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
#define GXV_UNITSIZE_VALIDATE( FORMAT, UNITSIZE, NUNITS, CORRECTSIZE ) \
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_BEGIN_STMNT \
|
|
|
|
if ( UNITSIZE != CORRECTSIZE ) \
|
|
|
|
{ \
|
|
|
|
FT_ERROR(( "unitSize=%d differs from" \
|
2009-06-26 06:15:41 +02:00
|
|
|
" expected unitSize=%d" \
|
|
|
|
" in LookupTable %s\n", \
|
2005-08-31 18:29:51 +02:00
|
|
|
UNITSIZE, CORRECTSIZE, FORMAT )); \
|
|
|
|
if ( UNITSIZE != 0 && NUNITS != 0 ) \
|
|
|
|
{ \
|
|
|
|
FT_ERROR(( " cannot validate anymore\n" )); \
|
|
|
|
FT_INVALID_FORMAT; \
|
|
|
|
} \
|
|
|
|
else \
|
|
|
|
FT_ERROR(( " forcibly continues\n" )); \
|
|
|
|
} \
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_END_STMNT
|
|
|
|
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
/* ================= Simple Array Format 0 Lookup Table ================ */
|
2005-08-24 06:31:31 +02:00
|
|
|
static void
|
|
|
|
gxv_LookupTable_fmt0_validate( FT_Bytes table,
|
|
|
|
FT_Bytes limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_Bytes p = table;
|
|
|
|
FT_UShort i;
|
|
|
|
|
|
|
|
GXV_LookupValueDesc value;
|
|
|
|
|
|
|
|
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
GXV_NAME_ENTER( "LookupTable format 0" );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_LIMIT_CHECK( 2 * gxvalid->face->num_glyphs );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
for ( i = 0; i < gxvalid->face->num_glyphs; i++ )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
GXV_LIMIT_CHECK( 2 );
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( p + 2 >= limit ) /* some fonts have too-short fmt0 array */
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
GXV_TRACE(( "too short, glyphs %d - %d are missing\n",
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
i, gxvalid->face->num_glyphs ));
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
|
2005-08-24 06:31:31 +02:00
|
|
|
break;
|
|
|
|
}
|
2005-08-31 18:29:51 +02:00
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
value = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign );
|
|
|
|
gxvalid->lookupval_func( i, &value, gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
gxvalid->subtable_length = (FT_ULong)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2017-01-20 05:01:44 +01:00
|
|
|
/* ================= Segment Single Format 2 Lookup Table ============== */
|
2005-08-24 06:31:31 +02:00
|
|
|
/*
|
2005-08-31 18:29:51 +02:00
|
|
|
* Apple spec says:
|
|
|
|
*
|
|
|
|
* To guarantee that a binary search terminates, you must include one or
|
|
|
|
* more special `end of search table' values at the end of the data to
|
|
|
|
* be searched. The number of termination values that need to be
|
|
|
|
* included is table-specific. The value that indicates binary search
|
|
|
|
* termination is 0xFFFF.
|
|
|
|
*
|
|
|
|
* The problem is that nUnits does not include this end-marker. It's
|
|
|
|
* quite difficult to discriminate whether the following 0xFFFF comes from
|
2005-08-24 06:31:31 +02:00
|
|
|
* the end-marker or some next data.
|
2005-08-31 18:29:51 +02:00
|
|
|
*
|
2005-08-24 06:31:31 +02:00
|
|
|
* -- suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
gxv_LookupTable_fmt2_skip_endmarkers( FT_Bytes table,
|
|
|
|
FT_UShort unitSize,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_Bytes p = table;
|
|
|
|
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
while ( ( p + 4 ) < gxvalid->root->limit )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
if ( p[0] != 0xFF || p[1] != 0xFF || /* lastGlyph */
|
|
|
|
p[2] != 0xFF || p[3] != 0xFF ) /* firstGlyph */
|
|
|
|
break;
|
|
|
|
p += unitSize;
|
|
|
|
}
|
|
|
|
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
gxvalid->subtable_length = (FT_ULong)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
static void
|
|
|
|
gxv_LookupTable_fmt2_validate( FT_Bytes table,
|
|
|
|
FT_Bytes limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_Bytes p = table;
|
|
|
|
FT_UShort gid;
|
|
|
|
|
|
|
|
FT_UShort unitSize;
|
|
|
|
FT_UShort nUnits;
|
|
|
|
FT_UShort unit;
|
|
|
|
FT_UShort lastGlyph;
|
|
|
|
FT_UShort firstGlyph;
|
|
|
|
GXV_LookupValueDesc value;
|
|
|
|
|
|
|
|
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
GXV_NAME_ENTER( "LookupTable format 2" );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
unitSize = nUnits = 0;
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, gxvalid );
|
|
|
|
p += gxvalid->subtable_length;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_UNITSIZE_VALIDATE( "format2", unitSize, nUnits, 6 );
|
|
|
|
|
|
|
|
for ( unit = 0, gid = 0; unit < nUnits; unit++ )
|
|
|
|
{
|
|
|
|
GXV_LIMIT_CHECK( 2 + 2 + 2 );
|
|
|
|
lastGlyph = FT_NEXT_USHORT( p );
|
|
|
|
firstGlyph = FT_NEXT_USHORT( p );
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
value = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxv_glyphid_validate( firstGlyph, gxvalid );
|
|
|
|
gxv_glyphid_validate( lastGlyph, gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
if ( lastGlyph < gid )
|
|
|
|
{
|
|
|
|
GXV_TRACE(( "reverse ordered segment specification:"
|
|
|
|
" lastGlyph[%d]=%d < lastGlyph[%d]=%d\n",
|
2005-08-31 18:29:51 +02:00
|
|
|
unit, lastGlyph, unit - 1 , gid ));
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( lastGlyph < firstGlyph )
|
|
|
|
{
|
|
|
|
GXV_TRACE(( "reverse ordered range specification at unit %d:",
|
|
|
|
" lastGlyph %d < firstGlyph %d ",
|
2005-08-31 18:29:51 +02:00
|
|
|
unit, lastGlyph, firstGlyph ));
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
if ( gxvalid->root->level == FT_VALIDATE_TIGHT )
|
2005-08-31 18:29:51 +02:00
|
|
|
continue; /* ftxvalidator silently skips such an entry */
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_TRACE4(( "continuing with exchanged values\n" ));
|
2005-08-24 06:31:31 +02:00
|
|
|
gid = firstGlyph;
|
|
|
|
firstGlyph = lastGlyph;
|
|
|
|
lastGlyph = gid;
|
|
|
|
}
|
|
|
|
|
|
|
|
for ( gid = firstGlyph; gid <= lastGlyph; gid++ )
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid->lookupval_func( gid, &value, gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxv_LookupTable_fmt2_skip_endmarkers( p, unitSize, gxvalid );
|
|
|
|
p += gxvalid->subtable_length;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
gxvalid->subtable_length = (FT_ULong)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
|
|
|
/* ================= Segment Array Format 4 Lookup Table =============== */
|
2005-08-24 06:31:31 +02:00
|
|
|
static void
|
|
|
|
gxv_LookupTable_fmt4_validate( FT_Bytes table,
|
|
|
|
FT_Bytes limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_Bytes p = table;
|
|
|
|
FT_UShort unit;
|
|
|
|
FT_UShort gid;
|
|
|
|
|
|
|
|
FT_UShort unitSize;
|
|
|
|
FT_UShort nUnits;
|
|
|
|
FT_UShort lastGlyph;
|
|
|
|
FT_UShort firstGlyph;
|
|
|
|
GXV_LookupValueDesc base_value;
|
|
|
|
GXV_LookupValueDesc value;
|
|
|
|
|
|
|
|
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
GXV_NAME_ENTER( "LookupTable format 4" );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
unitSize = nUnits = 0;
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, gxvalid );
|
|
|
|
p += gxvalid->subtable_length;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_UNITSIZE_VALIDATE( "format4", unitSize, nUnits, 6 );
|
|
|
|
|
|
|
|
for ( unit = 0, gid = 0; unit < nUnits; unit++ )
|
|
|
|
{
|
|
|
|
GXV_LIMIT_CHECK( 2 + 2 );
|
|
|
|
lastGlyph = FT_NEXT_USHORT( p );
|
|
|
|
firstGlyph = FT_NEXT_USHORT( p );
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxv_glyphid_validate( firstGlyph, gxvalid );
|
|
|
|
gxv_glyphid_validate( lastGlyph, gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
if ( lastGlyph < gid )
|
|
|
|
{
|
|
|
|
GXV_TRACE(( "reverse ordered segment specification:"
|
|
|
|
" lastGlyph[%d]=%d < lastGlyph[%d]=%d\n",
|
2005-08-31 18:29:51 +02:00
|
|
|
unit, lastGlyph, unit - 1 , gid ));
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( lastGlyph < firstGlyph )
|
|
|
|
{
|
|
|
|
GXV_TRACE(( "reverse ordered range specification at unit %d:",
|
|
|
|
" lastGlyph %d < firstGlyph %d ",
|
2005-08-31 18:29:51 +02:00
|
|
|
unit, lastGlyph, firstGlyph ));
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
if ( gxvalid->root->level == FT_VALIDATE_TIGHT )
|
2005-08-31 18:29:51 +02:00
|
|
|
continue; /* ftxvalidator silently skips such an entry */
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_TRACE4(( "continuing with exchanged values\n" ));
|
2005-08-24 06:31:31 +02:00
|
|
|
gid = firstGlyph;
|
|
|
|
firstGlyph = lastGlyph;
|
|
|
|
lastGlyph = gid;
|
|
|
|
}
|
|
|
|
|
|
|
|
GXV_LIMIT_CHECK( 2 );
|
|
|
|
base_value = GXV_LOOKUP_VALUE_LOAD( p, GXV_LOOKUPVALUE_UNSIGNED );
|
|
|
|
|
|
|
|
for ( gid = firstGlyph; gid <= lastGlyph; gid++ )
|
|
|
|
{
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
value = gxvalid->lookupfmt4_trans( (FT_UShort)( gid - firstGlyph ),
|
2009-07-31 17:29:29 +02:00
|
|
|
&base_value,
|
* src/base/Jamfile: adding src/base/ftgxval.c
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c, src/gxvalid/gxvfeat.c,
src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c,
src/gxvalid/gxvmort.c, src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c, src/gxvalid/gxvmort5.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/sfnt/sfdriver.c, src/truetype/ttgload.c:
removing _many_ compiler warnings when compiling with Visual C++
at maximum level (/W4)
2005-09-23 15:22:10 +02:00
|
|
|
limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid );
|
* src/base/Jamfile: adding src/base/ftgxval.c
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c, src/gxvalid/gxvfeat.c,
src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c,
src/gxvalid/gxvmort.c, src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c, src/gxvalid/gxvmort5.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/sfnt/sfdriver.c, src/truetype/ttgload.c:
removing _many_ compiler warnings when compiling with Visual C++
at maximum level (/W4)
2005-09-23 15:22:10 +02:00
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid->lookupval_func( gid, &value, gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxv_LookupTable_fmt2_skip_endmarkers( p, unitSize, gxvalid );
|
|
|
|
p += gxvalid->subtable_length;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
gxvalid->subtable_length = (FT_ULong)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
|
|
|
/* ================= Segment Table Format 6 Lookup Table =============== */
|
2005-08-24 06:31:31 +02:00
|
|
|
static void
|
|
|
|
gxv_LookupTable_fmt6_skip_endmarkers( FT_Bytes table,
|
|
|
|
FT_UShort unitSize,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_Bytes p = table;
|
|
|
|
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
while ( p < gxvalid->root->limit )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
if ( p[0] != 0xFF || p[1] != 0xFF )
|
|
|
|
break;
|
|
|
|
p += unitSize;
|
|
|
|
}
|
|
|
|
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
gxvalid->subtable_length = (FT_ULong)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
static void
|
|
|
|
gxv_LookupTable_fmt6_validate( FT_Bytes table,
|
|
|
|
FT_Bytes limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_Bytes p = table;
|
|
|
|
FT_UShort unit;
|
|
|
|
FT_UShort prev_glyph;
|
|
|
|
|
|
|
|
FT_UShort unitSize;
|
|
|
|
FT_UShort nUnits;
|
|
|
|
FT_UShort glyph;
|
|
|
|
GXV_LookupValueDesc value;
|
|
|
|
|
|
|
|
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
GXV_NAME_ENTER( "LookupTable format 6" );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
unitSize = nUnits = 0;
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, gxvalid );
|
|
|
|
p += gxvalid->subtable_length;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_UNITSIZE_VALIDATE( "format6", unitSize, nUnits, 4 );
|
|
|
|
|
|
|
|
for ( unit = 0, prev_glyph = 0; unit < nUnits; unit++ )
|
|
|
|
{
|
|
|
|
GXV_LIMIT_CHECK( 2 + 2 );
|
|
|
|
glyph = FT_NEXT_USHORT( p );
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
value = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
if ( gxv_glyphid_validate( glyph, gxvalid ) )
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_TRACE(( " endmarker found within defined range"
|
|
|
|
" (entry %d < nUnits=%d)\n",
|
|
|
|
unit, nUnits ));
|
|
|
|
|
|
|
|
if ( prev_glyph > glyph )
|
|
|
|
{
|
|
|
|
GXV_TRACE(( "current gid 0x%04x < previous gid 0x%04x\n",
|
2005-08-31 18:29:51 +02:00
|
|
|
glyph, prev_glyph ));
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
prev_glyph = glyph;
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid->lookupval_func( glyph, &value, gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxv_LookupTable_fmt6_skip_endmarkers( p, unitSize, gxvalid );
|
|
|
|
p += gxvalid->subtable_length;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
gxvalid->subtable_length = (FT_ULong)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
|
|
|
/* ================= Trimmed Array Format 8 Lookup Table =============== */
|
2005-08-24 06:31:31 +02:00
|
|
|
static void
|
|
|
|
gxv_LookupTable_fmt8_validate( FT_Bytes table,
|
|
|
|
FT_Bytes limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_Bytes p = table;
|
|
|
|
FT_UShort i;
|
|
|
|
|
|
|
|
GXV_LookupValueDesc value;
|
|
|
|
FT_UShort firstGlyph;
|
|
|
|
FT_UShort glyphCount;
|
|
|
|
|
|
|
|
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
GXV_NAME_ENTER( "LookupTable format 8" );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
/* firstGlyph + glyphCount */
|
|
|
|
GXV_LIMIT_CHECK( 2 + 2 );
|
|
|
|
firstGlyph = FT_NEXT_USHORT( p );
|
|
|
|
glyphCount = FT_NEXT_USHORT( p );
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxv_glyphid_validate( firstGlyph, gxvalid );
|
|
|
|
gxv_glyphid_validate( (FT_UShort)( firstGlyph + glyphCount ), gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
/* valueArray */
|
|
|
|
for ( i = 0; i < glyphCount; i++ )
|
|
|
|
{
|
|
|
|
GXV_LIMIT_CHECK( 2 );
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
value = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign );
|
|
|
|
gxvalid->lookupval_func( (FT_UShort)( firstGlyph + i ), &value, gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
gxvalid->subtable_length = (FT_ULong)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( void )
|
|
|
|
gxv_LookupTable_validate( FT_Bytes table,
|
|
|
|
FT_Bytes limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_Bytes p = table;
|
|
|
|
FT_UShort format;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
GXV_Validate_Func fmt_funcs_table[] =
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
gxv_LookupTable_fmt0_validate, /* 0 */
|
|
|
|
NULL, /* 1 */
|
|
|
|
gxv_LookupTable_fmt2_validate, /* 2 */
|
|
|
|
NULL, /* 3 */
|
|
|
|
gxv_LookupTable_fmt4_validate, /* 4 */
|
|
|
|
NULL, /* 5 */
|
|
|
|
gxv_LookupTable_fmt6_validate, /* 6 */
|
|
|
|
NULL, /* 7 */
|
|
|
|
gxv_LookupTable_fmt8_validate, /* 8 */
|
|
|
|
};
|
2005-08-31 18:29:51 +02:00
|
|
|
|
|
|
|
GXV_Validate_Func func;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
GXV_NAME_ENTER( "LookupTable" );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
/* lookuptbl_head may be used in fmt4 transit function. */
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid->lookuptbl_head = table;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
/* format */
|
|
|
|
GXV_LIMIT_CHECK( 2 );
|
|
|
|
format = FT_NEXT_USHORT( p );
|
|
|
|
GXV_TRACE(( " (format %d)\n", format ));
|
|
|
|
|
|
|
|
if ( format > 8 )
|
|
|
|
FT_INVALID_FORMAT;
|
|
|
|
|
|
|
|
func = fmt_funcs_table[format];
|
2016-12-26 17:08:17 +01:00
|
|
|
if ( !func )
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_INVALID_FORMAT;
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
func( p, limit, gxvalid );
|
|
|
|
p += gxvalid->subtable_length;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
gxvalid->subtable_length = (FT_ULong)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** Glyph ID *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( FT_Int )
|
|
|
|
gxv_glyphid_validate( FT_UShort gid,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_Face face;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( gid == 0xFFFFU )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
GXV_EXIT;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
face = gxvalid->face;
|
2005-08-24 06:31:31 +02:00
|
|
|
if ( face->num_glyphs < gid )
|
|
|
|
{
|
|
|
|
GXV_TRACE(( " gxv_glyphid_check() gid overflow: num_glyphs %d < %d\n",
|
2005-08-31 18:29:51 +02:00
|
|
|
face->num_glyphs, gid ));
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** CONTROL POINT *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( void )
|
|
|
|
gxv_ctlPoint_validate( FT_UShort gid,
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
FT_UShort ctl_point,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_Face face;
|
|
|
|
FT_Error error;
|
|
|
|
|
|
|
|
FT_GlyphSlot glyph;
|
|
|
|
FT_Outline outline;
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
FT_UShort n_points;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
face = gxvalid->face;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
error = FT_Load_Glyph( face,
|
|
|
|
gid,
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_LOAD_NO_BITMAP | FT_LOAD_IGNORE_TRANSFORM );
|
2005-08-24 06:31:31 +02:00
|
|
|
if ( error )
|
|
|
|
FT_INVALID_GLYPH_ID;
|
|
|
|
|
|
|
|
glyph = face->glyph;
|
|
|
|
outline = glyph->outline;
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
n_points = (FT_UShort)outline.n_points;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
if ( !( ctl_point < n_points ) )
|
|
|
|
FT_INVALID_DATA;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** SFNT NAME *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( void )
|
|
|
|
gxv_sfntName_validate( FT_UShort name_index,
|
|
|
|
FT_UShort min_index,
|
|
|
|
FT_UShort max_index,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_SfntName name;
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_UInt i;
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_UInt nnames;
|
|
|
|
|
|
|
|
|
|
|
|
GXV_NAME_ENTER( "sfntName" );
|
|
|
|
|
|
|
|
if ( name_index < min_index || max_index < name_index )
|
|
|
|
FT_INVALID_FORMAT;
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
nnames = FT_Get_Sfnt_Name_Count( gxvalid->face );
|
2005-08-24 06:31:31 +02:00
|
|
|
for ( i = 0; i < nnames; i++ )
|
|
|
|
{
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
if ( FT_Get_Sfnt_Name( gxvalid->face, i, &name ) != FT_Err_Ok )
|
2016-02-15 12:54:40 +01:00
|
|
|
continue;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
if ( name.name_id == name_index )
|
|
|
|
goto Out;
|
|
|
|
}
|
|
|
|
|
|
|
|
GXV_TRACE(( " nameIndex = %d (UNTITLED)\n", name_index ));
|
2005-09-28 09:34:45 +02:00
|
|
|
FT_INVALID_DATA;
|
* src/base/Jamfile: adding src/base/ftgxval.c
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c, src/gxvalid/gxvfeat.c,
src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c,
src/gxvalid/gxvmort.c, src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c, src/gxvalid/gxvmort5.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/sfnt/sfdriver.c, src/truetype/ttgload.c:
removing _many_ compiler warnings when compiling with Visual C++
at maximum level (/W4)
2005-09-23 15:22:10 +02:00
|
|
|
goto Exit; /* make compiler happy */
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
Out:
|
|
|
|
FT_TRACE1(( " nameIndex = %d (", name_index ));
|
|
|
|
GXV_TRACE_HEXDUMP_SFNTNAME( name );
|
|
|
|
FT_TRACE1(( ")\n" ));
|
|
|
|
|
* src/base/Jamfile: adding src/base/ftgxval.c
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c, src/gxvalid/gxvfeat.c,
src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c,
src/gxvalid/gxvmort.c, src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c, src/gxvalid/gxvmort5.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/sfnt/sfdriver.c, src/truetype/ttgload.c:
removing _many_ compiler warnings when compiling with Visual C++
at maximum level (/W4)
2005-09-23 15:22:10 +02:00
|
|
|
Exit:
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** STATE TABLE *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
/* -------------------------- Class Table --------------------------- */
|
|
|
|
|
|
|
|
/*
|
2005-08-31 18:29:51 +02:00
|
|
|
* highestClass specifies how many classes are defined in this
|
|
|
|
* Class Subtable. Apple spec does not mention whether undefined
|
|
|
|
* holes in the class (e.g.: 0-3 are predefined, 4 is unused, 5 is used)
|
|
|
|
* are permitted. At present, holes in a defined class are not checked.
|
2005-08-24 06:31:31 +02:00
|
|
|
* -- suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
|
|
|
gxv_ClassTable_validate( FT_Bytes table,
|
|
|
|
FT_UShort* length_p,
|
|
|
|
FT_UShort stateSize,
|
|
|
|
FT_Byte* maxClassID_p,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_Bytes p = table;
|
|
|
|
FT_Bytes limit = table + *length_p;
|
|
|
|
FT_UShort firstGlyph;
|
|
|
|
FT_UShort nGlyphs;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
GXV_NAME_ENTER( "ClassTable" );
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
*maxClassID_p = 3; /* Classes 0, 2, and 3 are predefined */
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_LIMIT_CHECK( 2 + 2 );
|
|
|
|
firstGlyph = FT_NEXT_USHORT( p );
|
|
|
|
nGlyphs = FT_NEXT_USHORT( p );
|
|
|
|
|
|
|
|
GXV_TRACE(( " (firstGlyph = %d, nGlyphs = %d)\n", firstGlyph, nGlyphs ));
|
|
|
|
|
|
|
|
if ( !nGlyphs )
|
|
|
|
goto Out;
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs ), gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
FT_Byte nGlyphInClass[256];
|
|
|
|
FT_Byte classID;
|
|
|
|
FT_UShort i;
|
|
|
|
|
|
|
|
|
2016-09-28 19:10:52 +02:00
|
|
|
FT_MEM_ZERO( nGlyphInClass, 256 );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
for ( i = 0; i < nGlyphs; i++ )
|
|
|
|
{
|
|
|
|
GXV_LIMIT_CHECK( 1 );
|
|
|
|
classID = FT_NEXT_BYTE( p );
|
|
|
|
switch ( classID )
|
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
/* following classes should not appear in class array */
|
|
|
|
case 0: /* end of text */
|
|
|
|
case 2: /* out of bounds */
|
|
|
|
case 3: /* end of line */
|
|
|
|
FT_INVALID_DATA;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1: /* out of bounds */
|
|
|
|
default: /* user-defined: 4 - ( stateSize - 1 ) */
|
|
|
|
if ( classID >= stateSize )
|
|
|
|
FT_INVALID_DATA; /* assign glyph to undefined state */
|
|
|
|
|
|
|
|
nGlyphInClass[classID]++;
|
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
}
|
2005-09-28 09:34:45 +02:00
|
|
|
*length_p = (FT_UShort)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
/* scan max ClassID in use */
|
|
|
|
for ( i = 0; i < stateSize; i++ )
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( ( 3 < i ) && ( nGlyphInClass[i] > 0 ) )
|
2005-09-28 09:34:45 +02:00
|
|
|
*maxClassID_p = (FT_Byte)i; /* XXX: Check Range? */
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
Out:
|
|
|
|
GXV_TRACE(( "Declared stateSize=0x%02x, Used maxClassID=0x%02x\n",
|
|
|
|
stateSize, *maxClassID_p ));
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
/* --------------------------- State Array ----------------------------- */
|
|
|
|
|
|
|
|
static void
|
|
|
|
gxv_StateArray_validate( FT_Bytes table,
|
|
|
|
FT_UShort* length_p,
|
|
|
|
FT_Byte maxClassID,
|
|
|
|
FT_UShort stateSize,
|
|
|
|
FT_Byte* maxState_p,
|
|
|
|
FT_Byte* maxEntry_p,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
FT_Bytes p = table;
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_Bytes limit = table + *length_p;
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
FT_Byte clazz;
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_Byte entry;
|
|
|
|
|
2005-09-28 09:34:45 +02:00
|
|
|
FT_UNUSED( stateSize ); /* for the non-debugging case */
|
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_NAME_ENTER( "StateArray" );
|
|
|
|
|
|
|
|
GXV_TRACE(( "parse %d bytes by stateSize=%d maxClassID=%d\n",
|
2005-08-31 18:29:51 +02:00
|
|
|
(int)(*length_p), stateSize, (int)(maxClassID) ));
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
/*
|
2005-08-31 18:29:51 +02:00
|
|
|
* 2 states are predefined and must be described in StateArray:
|
2005-08-24 06:31:31 +02:00
|
|
|
* state 0 (start of text), 1 (start of line)
|
|
|
|
*/
|
|
|
|
GXV_LIMIT_CHECK( ( 1 + maxClassID ) * 2 );
|
|
|
|
|
|
|
|
*maxState_p = 0;
|
|
|
|
*maxEntry_p = 0;
|
|
|
|
|
|
|
|
/* read if enough to read another state */
|
|
|
|
while ( p + ( 1 + maxClassID ) <= limit )
|
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
(*maxState_p)++;
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
for ( clazz = 0; clazz <= maxClassID; clazz++ )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
entry = FT_NEXT_BYTE( p );
|
2005-09-28 09:34:45 +02:00
|
|
|
*maxEntry_p = (FT_Byte)FT_MAX( *maxEntry_p, entry );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
GXV_TRACE(( "parsed: maxState=%d, maxEntry=%d\n",
|
2005-08-31 18:29:51 +02:00
|
|
|
*maxState_p, *maxEntry_p ));
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-09-28 09:34:45 +02:00
|
|
|
*length_p = (FT_UShort)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
/* --------------------------- Entry Table ----------------------------- */
|
|
|
|
|
|
|
|
static void
|
|
|
|
gxv_EntryTable_validate( FT_Bytes table,
|
|
|
|
FT_UShort* length_p,
|
|
|
|
FT_Byte maxEntry,
|
|
|
|
FT_UShort stateArray,
|
|
|
|
FT_UShort stateArray_length,
|
|
|
|
FT_Byte maxClassID,
|
|
|
|
FT_Bytes statetable_table,
|
|
|
|
FT_Bytes statetable_limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_Bytes p = table;
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_Bytes limit = table + *length_p;
|
|
|
|
FT_Byte entry;
|
|
|
|
FT_Byte state;
|
|
|
|
FT_Int entrySize = 2 + 2 + GXV_GLYPHOFFSET_SIZE( statetable );
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_XStateTable_GlyphOffsetDesc glyphOffset;
|
|
|
|
|
|
|
|
|
|
|
|
GXV_NAME_ENTER( "EntryTable" );
|
|
|
|
|
|
|
|
GXV_TRACE(( "maxEntry=%d entrySize=%d\n", maxEntry, entrySize ));
|
|
|
|
|
|
|
|
if ( ( maxEntry + 1 ) * entrySize > *length_p )
|
|
|
|
{
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_TOO_SHORT );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
/* ftxvalidator and FontValidator both warn and continue */
|
2005-09-28 09:34:45 +02:00
|
|
|
maxEntry = (FT_Byte)( *length_p / entrySize - 1 );
|
2005-08-31 18:29:51 +02:00
|
|
|
GXV_TRACE(( "too large maxEntry, shrinking to %d fit EntryTable length\n",
|
|
|
|
maxEntry ));
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
for ( entry = 0; entry <= maxEntry; entry++ )
|
|
|
|
{
|
|
|
|
FT_UShort newState;
|
|
|
|
FT_UShort flags;
|
|
|
|
|
|
|
|
|
|
|
|
GXV_LIMIT_CHECK( 2 + 2 );
|
|
|
|
newState = FT_NEXT_USHORT( p );
|
|
|
|
flags = FT_NEXT_USHORT( p );
|
|
|
|
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( newState < stateArray ||
|
|
|
|
stateArray + stateArray_length < newState )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
GXV_TRACE(( " newState offset 0x%04x is out of stateArray\n",
|
|
|
|
newState ));
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
|
2005-08-24 06:31:31 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( 0 != ( ( newState - stateArray ) % ( 1 + maxClassID ) ) )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
GXV_TRACE(( " newState offset 0x%04x is not aligned to %d-classes\n",
|
2005-08-31 18:29:51 +02:00
|
|
|
newState, 1 + maxClassID ));
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
|
2005-08-24 06:31:31 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2005-09-28 09:34:45 +02:00
|
|
|
state = (FT_Byte)( ( newState - stateArray ) / ( 1 + maxClassID ) );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
switch ( GXV_GLYPHOFFSET_FMT( statetable ) )
|
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
case GXV_GLYPHOFFSET_NONE:
|
2005-09-28 09:34:45 +02:00
|
|
|
glyphOffset.uc = 0; /* make compiler happy */
|
2005-08-31 18:29:51 +02:00
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
case GXV_GLYPHOFFSET_UCHAR:
|
|
|
|
glyphOffset.uc = FT_NEXT_BYTE( p );
|
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
case GXV_GLYPHOFFSET_CHAR:
|
|
|
|
glyphOffset.c = FT_NEXT_CHAR( p );
|
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
case GXV_GLYPHOFFSET_USHORT:
|
|
|
|
glyphOffset.u = FT_NEXT_USHORT( p );
|
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
case GXV_GLYPHOFFSET_SHORT:
|
|
|
|
glyphOffset.s = FT_NEXT_SHORT( p );
|
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
case GXV_GLYPHOFFSET_ULONG:
|
|
|
|
glyphOffset.ul = FT_NEXT_ULONG( p );
|
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
case GXV_GLYPHOFFSET_LONG:
|
|
|
|
glyphOffset.l = FT_NEXT_LONG( p );
|
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
2016-12-26 17:08:17 +01:00
|
|
|
if ( gxvalid->statetable.entry_validate_func )
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid->statetable.entry_validate_func( state,
|
|
|
|
flags,
|
|
|
|
&glyphOffset,
|
|
|
|
statetable_table,
|
|
|
|
statetable_limit,
|
|
|
|
gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
2005-09-28 09:34:45 +02:00
|
|
|
|
|
|
|
*length_p = (FT_UShort)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
/* =========================== State Table ============================= */
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( void )
|
|
|
|
gxv_StateTable_subtable_setup( FT_UShort table_size,
|
|
|
|
FT_UShort classTable,
|
|
|
|
FT_UShort stateArray,
|
|
|
|
FT_UShort entryTable,
|
|
|
|
FT_UShort* classTable_length_p,
|
|
|
|
FT_UShort* stateArray_length_p,
|
|
|
|
FT_UShort* entryTable_length_p,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_UShort o[3];
|
|
|
|
FT_UShort* l[3];
|
|
|
|
FT_UShort buff[4];
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
o[0] = classTable;
|
|
|
|
o[1] = stateArray;
|
|
|
|
o[2] = entryTable;
|
|
|
|
l[0] = classTable_length_p;
|
|
|
|
l[1] = stateArray_length_p;
|
|
|
|
l[2] = entryTable_length_p;
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxv_set_length_by_ushort_offset( o, l, buff, 3, table_size, gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_LOCAL_DEF( void )
|
|
|
|
gxv_StateTable_validate( FT_Bytes table,
|
|
|
|
FT_Bytes limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_UShort stateSize;
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_UShort classTable; /* offset to Class(Sub)Table */
|
|
|
|
FT_UShort stateArray; /* offset to StateArray */
|
|
|
|
FT_UShort entryTable; /* offset to EntryTable */
|
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_UShort classTable_length;
|
|
|
|
FT_UShort stateArray_length;
|
|
|
|
FT_UShort entryTable_length;
|
|
|
|
FT_Byte maxClassID;
|
|
|
|
FT_Byte maxState;
|
|
|
|
FT_Byte maxEntry;
|
|
|
|
|
|
|
|
GXV_StateTable_Subtable_Setup_Func setup_func;
|
|
|
|
|
|
|
|
FT_Bytes p = table;
|
|
|
|
|
|
|
|
|
|
|
|
GXV_NAME_ENTER( "StateTable" );
|
|
|
|
|
|
|
|
GXV_TRACE(( "StateTable header\n" ));
|
|
|
|
|
|
|
|
GXV_LIMIT_CHECK( 2 + 2 + 2 + 2 );
|
|
|
|
stateSize = FT_NEXT_USHORT( p );
|
|
|
|
classTable = FT_NEXT_USHORT( p );
|
|
|
|
stateArray = FT_NEXT_USHORT( p );
|
|
|
|
entryTable = FT_NEXT_USHORT( p );
|
|
|
|
|
|
|
|
GXV_TRACE(( "stateSize=0x%04x\n", stateSize ));
|
|
|
|
GXV_TRACE(( "offset to classTable=0x%04x\n", classTable ));
|
|
|
|
GXV_TRACE(( "offset to stateArray=0x%04x\n", stateArray ));
|
|
|
|
GXV_TRACE(( "offset to entryTable=0x%04x\n", entryTable ));
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( stateSize > 0xFF )
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_INVALID_DATA;
|
|
|
|
|
2016-12-26 17:08:17 +01:00
|
|
|
if ( gxvalid->statetable.optdata_load_func )
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid->statetable.optdata_load_func( p, limit, gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2016-12-26 17:08:17 +01:00
|
|
|
if ( gxvalid->statetable.subtable_setup_func )
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
setup_func = gxvalid->statetable.subtable_setup_func;
|
2005-08-24 06:31:31 +02:00
|
|
|
else
|
|
|
|
setup_func = gxv_StateTable_subtable_setup;
|
|
|
|
|
2005-09-28 09:34:45 +02:00
|
|
|
setup_func( (FT_UShort)( limit - table ),
|
2005-08-24 06:31:31 +02:00
|
|
|
classTable,
|
|
|
|
stateArray,
|
|
|
|
entryTable,
|
|
|
|
&classTable_length,
|
|
|
|
&stateArray_length,
|
|
|
|
&entryTable_length,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_TRACE(( "StateTable Subtables\n" ));
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( classTable != 0 )
|
2005-08-24 06:31:31 +02:00
|
|
|
gxv_ClassTable_validate( table + classTable,
|
|
|
|
&classTable_length,
|
|
|
|
stateSize,
|
|
|
|
&maxClassID,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
else
|
2005-09-28 09:34:45 +02:00
|
|
|
maxClassID = (FT_Byte)( stateSize - 1 );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( stateArray != 0 )
|
2005-08-24 06:31:31 +02:00
|
|
|
gxv_StateArray_validate( table + stateArray,
|
|
|
|
&stateArray_length,
|
|
|
|
maxClassID,
|
|
|
|
stateSize,
|
|
|
|
&maxState,
|
|
|
|
&maxEntry,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
else
|
|
|
|
{
|
2013-08-01 12:20:20 +02:00
|
|
|
#if 0
|
2005-08-31 18:29:51 +02:00
|
|
|
maxState = 1; /* 0:start of text, 1:start of line are predefined */
|
2013-08-01 12:20:20 +02:00
|
|
|
#endif
|
2005-08-24 06:31:31 +02:00
|
|
|
maxEntry = 0;
|
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( maxEntry > 0 && entryTable == 0 )
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_INVALID_OFFSET;
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( entryTable != 0 )
|
2005-08-24 06:31:31 +02:00
|
|
|
gxv_EntryTable_validate( table + entryTable,
|
|
|
|
&entryTable_length,
|
|
|
|
maxEntry,
|
|
|
|
stateArray,
|
|
|
|
stateArray_length,
|
|
|
|
maxClassID,
|
|
|
|
table,
|
|
|
|
limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
|
|
|
/* ================= eXtended State Table (for morx) =================== */
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
FT_LOCAL_DEF( void )
|
|
|
|
gxv_XStateTable_subtable_setup( FT_ULong table_size,
|
|
|
|
FT_ULong classTable,
|
|
|
|
FT_ULong stateArray,
|
|
|
|
FT_ULong entryTable,
|
|
|
|
FT_ULong* classTable_length_p,
|
|
|
|
FT_ULong* stateArray_length_p,
|
|
|
|
FT_ULong* entryTable_length_p,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_ULong o[3];
|
|
|
|
FT_ULong* l[3];
|
|
|
|
FT_ULong buff[4];
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
o[0] = classTable;
|
|
|
|
o[1] = stateArray;
|
|
|
|
o[2] = entryTable;
|
|
|
|
l[0] = classTable_length_p;
|
|
|
|
l[1] = stateArray_length_p;
|
|
|
|
l[2] = entryTable_length_p;
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxv_set_length_by_ulong_offset( o, l, buff, 3, table_size, gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gxv_XClassTable_lookupval_validate( FT_UShort glyph,
|
2009-07-31 17:29:29 +02:00
|
|
|
GXV_LookupValueCPtr value_p,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_UNUSED( glyph );
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
if ( value_p->u >= gxvalid->xstatetable.nClasses )
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_INVALID_DATA;
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
if ( value_p->u > gxvalid->xstatetable.maxClassID )
|
|
|
|
gxvalid->xstatetable.maxClassID = value_p->u;
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
+===============+ --------+
|
|
|
|
| lookup header | |
|
|
|
|
+===============+ |
|
|
|
|
| BinSrchHeader | |
|
|
|
|
+===============+ |
|
|
|
|
| lastGlyph[0] | |
|
|
|
|
+---------------+ |
|
|
|
|
| firstGlyph[0] | | head of lookup table
|
|
|
|
+---------------+ | +
|
|
|
|
| offset[0] | -> | offset [byte]
|
|
|
|
+===============+ | +
|
|
|
|
| lastGlyph[1] | | (glyphID - firstGlyph) * 2 [byte]
|
|
|
|
+---------------+ |
|
|
|
|
| firstGlyph[1] | |
|
|
|
|
+---------------+ |
|
|
|
|
| offset[1] | |
|
|
|
|
+===============+ |
|
|
|
|
|
|
|
|
|
.... |
|
|
|
|
|
|
|
|
|
16bit value array |
|
|
|
|
+===============+ |
|
|
|
|
| value | <-------+
|
|
|
|
....
|
|
|
|
*/
|
|
|
|
static GXV_LookupValueDesc
|
|
|
|
gxv_XClassTable_lookupfmt4_transit( FT_UShort relative_gindex,
|
2009-07-31 17:29:29 +02:00
|
|
|
GXV_LookupValueCPtr base_value_p,
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_Bytes lookuptbl_limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_Bytes p;
|
|
|
|
FT_Bytes limit;
|
|
|
|
FT_UShort offset;
|
|
|
|
GXV_LookupValueDesc value;
|
|
|
|
|
2005-09-28 09:34:45 +02:00
|
|
|
/* XXX: check range? */
|
2009-07-31 17:29:29 +02:00
|
|
|
offset = (FT_UShort)( base_value_p->u +
|
2005-09-28 09:34:45 +02:00
|
|
|
relative_gindex * sizeof ( FT_UShort ) );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
p = gxvalid->lookuptbl_head + offset;
|
2005-08-24 06:31:31 +02:00
|
|
|
limit = lookuptbl_limit;
|
|
|
|
|
|
|
|
GXV_LIMIT_CHECK ( 2 );
|
|
|
|
value.u = FT_NEXT_USHORT( p );
|
|
|
|
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gxv_XStateArray_validate( FT_Bytes table,
|
|
|
|
FT_ULong* length_p,
|
|
|
|
FT_UShort maxClassID,
|
|
|
|
FT_ULong stateSize,
|
|
|
|
FT_UShort* maxState_p,
|
|
|
|
FT_UShort* maxEntry_p,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_Bytes p = table;
|
|
|
|
FT_Bytes limit = table + *length_p;
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
FT_UShort clazz;
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_UShort entry;
|
|
|
|
|
2005-09-28 09:34:45 +02:00
|
|
|
FT_UNUSED( stateSize ); /* for the non-debugging case */
|
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_NAME_ENTER( "XStateArray" );
|
|
|
|
|
|
|
|
GXV_TRACE(( "parse % 3d bytes by stateSize=% 3d maxClassID=% 3d\n",
|
2005-08-31 18:29:51 +02:00
|
|
|
(int)(*length_p), stateSize, (int)(maxClassID) ));
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
/*
|
2005-08-31 18:29:51 +02:00
|
|
|
* 2 states are predefined and must be described:
|
2005-08-24 06:31:31 +02:00
|
|
|
* state 0 (start of text), 1 (start of line)
|
|
|
|
*/
|
|
|
|
GXV_LIMIT_CHECK( ( 1 + maxClassID ) * 2 * 2 );
|
|
|
|
|
|
|
|
*maxState_p = 0;
|
|
|
|
*maxEntry_p = 0;
|
|
|
|
|
|
|
|
/* read if enough to read another state */
|
|
|
|
while ( p + ( ( 1 + maxClassID ) * 2 ) <= limit )
|
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
(*maxState_p)++;
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
for ( clazz = 0; clazz <= maxClassID; clazz++ )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
entry = FT_NEXT_USHORT( p );
|
2005-09-28 09:34:45 +02:00
|
|
|
*maxEntry_p = (FT_UShort)FT_MAX( *maxEntry_p, entry );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
GXV_TRACE(( "parsed: maxState=%d, maxEntry=%d\n",
|
2005-08-31 18:29:51 +02:00
|
|
|
*maxState_p, *maxEntry_p ));
|
2005-08-24 06:31:31 +02:00
|
|
|
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
*length_p = (FT_ULong)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gxv_XEntryTable_validate( FT_Bytes table,
|
|
|
|
FT_ULong* length_p,
|
|
|
|
FT_UShort maxEntry,
|
|
|
|
FT_ULong stateArray_length,
|
|
|
|
FT_UShort maxClassID,
|
|
|
|
FT_Bytes xstatetable_table,
|
|
|
|
FT_Bytes xstatetable_limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_Bytes p = table;
|
|
|
|
FT_Bytes limit = table + *length_p;
|
|
|
|
FT_UShort entry;
|
|
|
|
FT_UShort state;
|
|
|
|
FT_Int entrySize = 2 + 2 + GXV_GLYPHOFFSET_SIZE( xstatetable );
|
|
|
|
|
|
|
|
|
|
|
|
GXV_NAME_ENTER( "XEntryTable" );
|
|
|
|
GXV_TRACE(( "maxEntry=%d entrySize=%d\n", maxEntry, entrySize ));
|
|
|
|
|
|
|
|
if ( ( p + ( maxEntry + 1 ) * entrySize ) > limit )
|
|
|
|
FT_INVALID_TOO_SHORT;
|
|
|
|
|
2016-02-15 12:54:40 +01:00
|
|
|
for (entry = 0; entry <= maxEntry; entry++ )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_UShort newState_idx;
|
|
|
|
FT_UShort flags;
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_XStateTable_GlyphOffsetDesc glyphOffset;
|
|
|
|
|
|
|
|
|
|
|
|
GXV_LIMIT_CHECK( 2 + 2 );
|
|
|
|
newState_idx = FT_NEXT_USHORT( p );
|
|
|
|
flags = FT_NEXT_USHORT( p );
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( stateArray_length < (FT_ULong)( newState_idx * 2 ) )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
GXV_TRACE(( " newState index 0x%04x points out of stateArray\n",
|
|
|
|
newState_idx ));
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
2005-09-28 09:34:45 +02:00
|
|
|
state = (FT_UShort)( newState_idx / ( 1 + maxClassID ) );
|
2005-08-24 06:31:31 +02:00
|
|
|
if ( 0 != ( newState_idx % ( 1 + maxClassID ) ) )
|
|
|
|
{
|
2020-12-02 14:15:07 +01:00
|
|
|
FT_TRACE4(( "-> new state = %d (supposed)\n",
|
|
|
|
state ));
|
|
|
|
FT_TRACE4(( "but newState index 0x%04x"
|
|
|
|
" is not aligned to %d-classes\n",
|
|
|
|
newState_idx, 1 + maxClassID ));
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
switch ( GXV_GLYPHOFFSET_FMT( xstatetable ) )
|
|
|
|
{
|
2005-08-31 18:29:51 +02:00
|
|
|
case GXV_GLYPHOFFSET_NONE:
|
* src/base/Jamfile: adding src/base/ftgxval.c
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c, src/gxvalid/gxvfeat.c,
src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c,
src/gxvalid/gxvmort.c, src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c, src/gxvalid/gxvmort5.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/sfnt/sfdriver.c, src/truetype/ttgload.c:
removing _many_ compiler warnings when compiling with Visual C++
at maximum level (/W4)
2005-09-23 15:22:10 +02:00
|
|
|
glyphOffset.uc = 0; /* make compiler happy */
|
2005-08-31 18:29:51 +02:00
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
case GXV_GLYPHOFFSET_UCHAR:
|
|
|
|
glyphOffset.uc = FT_NEXT_BYTE( p );
|
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
case GXV_GLYPHOFFSET_CHAR:
|
|
|
|
glyphOffset.c = FT_NEXT_CHAR( p );
|
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
case GXV_GLYPHOFFSET_USHORT:
|
|
|
|
glyphOffset.u = FT_NEXT_USHORT( p );
|
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
case GXV_GLYPHOFFSET_SHORT:
|
|
|
|
glyphOffset.s = FT_NEXT_SHORT( p );
|
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
case GXV_GLYPHOFFSET_ULONG:
|
|
|
|
glyphOffset.ul = FT_NEXT_ULONG( p );
|
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
case GXV_GLYPHOFFSET_LONG:
|
|
|
|
glyphOffset.l = FT_NEXT_LONG( p );
|
|
|
|
break;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
default:
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );
|
* src/base/Jamfile: adding src/base/ftgxval.c
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c, src/gxvalid/gxvfeat.c,
src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c,
src/gxvalid/gxvmort.c, src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c, src/gxvalid/gxvmort5.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/sfnt/sfdriver.c, src/truetype/ttgload.c:
removing _many_ compiler warnings when compiling with Visual C++
at maximum level (/W4)
2005-09-23 15:22:10 +02:00
|
|
|
goto Exit;
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
2016-12-26 17:08:17 +01:00
|
|
|
if ( gxvalid->xstatetable.entry_validate_func )
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid->xstatetable.entry_validate_func( state,
|
|
|
|
flags,
|
|
|
|
&glyphOffset,
|
|
|
|
xstatetable_table,
|
|
|
|
xstatetable_limit,
|
|
|
|
gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
* src/base/Jamfile: adding src/base/ftgxval.c
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c, src/gxvalid/gxvfeat.c,
src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c,
src/gxvalid/gxvmort.c, src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c, src/gxvalid/gxvmort5.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/sfnt/sfdriver.c, src/truetype/ttgload.c:
removing _many_ compiler warnings when compiling with Visual C++
at maximum level (/W4)
2005-09-23 15:22:10 +02:00
|
|
|
Exit:
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
*length_p = (FT_ULong)( p - table );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_LOCAL_DEF( void )
|
|
|
|
gxv_XStateTable_validate( FT_Bytes table,
|
|
|
|
FT_Bytes limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
/* StateHeader members */
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_ULong classTable; /* offset to Class(Sub)Table */
|
|
|
|
FT_ULong stateArray; /* offset to StateArray */
|
|
|
|
FT_ULong entryTable; /* offset to EntryTable */
|
|
|
|
|
|
|
|
FT_ULong classTable_length;
|
|
|
|
FT_ULong stateArray_length;
|
|
|
|
FT_ULong entryTable_length;
|
|
|
|
FT_UShort maxState;
|
|
|
|
FT_UShort maxEntry;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_XStateTable_Subtable_Setup_Func setup_func;
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
FT_Bytes p = table;
|
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_NAME_ENTER( "XStateTable" );
|
|
|
|
|
|
|
|
GXV_TRACE(( "XStateTable header\n" ));
|
|
|
|
|
|
|
|
GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 );
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid->xstatetable.nClasses = FT_NEXT_ULONG( p );
|
2005-08-24 06:31:31 +02:00
|
|
|
classTable = FT_NEXT_ULONG( p );
|
|
|
|
stateArray = FT_NEXT_ULONG( p );
|
|
|
|
entryTable = FT_NEXT_ULONG( p );
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_TRACE(( "nClasses =0x%08x\n", gxvalid->xstatetable.nClasses ));
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_TRACE(( "offset to classTable=0x%08x\n", classTable ));
|
|
|
|
GXV_TRACE(( "offset to stateArray=0x%08x\n", stateArray ));
|
|
|
|
GXV_TRACE(( "offset to entryTable=0x%08x\n", entryTable ));
|
|
|
|
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
if ( gxvalid->xstatetable.nClasses > 0xFFFFU )
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_INVALID_DATA;
|
|
|
|
|
|
|
|
GXV_TRACE(( "StateTable Subtables\n" ));
|
|
|
|
|
2016-12-26 17:08:17 +01:00
|
|
|
if ( gxvalid->xstatetable.optdata_load_func )
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid->xstatetable.optdata_load_func( p, limit, gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2016-12-26 17:08:17 +01:00
|
|
|
if ( gxvalid->xstatetable.subtable_setup_func )
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
setup_func = gxvalid->xstatetable.subtable_setup_func;
|
2005-08-24 06:31:31 +02:00
|
|
|
else
|
|
|
|
setup_func = gxv_XStateTable_subtable_setup;
|
|
|
|
|
[gxvalid] Signedness fixes.
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
2015-02-25 07:53:09 +01:00
|
|
|
setup_func( (FT_ULong)( limit - table ),
|
2005-08-24 06:31:31 +02:00
|
|
|
classTable,
|
|
|
|
stateArray,
|
|
|
|
entryTable,
|
|
|
|
&classTable_length,
|
|
|
|
&stateArray_length,
|
|
|
|
&entryTable_length,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( classTable != 0 )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid->xstatetable.maxClassID = 0;
|
|
|
|
gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
|
|
|
|
gxvalid->lookupval_func = gxv_XClassTable_lookupval_validate;
|
|
|
|
gxvalid->lookupfmt4_trans = gxv_XClassTable_lookupfmt4_transit;
|
2005-08-24 06:31:31 +02:00
|
|
|
gxv_LookupTable_validate( table + classTable,
|
|
|
|
table + classTable + classTable_length,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid );
|
2013-08-01 12:20:20 +02:00
|
|
|
#if 0
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
if ( gxvalid->subtable_length < classTable_length )
|
|
|
|
classTable_length = gxvalid->subtable_length;
|
2013-08-01 12:20:20 +02:00
|
|
|
#endif
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
else
|
* src/base/Jamfile: adding src/base/ftgxval.c
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c, src/gxvalid/gxvfeat.c,
src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c,
src/gxvalid/gxvmort.c, src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c, src/gxvalid/gxvmort5.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/sfnt/sfdriver.c, src/truetype/ttgload.c:
removing _many_ compiler warnings when compiling with Visual C++
at maximum level (/W4)
2005-09-23 15:22:10 +02:00
|
|
|
{
|
2005-09-28 09:34:45 +02:00
|
|
|
/* XXX: check range? */
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid->xstatetable.maxClassID =
|
|
|
|
(FT_UShort)( gxvalid->xstatetable.nClasses - 1 );
|
* src/base/Jamfile: adding src/base/ftgxval.c
* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c, src/gxvalid/gxvfeat.c,
src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c,
src/gxvalid/gxvmort.c, src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c, src/gxvalid/gxvmort5.c,
src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c, src/gxvalid/gxvopbd.c,
src/gxvalid/gxvprop.c, src/sfnt/sfdriver.c, src/truetype/ttgload.c:
removing _many_ compiler warnings when compiling with Visual C++
at maximum level (/W4)
2005-09-23 15:22:10 +02:00
|
|
|
}
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( stateArray != 0 )
|
2005-08-24 06:31:31 +02:00
|
|
|
gxv_XStateArray_validate( table + stateArray,
|
|
|
|
&stateArray_length,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid->xstatetable.maxClassID,
|
|
|
|
gxvalid->xstatetable.nClasses,
|
2005-08-24 06:31:31 +02:00
|
|
|
&maxState,
|
|
|
|
&maxEntry,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
else
|
|
|
|
{
|
2013-08-01 12:20:20 +02:00
|
|
|
#if 0
|
2005-08-24 06:31:31 +02:00
|
|
|
maxState = 1; /* 0:start of text, 1:start of line are predefined */
|
2013-08-01 12:20:20 +02:00
|
|
|
#endif
|
2005-08-24 06:31:31 +02:00
|
|
|
maxEntry = 0;
|
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( maxEntry > 0 && entryTable == 0 )
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_INVALID_OFFSET;
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
if ( entryTable != 0 )
|
2005-08-24 06:31:31 +02:00
|
|
|
gxv_XEntryTable_validate( table + entryTable,
|
|
|
|
&entryTable_length,
|
|
|
|
maxEntry,
|
|
|
|
stateArray_length,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid->xstatetable.maxClassID,
|
2005-08-24 06:31:31 +02:00
|
|
|
table,
|
|
|
|
limit,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** Table overlapping *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
Fixes for `make multi' and using C++ compiler.
* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
(gxv_compare_ranges): Make it static.
(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
trace messages.
(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
gxvcommn.h.
* gxvalid/gxvcommn.h: Add prototypes for
gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
gxv_XStateTable_validate, gxv_array_getlimits_byte,
gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
gxv_odtect_validate.
(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
gxvcommn.c.
* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
gxv_bsln_parts_fmt1_validate): Improve trace messages.
* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
* gxvalid/gxvfeat.h: New file.
* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
message.
* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
(gxv_kern_subtable_fmt1_valueTable_load,
gxv_kern_subtable_fmt1_subtable_setup,
gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
Improve trace message.
(gxv_kern_validate_generic): Fix C++ compiler error.
Improve trace message.
(gxv_kern_validate_classic): Fix C++ compiler error.
* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort1.c
(gxv_mort_subtable_type1_substitutionTable_load,
gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
(gxv_mort_subtable_type1_substTable_validate): Improve trace
message.
(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
gxv_mort_subtable_type2_subtable_setup,
gxv_mort_subtable_type2_ligActionOffset_validate,
gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
errors.
(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmort.c: Include gxvfeat.h.
(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
Declare with FT_LOCAL_DEF.
(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
messages.
* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx1.c
(gxv_morx_subtable_type1_substitutionTable_load,
gxv_morx_subtable_type1_subtable_setup,
gxv_morx_subtable_type1_entry_validate,
gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
compiler errors.
(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
gxv_morx_subtable_type2_subtable_setup,
gxv_morx_subtable_type2_ligActionIndex_validate,
gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
errors.
(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
Fix typo.
* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
with FT_LOCAL_DEF.
* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
gxv_morx_validate): Improve trace message.
* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
warnings.
(gxv_opbd_validate): Improve trace message.
* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
appropriate.
(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
message.
* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
parameter. Update all callers.
(gxv_trak_validate): Improve trace message.
* rules.mk (GXV_DRV_H): Add gxvfeat.h.
2005-09-05 21:31:27 +02:00
|
|
|
static int
|
2005-08-31 18:29:51 +02:00
|
|
|
gxv_compare_ranges( FT_Bytes table1_start,
|
|
|
|
FT_ULong table1_length,
|
|
|
|
FT_Bytes table2_start,
|
|
|
|
FT_ULong table2_length )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
if ( table1_start == table2_start )
|
|
|
|
{
|
|
|
|
if ( ( table1_length == 0 || table2_length == 0 ) )
|
|
|
|
goto Out;
|
|
|
|
}
|
|
|
|
else if ( table1_start < table2_start )
|
|
|
|
{
|
|
|
|
if ( ( table1_start + table1_length ) <= table2_start )
|
|
|
|
goto Out;
|
|
|
|
}
|
|
|
|
else if ( table1_start > table2_start )
|
|
|
|
{
|
|
|
|
if ( ( table1_start >= table2_start + table2_length ) )
|
|
|
|
goto Out;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
Out:
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( void )
|
|
|
|
gxv_odtect_add_range( FT_Bytes start,
|
|
|
|
FT_ULong length,
|
* src/gxvalid/gxvbsln.c (gxv_bsln_validate): Fix tracing message.
* src/gxvalid/gxvcommn.c (gxv_odtect_add_range): Use `const'.
* src/gxvalid/gxvfeat.c, src/gxvalid/gxvjust.c,
src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmod.c,
src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c,
src/gxvalid/gxvmort5.c, src/gxvalid/gxvmort.c: Improve tracing
messages.
Decorate constants with `U' and `L' where appropriate.
Fix compiler warnings.
2005-09-01 00:39:23 +02:00
|
|
|
const FT_String* name,
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_odtect_Range odtect )
|
|
|
|
{
|
2012-02-26 08:47:20 +01:00
|
|
|
odtect->range[odtect->nRanges].start = start;
|
|
|
|
odtect->range[odtect->nRanges].length = length;
|
|
|
|
odtect->range[odtect->nRanges].name = (FT_String*)name;
|
2005-08-31 18:29:51 +02:00
|
|
|
odtect->nRanges++;
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_LOCAL_DEF( void )
|
|
|
|
gxv_odtect_validate( GXV_odtect_Range odtect,
|
[gxvalid] Fix a naming convention conflicting with ftvalid.
See previous changeset for otvalid.
* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
`valid' by `gxvalid'.
* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
it is typed as GXV_Validator.
2014-12-09 06:51:52 +01:00
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
|
|
|
FT_UInt i, j;
|
|
|
|
|
|
|
|
|
|
|
|
GXV_NAME_ENTER( "check overlap among multi ranges" );
|
|
|
|
|
2005-08-31 18:29:51 +02:00
|
|
|
for ( i = 0; i < odtect->nRanges; i++ )
|
|
|
|
for ( j = 0; j < i; j++ )
|
2005-08-24 06:31:31 +02:00
|
|
|
if ( 0 != gxv_compare_ranges( odtect->range[i].start,
|
|
|
|
odtect->range[i].length,
|
|
|
|
odtect->range[j].start,
|
2005-08-31 18:29:51 +02:00
|
|
|
odtect->range[j].length ) )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2013-08-01 12:20:20 +02:00
|
|
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
2005-08-24 06:31:31 +02:00
|
|
|
if ( odtect->range[i].name || odtect->range[j].name )
|
2005-08-31 18:29:51 +02:00
|
|
|
GXV_TRACE(( "found overlap between range %d and range %d\n",
|
|
|
|
i, j ));
|
2005-08-24 06:31:31 +02:00
|
|
|
else
|
2005-08-31 18:29:51 +02:00
|
|
|
GXV_TRACE(( "found overlap between `%s' and `%s\'\n",
|
|
|
|
odtect->range[i].name,
|
|
|
|
odtect->range[j].name ));
|
2013-08-01 12:20:20 +02:00
|
|
|
#endif
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_INVALID_OFFSET;
|
|
|
|
}
|
|
|
|
|
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* END */
|