diff options
author | Reinhard Tartler <siretart@tauware.de> | 2011-10-10 17:43:39 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-10-10 17:43:39 +0200 |
commit | f4092abdf94af6a99aff944d6264bc1284e8bdd4 (patch) | |
tree | 2ac1c9cc16ceb93edb2c4382c088dac5aeafdf0f /nx-X11/extras/freetype2/src/otlayout/otljstf.c | |
parent | a840692edc9c6d19cd7c057f68e39c7d95eb767d (diff) | |
download | nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.tar.gz nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.tar.bz2 nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.zip |
Imported nx-X11-3.1.0-1.tar.gznx-X11/3.1.0-1
Summary: Imported nx-X11-3.1.0-1.tar.gz
Keywords:
Imported nx-X11-3.1.0-1.tar.gz
into Git repository
Diffstat (limited to 'nx-X11/extras/freetype2/src/otlayout/otljstf.c')
-rw-r--r-- | nx-X11/extras/freetype2/src/otlayout/otljstf.c | 189 |
1 files changed, 189 insertions, 0 deletions
diff --git a/nx-X11/extras/freetype2/src/otlayout/otljstf.c b/nx-X11/extras/freetype2/src/otlayout/otljstf.c new file mode 100644 index 000000000..b0fa9f406 --- /dev/null +++ b/nx-X11/extras/freetype2/src/otlayout/otljstf.c @@ -0,0 +1,189 @@ +#include "otljstf.h" +#include "otlcommn.h" +#include "otlgpos.h" + + static void + otl_jstf_extender_validate( OTL_Bytes table, + OTL_Validator valid ) + { + OTL_Bytes p = table; + OTL_UInt count; + + OTL_CHECK( 2 ); + + count = OTL_NEXT_USHORT( p ); + + OTL_CHECK( count*2 ); + } + + + static void + otl_jstf_gsub_mods_validate( OTL_Bytes table, + OTL_Validator valid ) + { + OTL_Bytes p = table; + OTL_UInt count; + + OTL_CHECK( 2 ); + count = OTL_NEXT_USHORT( p ); + OTL_CHECK( count*2 ); + + /* XXX: check GSUB lookup indices */ + } + + + static void + otl_jstf_gpos_mods_validate( OTL_Bytes table, + OTL_Validator valid ) + { + OTL_Bytes p = table; + OTL_UInt count; + + OTL_CHECK( 2 ); + count = OTL_NEXT_USHORT( p ); + OTL_CHECK( count*2 ); + + /* XXX: check GPOS lookup indices */ + } + + + static void + otl_jstf_max_validate( OTL_Bytes table, + OTL_Validator valid ) + { + OTL_Bytes p = table; + OTL_UInt count; + + OTL_CHECK( 2 ); + + count = OTL_NEXT_USHORT( p ); + + OTL_CHECK( count*2 ); + for ( ; count > 0; count-- ) + otl_gpos_subtable_check( table + OTL_NEXT_USHORT( p ), valid ); + } + + + static void + otl_jstf_priority_validate( OTL_Bytes table, + OTL_Validator valid ) + { + OTL_Bytes p = table; + OTL_UInt offset; + + OTL_CHECK( 20 ); + + /* shrinkage GSUB enable/disable */ + val = OTL_NEXT_USHORT( p ); + if ( val ) + otl_jstf_gsub_mods_validate( table + val, valid ); + + val = OTL_NEXT_USHORT( p ); + if ( val ) + otl_jstf_gsub_mods_validate( table + val, valid ); + + /* shrinkage GPOS enable/disable */ + val = OTL_NEXT_USHORT( p ); + if ( val ) + otl_jstf_gpos_mods_validate( table + val, valid ); + + val = OTL_NEXT_USHORT( p ); + if ( val ) + otl_jstf_gpos_mods_validate( table + val, valid ); + + /* shrinkage JSTF max */ + val = OTL_NEXT_USHORT( p ); + if ( val ) + otl_jstf_max_validate( table + val, valid ); + + /* extension GSUB enable/disable */ + val = OTL_NEXT_USHORT( p ); + if ( val ) + otl_jstf_gsub_mods_validate( table + val, valid ); + + val = OTL_NEXT_USHORT( p ); + if ( val ) + otl_jstf_gsub_mods_validate( table + val, valid ); + + /* extension GPOS enable/disable */ + val = OTL_NEXT_USHORT( p ); + if ( val ) + otl_jstf_gpos_mods_validate( table + val, valid ); + + val = OTL_NEXT_USHORT( p ); + if ( val ) + otl_jstf_gpos_mods_validate( table + val, valid ); + + /* extension JSTF max */ + val = OTL_NEXT_USHORT( p ); + if ( val ) + otl_jstf_max_validate( table + val, valid ); + } + + static void + otl_jstf_lang_validate( OTL_Bytes table, + OTL_Validator valid ) + { + OTL_Bytes p = table; + OTL_UInt count; + + OTL_CHECK( 2 ); + + count = OTL_NEXT_USHORT( p ); + + OTL_CHECK( count*2 ); + for ( ; count > 0; count-- ) + otl_jstf_priority_validate( table + OTL_NEXT_USHORT( p ), valid ); + } + + + static void + otl_jstf_script_validate( OTL_Bytes table, + OTL_Validator valid ) + { + OTL_Bytes p = table; + OTL_UInt count, extender, default_lang; + + OTL_CHECK( 6 ); + extender = OTL_NEXT_USHORT( p ); + default_lang = OTL_NEXT_USHORT( p ); + count = OTL_NEXT_USHORT( p ); + + if ( extender ) + otl_jstf_extender_validate( table + extender, valid ); + + if ( default_lang ) + otl_jstf_lang_validate( table + default_lang, valid ); + + OTL_CHECK( 6*count ); + + for ( ; count > 0; count-- ) + { + p += 4; /* ignore tag */ + otl_jstf_lang_validate( table + OTL_NEXT_USHORT( p ), valid ); + } + } + + + OTL_LOCALDEF( void ) + otl_jstf_validate( OTL_Bytes table, + OTL_Validator valid ) + { + OTL_Bytes p = table; + OTL_UInt count; + + OTL_CHECK( 4 ); + + if ( OTL_NEXT_ULONG( p ) != 0x10000UL ) + OTL_INVALID_DATA; + + count = OTL_NEXT_USHORT( p ); + OTL_CHECK( count*6 ); + + for ( ; count > 0; count++ ) + { + p += 4; /* ignore tag */ + otl_jstf_script_validate( table + OTL_NEXT_USHORT( p ), valid ); + } + } +
\ No newline at end of file |