2018-06-03 09:01:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* gxvmorx2.c
|
|
|
|
*
|
|
|
|
* TrueTypeGX/AAT morx table validation
|
|
|
|
* body for type2 (Ligature Substitution) subtable.
|
|
|
|
*
|
2021-01-17 07:18:48 +01:00
|
|
|
* Copyright (C) 2005-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.
|
|
|
|
*
|
|
|
|
*/
|
2005-08-24 06:31:31 +02:00
|
|
|
|
2018-06-03 09:01:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
2005-09-01 09:33:03 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
#include "gxvmorx.h"
|
|
|
|
|
2005-09-01 09:33:03 +02:00
|
|
|
|
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 gxvmorx
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct GXV_morx_subtable_type2_StateOptRec_
|
|
|
|
{
|
|
|
|
FT_ULong ligActionTable;
|
|
|
|
FT_ULong componentTable;
|
|
|
|
FT_ULong ligatureTable;
|
|
|
|
FT_ULong ligActionTable_length;
|
|
|
|
FT_ULong componentTable_length;
|
|
|
|
FT_ULong ligatureTable_length;
|
|
|
|
|
|
|
|
} GXV_morx_subtable_type2_StateOptRec,
|
|
|
|
*GXV_morx_subtable_type2_StateOptRecData;
|
|
|
|
|
2005-09-01 09:33:03 +02:00
|
|
|
|
|
|
|
#define GXV_MORX_SUBTABLE_TYPE2_HEADER_SIZE \
|
|
|
|
( GXV_XSTATETABLE_HEADER_SIZE + 4 + 4 + 4 )
|
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
static void
|
|
|
|
gxv_morx_subtable_type2_opttable_load( 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-09-01 09:33:03 +02:00
|
|
|
FT_Bytes p = table;
|
|
|
|
|
|
|
|
GXV_morx_subtable_type2_StateOptRecData optdata =
|
[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_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;
|
2005-09-01 09:33:03 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_LIMIT_CHECK( 4 + 4 + 4 );
|
|
|
|
optdata->ligActionTable = FT_NEXT_ULONG( p );
|
|
|
|
optdata->componentTable = FT_NEXT_ULONG( p );
|
|
|
|
optdata->ligatureTable = FT_NEXT_ULONG( p );
|
|
|
|
|
2005-09-01 09:33:03 +02:00
|
|
|
GXV_TRACE(( "offset to ligActionTable=0x%08x\n",
|
|
|
|
optdata->ligActionTable ));
|
|
|
|
GXV_TRACE(( "offset to componentTable=0x%08x\n",
|
|
|
|
optdata->componentTable ));
|
|
|
|
GXV_TRACE(( "offset to ligatureTable=0x%08x\n",
|
|
|
|
optdata->ligatureTable ));
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
2005-09-01 09:33:03 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
static void
|
|
|
|
gxv_morx_subtable_type2_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[6];
|
|
|
|
FT_ULong* l[6];
|
|
|
|
FT_ULong buff[7];
|
2005-09-01 09:33:03 +02:00
|
|
|
|
|
|
|
GXV_morx_subtable_type2_StateOptRecData optdata =
|
[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_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
GXV_NAME_ENTER( "subtable boundaries setup" );
|
|
|
|
|
|
|
|
o[0] = classTable;
|
|
|
|
o[1] = stateArray;
|
|
|
|
o[2] = entryTable;
|
|
|
|
o[3] = optdata->ligActionTable;
|
|
|
|
o[4] = optdata->componentTable;
|
|
|
|
o[5] = optdata->ligatureTable;
|
|
|
|
l[0] = classTable_length_p;
|
|
|
|
l[1] = stateArray_length_p;
|
|
|
|
l[2] = entryTable_length_p;
|
|
|
|
l[3] = &(optdata->ligActionTable_length);
|
|
|
|
l[4] = &(optdata->componentTable_length);
|
|
|
|
l[5] = &(optdata->ligatureTable_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
|
|
|
gxv_set_length_by_ulong_offset( o, l, buff, 6, table_size, gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_TRACE(( "classTable: offset=0x%08x length=0x%08x\n",
|
2005-09-01 09:33:03 +02:00
|
|
|
classTable, *classTable_length_p ));
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_TRACE(( "stateArray: offset=0x%08x length=0x%08x\n",
|
2005-09-01 09:33:03 +02:00
|
|
|
stateArray, *stateArray_length_p ));
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_TRACE(( "entryTable: offset=0x%08x length=0x%08x\n",
|
2005-09-01 09:33:03 +02:00
|
|
|
entryTable, *entryTable_length_p ));
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_TRACE(( "ligActionTable: offset=0x%08x length=0x%08x\n",
|
2005-09-01 09:33:03 +02:00
|
|
|
optdata->ligActionTable,
|
|
|
|
optdata->ligActionTable_length ));
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_TRACE(( "componentTable: offset=0x%08x length=0x%08x\n",
|
2005-09-01 09:33:03 +02:00
|
|
|
optdata->componentTable,
|
|
|
|
optdata->componentTable_length ));
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_TRACE(( "ligatureTable: offset=0x%08x length=0x%08x\n",
|
2005-09-01 09:33:03 +02:00
|
|
|
optdata->ligatureTable,
|
|
|
|
optdata->ligatureTable_length ));
|
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
2005-09-01 09:33:03 +02:00
|
|
|
|
|
|
|
#define GXV_MORX_LIGACTION_ENTRY_SIZE 4
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
2005-09-01 09:33:03 +02:00
|
|
|
gxv_morx_subtable_type2_ligActionIndex_validate(
|
|
|
|
FT_Bytes table,
|
|
|
|
FT_UShort ligActionIndex,
|
[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
|
|
|
{
|
|
|
|
/* access ligActionTable */
|
2005-09-01 09:33:03 +02:00
|
|
|
GXV_morx_subtable_type2_StateOptRecData optdata =
|
[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_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;
|
2005-09-01 09:33:03 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_Bytes lat_base = table + optdata->ligActionTable;
|
2005-09-01 09:33:03 +02:00
|
|
|
FT_Bytes p = lat_base +
|
|
|
|
ligActionIndex * GXV_MORX_LIGACTION_ENTRY_SIZE;
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_Bytes lat_limit = lat_base + optdata->ligActionTable;
|
|
|
|
|
|
|
|
|
|
|
|
if ( p < lat_base )
|
|
|
|
{
|
|
|
|
GXV_TRACE(( "p < lat_base (%d byte rewind)\n", lat_base - p ));
|
|
|
|
FT_INVALID_OFFSET;
|
|
|
|
}
|
|
|
|
else if ( lat_limit < p )
|
|
|
|
{
|
|
|
|
GXV_TRACE(( "lat_limit < p (%d byte overrun)\n", p - lat_limit ));
|
|
|
|
FT_INVALID_OFFSET;
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
/* validate entry in ligActionTable */
|
|
|
|
FT_ULong lig_action;
|
[gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_morx_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.
* src/gxvalid/gxmorx0.c
(gxv_morx_subtable_type0_entry_validate):
Conditionalize unvalidated variables; `markFirst',
`dontAdvance', `markLast', `verb'.
* src/gxvalid/gxmorx1.c
(gxv_morx_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.
* src/gxvalid/gxvmorx2.c
(gxv_morx_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_morx_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance', `performAction'.
(gxv_morx_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.
* src/gxvalid/gxvmort5.c
(gxv_morx_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array. (gxv_morx_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 16:54:10 +02:00
|
|
|
#ifdef GXV_LOAD_UNUSED_VARS
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_UShort last;
|
|
|
|
FT_UShort store;
|
[gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_morx_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.
* src/gxvalid/gxmorx0.c
(gxv_morx_subtable_type0_entry_validate):
Conditionalize unvalidated variables; `markFirst',
`dontAdvance', `markLast', `verb'.
* src/gxvalid/gxmorx1.c
(gxv_morx_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.
* src/gxvalid/gxvmorx2.c
(gxv_morx_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_morx_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance', `performAction'.
(gxv_morx_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.
* src/gxvalid/gxvmort5.c
(gxv_morx_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array. (gxv_morx_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 16:54:10 +02:00
|
|
|
#endif
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_ULong offset;
|
2011-10-07 18:30:49 +02:00
|
|
|
FT_Long gid_limit;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
lig_action = FT_NEXT_ULONG( p );
|
[gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_morx_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.
* src/gxvalid/gxmorx0.c
(gxv_morx_subtable_type0_entry_validate):
Conditionalize unvalidated variables; `markFirst',
`dontAdvance', `markLast', `verb'.
* src/gxvalid/gxmorx1.c
(gxv_morx_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.
* src/gxvalid/gxvmorx2.c
(gxv_morx_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_morx_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance', `performAction'.
(gxv_morx_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.
* src/gxvalid/gxvmort5.c
(gxv_morx_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array. (gxv_morx_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 16:54:10 +02:00
|
|
|
#ifdef GXV_LOAD_UNUSED_VARS
|
2005-09-28 09:34:45 +02:00
|
|
|
last = (FT_UShort)( ( lig_action >> 31 ) & 1 );
|
|
|
|
store = (FT_UShort)( ( lig_action >> 30 ) & 1 );
|
[gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_morx_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.
* src/gxvalid/gxmorx0.c
(gxv_morx_subtable_type0_entry_validate):
Conditionalize unvalidated variables; `markFirst',
`dontAdvance', `markLast', `verb'.
* src/gxvalid/gxmorx1.c
(gxv_morx_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.
* src/gxvalid/gxvmorx2.c
(gxv_morx_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_morx_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance', `performAction'.
(gxv_morx_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.
* src/gxvalid/gxvmort5.c
(gxv_morx_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array. (gxv_morx_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 16:54:10 +02:00
|
|
|
#endif
|
2005-09-28 09:34:45 +02:00
|
|
|
|
|
|
|
offset = lig_action & 0x3FFFFFFFUL;
|
[gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_morx_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.
* src/gxvalid/gxmorx0.c
(gxv_morx_subtable_type0_entry_validate):
Conditionalize unvalidated variables; `markFirst',
`dontAdvance', `markLast', `verb'.
* src/gxvalid/gxmorx1.c
(gxv_morx_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.
* src/gxvalid/gxvmorx2.c
(gxv_morx_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_morx_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance', `performAction'.
(gxv_morx_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.
* src/gxvalid/gxvmort5.c
(gxv_morx_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array. (gxv_morx_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 16:54:10 +02:00
|
|
|
|
|
|
|
/* this offset is 30-bit signed value to add to GID */
|
|
|
|
/* it is different from the location offset in mort */
|
|
|
|
if ( ( offset & 0x3FFF0000UL ) == 0x3FFF0000UL )
|
2011-10-07 18:30:49 +02:00
|
|
|
{ /* negative offset */
|
[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
|
|
|
gid_limit = gxvalid->face->num_glyphs -
|
|
|
|
(FT_Long)( offset & 0x0000FFFFUL );
|
2011-10-07 18:30:49 +02:00
|
|
|
if ( gid_limit > 0 )
|
[gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_morx_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.
* src/gxvalid/gxmorx0.c
(gxv_morx_subtable_type0_entry_validate):
Conditionalize unvalidated variables; `markFirst',
`dontAdvance', `markLast', `verb'.
* src/gxvalid/gxmorx1.c
(gxv_morx_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.
* src/gxvalid/gxvmorx2.c
(gxv_morx_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_morx_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance', `performAction'.
(gxv_morx_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.
* src/gxvalid/gxvmort5.c
(gxv_morx_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array. (gxv_morx_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 16:54:10 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
GXV_TRACE(( "ligature action table includes"
|
|
|
|
" too negative offset moving all GID"
|
|
|
|
" below defined range: 0x%04x\n",
|
|
|
|
offset & 0xFFFFU ));
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
|
[gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_morx_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.
* src/gxvalid/gxmorx0.c
(gxv_morx_subtable_type0_entry_validate):
Conditionalize unvalidated variables; `markFirst',
`dontAdvance', `markLast', `verb'.
* src/gxvalid/gxmorx1.c
(gxv_morx_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.
* src/gxvalid/gxvmorx2.c
(gxv_morx_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_morx_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance', `performAction'.
(gxv_morx_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.
* src/gxvalid/gxvmort5.c
(gxv_morx_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array. (gxv_morx_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 16:54:10 +02:00
|
|
|
}
|
2014-12-07 09:40:47 +01:00
|
|
|
else if ( ( offset & 0x3FFF0000UL ) == 0x00000000UL )
|
2011-10-07 18:30:49 +02:00
|
|
|
{ /* positive offset */
|
[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_Long)offset < gxvalid->face->num_glyphs )
|
[gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_morx_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.
* src/gxvalid/gxmorx0.c
(gxv_morx_subtable_type0_entry_validate):
Conditionalize unvalidated variables; `markFirst',
`dontAdvance', `markLast', `verb'.
* src/gxvalid/gxmorx1.c
(gxv_morx_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.
* src/gxvalid/gxvmorx2.c
(gxv_morx_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_morx_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance', `performAction'.
(gxv_morx_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.
* src/gxvalid/gxvmort5.c
(gxv_morx_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array. (gxv_morx_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 16:54:10 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
GXV_TRACE(( "ligature action table includes"
|
|
|
|
" too large offset moving all GID"
|
|
|
|
" over defined range: 0x%04x\n",
|
|
|
|
offset & 0xFFFFU ));
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
|
[gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_morx_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.
* src/gxvalid/gxmorx0.c
(gxv_morx_subtable_type0_entry_validate):
Conditionalize unvalidated variables; `markFirst',
`dontAdvance', `markLast', `verb'.
* src/gxvalid/gxmorx1.c
(gxv_morx_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.
* src/gxvalid/gxvmorx2.c
(gxv_morx_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_morx_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance', `performAction'.
(gxv_morx_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.
* src/gxvalid/gxvmort5.c
(gxv_morx_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array. (gxv_morx_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 16:54:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
GXV_TRACE(( "ligature action table includes"
|
|
|
|
" invalid offset to add to 16-bit GID:"
|
|
|
|
" 0x%08x\n", offset ));
|
2011-06-14 18:10:33 +02:00
|
|
|
GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2005-09-01 09:33:03 +02:00
|
|
|
gxv_morx_subtable_type2_entry_validate(
|
|
|
|
FT_UShort state,
|
|
|
|
FT_UShort flags,
|
2009-07-31 17:29:29 +02:00
|
|
|
GXV_StateTable_GlyphOffsetCPtr glyphOffset_p,
|
2005-09-01 09:33:03 +02:00
|
|
|
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
|
|
|
{
|
[gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_morx_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.
* src/gxvalid/gxmorx0.c
(gxv_morx_subtable_type0_entry_validate):
Conditionalize unvalidated variables; `markFirst',
`dontAdvance', `markLast', `verb'.
* src/gxvalid/gxmorx1.c
(gxv_morx_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.
* src/gxvalid/gxvmorx2.c
(gxv_morx_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_morx_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance', `performAction'.
(gxv_morx_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.
* src/gxvalid/gxvmort5.c
(gxv_morx_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array. (gxv_morx_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 16:54:10 +02:00
|
|
|
#ifdef GXV_LOAD_UNUSED_VARS
|
2005-09-01 09:33:03 +02:00
|
|
|
FT_UShort setComponent;
|
|
|
|
FT_UShort dontAdvance;
|
|
|
|
FT_UShort performAction;
|
[gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_morx_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.
* src/gxvalid/gxmorx0.c
(gxv_morx_subtable_type0_entry_validate):
Conditionalize unvalidated variables; `markFirst',
`dontAdvance', `markLast', `verb'.
* src/gxvalid/gxmorx1.c
(gxv_morx_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.
* src/gxvalid/gxvmorx2.c
(gxv_morx_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_morx_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance', `performAction'.
(gxv_morx_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.
* src/gxvalid/gxvmort5.c
(gxv_morx_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array. (gxv_morx_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 16:54:10 +02:00
|
|
|
#endif
|
2005-09-01 09:33:03 +02:00
|
|
|
FT_UShort reserved;
|
|
|
|
FT_UShort ligActionIndex;
|
|
|
|
|
|
|
|
FT_UNUSED( state );
|
|
|
|
FT_UNUSED( limit );
|
|
|
|
|
|
|
|
|
[gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_morx_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.
* src/gxvalid/gxmorx0.c
(gxv_morx_subtable_type0_entry_validate):
Conditionalize unvalidated variables; `markFirst',
`dontAdvance', `markLast', `verb'.
* src/gxvalid/gxmorx1.c
(gxv_morx_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.
* src/gxvalid/gxvmorx2.c
(gxv_morx_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_morx_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance', `performAction'.
(gxv_morx_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.
* src/gxvalid/gxvmort5.c
(gxv_morx_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array. (gxv_morx_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 16:54:10 +02:00
|
|
|
#ifdef GXV_LOAD_UNUSED_VARS
|
2005-09-28 09:34:45 +02:00
|
|
|
setComponent = (FT_UShort)( ( flags >> 15 ) & 1 );
|
|
|
|
dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
|
|
|
|
performAction = (FT_UShort)( ( flags >> 13 ) & 1 );
|
[gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
Conditionalize unvalidated variable `subFeatureFlags'.
(gxv_morx_chain_validate): Conditionalize unvalidated
variable `defaultFlags'.
* src/gxvalid/gxmorx0.c
(gxv_morx_subtable_type0_entry_validate):
Conditionalize unvalidated variables; `markFirst',
`dontAdvance', `markLast', `verb'.
* src/gxvalid/gxmorx1.c
(gxv_morx_subtable_type1_entry_validate): Conditionalize
unvalidated variables; `setMark', `dontAdvance'.
* src/gxvalid/gxvmorx2.c
(gxv_morx_subtable_type2_ligActionOffset_validate):
Conditionalize unvalidated variables; `last', `store'.
Checking for overrunning offset is added.
(gxv_morx_subtable_type2_entry_validate):
Conditionalize unvalidated variables; `setComponent',
`dontAdvance', `performAction'.
(gxv_morx_subtable_type2_ligatureTable_validate):
Check if the GID for ligature does not exceed the
max GID in `maxp' table.
* src/gxvalid/gxvmort5.c
(gxv_morx_subtable_type5_InsertList_validate):
Conditionalize unvalidated loading of `insert_glyphID'
array. (gxv_morx_subtable_type5_entry_validate):
Conditionalize unvalidated variables; `setMark',
`dontAdvance', `currentIsKashidaLike',
`markedIsKashidaLike', `currentInsertBefore',
`markedInsertBefore'.
2011-06-14 16:54:10 +02:00
|
|
|
#endif
|
2005-09-28 09:34:45 +02:00
|
|
|
|
|
|
|
reserved = (FT_UShort)( flags & 0x1FFF );
|
2009-07-31 17:29:29 +02:00
|
|
|
ligActionIndex = glyphOffset_p->u;
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
if ( reserved > 0 )
|
|
|
|
GXV_TRACE(( " reserved 14bit is non-zero\n" ));
|
|
|
|
|
|
|
|
if ( 0 < ligActionIndex )
|
2005-09-01 09:33:03 +02:00
|
|
|
gxv_morx_subtable_type2_ligActionIndex_validate(
|
[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
|
|
|
table, ligActionIndex, gxvalid );
|
2005-08-24 06:31:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gxv_morx_subtable_type2_ligatureTable_validate( FT_Bytes 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
|
|
|
GXV_Validator gxvalid )
|
2005-08-24 06:31:31 +02:00
|
|
|
{
|
2005-09-01 09:33:03 +02:00
|
|
|
GXV_morx_subtable_type2_StateOptRecData optdata =
|
[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_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;
|
2005-09-01 09:33:03 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
FT_Bytes p = table + optdata->ligatureTable;
|
|
|
|
FT_Bytes limit = table + optdata->ligatureTable
|
|
|
|
+ optdata->ligatureTable_length;
|
|
|
|
|
2005-09-01 09:33:03 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_NAME_ENTER( "morx chain subtable type2 - substitutionTable" );
|
2005-09-01 09:33:03 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
if ( 0 != optdata->ligatureTable )
|
|
|
|
{
|
|
|
|
/* Apple does not give specification of ligatureTable format */
|
|
|
|
while ( p < limit )
|
|
|
|
{
|
2005-09-01 09:33:03 +02:00
|
|
|
FT_UShort lig_gid;
|
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
|
|
|
|
GXV_LIMIT_CHECK( 2 );
|
|
|
|
lig_gid = 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
|
|
|
if ( lig_gid < 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
|
|
|
}
|
|
|
|
}
|
2005-09-01 09:33:03 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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_morx_subtable_type2_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;
|
2005-09-01 09:33:03 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_morx_subtable_type2_StateOptRec lig_rec;
|
|
|
|
|
2005-09-01 09:33:03 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_NAME_ENTER( "morx chain subtable type2 (Ligature Substitution)" );
|
|
|
|
|
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_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE2_HEADER_SIZE );
|
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.optdata =
|
2005-09-01 09:33:03 +02:00
|
|
|
&lig_rec;
|
[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 =
|
2005-09-01 09:33:03 +02:00
|
|
|
gxv_morx_subtable_type2_opttable_load;
|
[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.subtable_setup_func =
|
2005-09-01 09:33:03 +02:00
|
|
|
gxv_morx_subtable_type2_subtable_setup;
|
[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_glyphoffset_fmt =
|
2005-09-01 09:33:03 +02:00
|
|
|
GXV_GLYPHOFFSET_USHORT;
|
[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 =
|
2005-09-01 09:33:03 +02:00
|
|
|
gxv_morx_subtable_type2_entry_validate;
|
|
|
|
|
[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_XStateTable_validate( p, limit, gxvalid );
|
2005-09-01 09:33:03 +02:00
|
|
|
|
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
|
|
|
p += gxvalid->subtable_length;
|
2013-08-01 12:20:20 +02:00
|
|
|
#endif
|
[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_morx_subtable_type2_ligatureTable_validate( table, gxvalid );
|
2005-09-01 09:33:03 +02:00
|
|
|
|
2005-08-24 06:31:31 +02:00
|
|
|
GXV_EXIT;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* END */
|