From 5716ae278a82d318ddbfeba01d0785d4efbe1454 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 24 Oct 2007 22:44:47 +0000 Subject: [PATCH] New header file harfbuzz-global.h. Rename FT_* int types to HB_* types. 2007-10-24 Behdad Esfahbod * pango/opentype/*: New header file harfbuzz-global.h. Rename FT_* int types to HB_* types. --- src/Makefile.am | 1 + src/ftglue.c | 30 +- src/ftglue.h | 26 +- src/harfbuzz-buffer-private.h | 26 +- src/harfbuzz-buffer.c | 40 +-- src/harfbuzz-buffer.h | 42 +-- src/harfbuzz-dump-main.c | 24 +- src/harfbuzz-dump.c | 14 +- src/harfbuzz-dump.h | 4 +- src/harfbuzz-gdef-private.h | 30 +- src/harfbuzz-gdef.c | 104 +++---- src/harfbuzz-gdef.h | 32 +- src/harfbuzz-global.h | 34 +++ src/harfbuzz-gpos-private.h | 182 ++++++------ src/harfbuzz-gpos.c | 540 +++++++++++++++++----------------- src/harfbuzz-gpos.h | 52 ++-- src/harfbuzz-gsub-private.h | 142 ++++----- src/harfbuzz-gsub.c | 432 +++++++++++++-------------- src/harfbuzz-gsub.h | 50 ++-- src/harfbuzz-impl.h | 6 +- src/harfbuzz-open-private.h | 26 +- src/harfbuzz-open.c | 146 ++++----- src/harfbuzz-open.h | 88 +++--- src/harfbuzz.h | 1 + 24 files changed, 1056 insertions(+), 1016 deletions(-) create mode 100644 src/harfbuzz-global.h diff --git a/src/Makefile.am b/src/Makefile.am index 9eb696fc..98adae18 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,6 +19,7 @@ INCLUDEDSOURCES = \ PUBLICHEADERS = \ harfbuzz.h \ + harfbuzz-global.h \ harfbuzz-buffer.h \ harfbuzz-gdef.h \ harfbuzz-gpos.h \ diff --git a/src/ftglue.c b/src/ftglue.c index 0f68ebfa..c565e42a 100644 --- a/src/ftglue.c +++ b/src/ftglue.c @@ -30,7 +30,7 @@ _hb_ftglue_log( const char* format, ... ) /* only used internally */ static FT_Pointer -_hb_ftglue_qalloc( FT_ULong size, +_hb_ftglue_qalloc( HB_UInt size, HB_Error *perror ) { HB_Error error = 0; @@ -52,7 +52,7 @@ _hb_ftglue_qalloc( FT_ULong size, HB_INTERNAL FT_Pointer -_hb_ftglue_alloc( FT_ULong size, +_hb_ftglue_alloc( HB_UInt size, HB_Error *perror ) { HB_Error error = 0; @@ -74,7 +74,7 @@ _hb_ftglue_alloc( FT_ULong size, HB_INTERNAL FT_Pointer _hb_ftglue_realloc( FT_Pointer block, - FT_ULong new_size, + HB_UInt new_size, HB_Error *perror ) { FT_Pointer block2 = NULL; @@ -100,7 +100,7 @@ _hb_ftglue_free( FT_Pointer block ) } -HB_INTERNAL FT_Long +HB_INTERNAL HB_Int _hb_ftglue_stream_pos( FT_Stream stream ) { LOG(( "ftglue:stream:pos() -> %ld\n", stream->pos )); @@ -110,7 +110,7 @@ _hb_ftglue_stream_pos( FT_Stream stream ) HB_INTERNAL HB_Error _hb_ftglue_stream_seek( FT_Stream stream, - FT_Long pos ) + HB_Int pos ) { HB_Error error = 0; @@ -120,7 +120,7 @@ _hb_ftglue_stream_seek( FT_Stream stream, if ( stream->read( stream, pos, NULL, 0 ) ) error = HB_Err_Invalid_Stream_Operation; } - else if ( pos > (FT_Long)stream->size ) + else if ( pos > (HB_Int)stream->size ) error = HB_Err_Invalid_Stream_Operation; LOG(( "ftglue:stream:seek(%ld) -> %d\n", pos, error )); @@ -130,10 +130,10 @@ _hb_ftglue_stream_seek( FT_Stream stream, HB_INTERNAL HB_Error _hb_ftglue_stream_frame_enter( FT_Stream stream, - FT_ULong count ) + HB_UInt count ) { HB_Error error = HB_Err_Ok; - FT_ULong read_bytes; + HB_UInt read_bytes; if ( stream->read ) { @@ -192,7 +192,7 @@ _hb_ftglue_stream_frame_exit( FT_Stream stream ) HB_INTERNAL HB_Error _hb_ftglue_face_goto_table( FT_Face face, - FT_ULong the_tag, + HB_UInt the_tag, FT_Stream stream ) { HB_Error error; @@ -215,8 +215,8 @@ _hb_ftglue_face_goto_table( FT_Face face, /* parse the directory table directly, without using * FreeType's built-in data structures */ - FT_ULong offset = 0; - FT_UInt count, nn; + HB_UInt offset = 0; + HB_UInt count, nn; if ( face->num_faces > 1 ) { @@ -248,10 +248,10 @@ _hb_ftglue_face_goto_table( FT_Face face, for ( nn = 0; nn < count; nn++ ) { - FT_ULong tag = GET_ULong(); - FT_ULong checksum = GET_ULong(); - FT_ULong start = GET_ULong(); - FT_ULong size = GET_ULong(); + HB_UInt tag = GET_ULong(); + HB_UInt checksum = GET_ULong(); + HB_UInt start = GET_ULong(); + HB_UInt size = GET_ULong(); FT_UNUSED(checksum); FT_UNUSED(size); diff --git a/src/ftglue.h b/src/ftglue.h index a866feea..16873d15 100644 --- a/src/ftglue.h +++ b/src/ftglue.h @@ -46,10 +46,10 @@ #include #include FT_FREETYPE_H -#include "harfbuzz-impl.h" #include "harfbuzz-open.h" +#include "harfbuzz-impl.h" -FT_BEGIN_HEADER +HB_BEGIN_HEADER /* utility macros */ @@ -67,11 +67,11 @@ FT_BEGIN_HEADER #define FORGET_Frame() _hb_ftglue_stream_frame_exit( stream ) #define GET_Byte() (*stream->cursor++) -#define GET_Short() (stream->cursor += 2, (FT_Short)( \ +#define GET_Short() (stream->cursor += 2, (HB_Short)( \ (*(((FT_Byte*)stream->cursor)-2) << 8) | \ *(((FT_Byte*)stream->cursor)-1) \ )) -#define GET_Long() (stream->cursor += 4, (FT_Long)( \ +#define GET_Long() (stream->cursor += 4, (HB_Int)( \ (*(((FT_Byte*)stream->cursor)-4) << 24) | \ (*(((FT_Byte*)stream->cursor)-3) << 16) | \ (*(((FT_Byte*)stream->cursor)-2) << 8) | \ @@ -80,27 +80,27 @@ FT_BEGIN_HEADER #define GET_Char() ((FT_Char)GET_Byte()) -#define GET_UShort() ((FT_UShort)GET_Short()) -#define GET_ULong() ((FT_ULong)GET_Long()) +#define GET_UShort() ((HB_UShort)GET_Short()) +#define GET_ULong() ((HB_UInt)GET_Long()) #define GET_Tag4() GET_ULong() -HB_INTERNAL FT_Long +HB_INTERNAL HB_Int _hb_ftglue_stream_pos( FT_Stream stream ); HB_INTERNAL HB_Error _hb_ftglue_stream_seek( FT_Stream stream, - FT_Long pos ); + HB_Int pos ); HB_INTERNAL HB_Error _hb_ftglue_stream_frame_enter( FT_Stream stream, - FT_ULong size ); + HB_UInt size ); HB_INTERNAL void _hb_ftglue_stream_frame_exit( FT_Stream stream ); HB_INTERNAL HB_Error _hb_ftglue_face_goto_table( FT_Face face, - FT_ULong tag, + HB_UInt tag, FT_Stream stream ); /* memory macros used by the OpenType parser */ @@ -129,12 +129,12 @@ _hb_ftglue_face_goto_table( FT_Face face, HB_INTERNAL FT_Pointer -_hb_ftglue_alloc( FT_ULong size, +_hb_ftglue_alloc( HB_UInt size, HB_Error *perror_ ); HB_INTERNAL FT_Pointer _hb_ftglue_realloc( FT_Pointer block, - FT_ULong new_size, + HB_UInt new_size, HB_Error *perror_ ); HB_INTERNAL void @@ -146,6 +146,6 @@ _hb_ftglue_free( FT_Pointer block ); HB_INTERNAL HB_Error _hb_err (HB_Error code); -FT_END_HEADER +HB_END_HEADER #endif /* FTGLUE_H */ diff --git a/src/harfbuzz-buffer-private.h b/src/harfbuzz-buffer-private.h index 0b87c18a..877bbe76 100644 --- a/src/harfbuzz-buffer-private.h +++ b/src/harfbuzz-buffer-private.h @@ -17,7 +17,7 @@ #include "harfbuzz-impl.h" #include "harfbuzz-buffer.h" -FT_BEGIN_HEADER +HB_BEGIN_HEADER #define HB_GLYPH_PROPERTIES_UNKNOWN 0xFFFF @@ -32,29 +32,29 @@ _hb_buffer_clear_positions( HB_Buffer buffer ); HB_INTERNAL HB_Error _hb_buffer_add_output_glyphs( HB_Buffer buffer, - FT_UShort num_in, - FT_UShort num_out, - FT_UShort *glyph_data, - FT_UShort component, - FT_UShort ligID ); + HB_UShort num_in, + HB_UShort num_out, + HB_UShort *glyph_data, + HB_UShort component, + HB_UShort ligID ); HB_INTERNAL HB_Error _hb_buffer_add_output_glyph ( HB_Buffer buffer, - FT_UInt glyph_index, - FT_UShort component, - FT_UShort ligID ); + HB_UInt glyph_index, + HB_UShort component, + HB_UShort ligID ); HB_INTERNAL HB_Error _hb_buffer_copy_output_glyph ( HB_Buffer buffer ); HB_INTERNAL HB_Error _hb_buffer_replace_output_glyph ( HB_Buffer buffer, - FT_UInt glyph_index, - FT_Bool inplace ); + HB_UInt glyph_index, + HB_Bool inplace ); -HB_INTERNAL FT_UShort +HB_INTERNAL HB_UShort _hb_buffer_allocate_ligid( HB_Buffer buffer ); -FT_END_HEADER +HB_END_HEADER #endif /* HARFBUZZ_BUFFER_PRIVATE_H */ diff --git a/src/harfbuzz-buffer.c b/src/harfbuzz-buffer.c index 4b25a5f1..9c0072a5 100644 --- a/src/harfbuzz-buffer.c +++ b/src/harfbuzz-buffer.c @@ -42,9 +42,9 @@ static HB_Error hb_buffer_ensure( HB_Buffer buffer, - FT_ULong size ) + HB_UInt size ) { - FT_ULong new_allocated = buffer->allocated; + HB_UInt new_allocated = buffer->allocated; if (size > new_allocated) { @@ -151,9 +151,9 @@ hb_buffer_clear( HB_Buffer buffer ) HB_Error hb_buffer_add_glyph( HB_Buffer buffer, - FT_UInt glyph_index, - FT_UInt properties, - FT_UInt cluster ) + HB_UInt glyph_index, + HB_UInt properties, + HB_UInt cluster ) { HB_Error error; HB_GlyphItem glyph; @@ -247,16 +247,16 @@ _hb_buffer_swap( HB_Buffer buffer ) for all replacement glyphs */ HB_INTERNAL HB_Error _hb_buffer_add_output_glyphs( HB_Buffer buffer, - FT_UShort num_in, - FT_UShort num_out, - FT_UShort *glyph_data, - FT_UShort component, - FT_UShort ligID ) + HB_UShort num_in, + HB_UShort num_out, + HB_UShort *glyph_data, + HB_UShort component, + HB_UShort ligID ) { HB_Error error; - FT_UShort i; - FT_UInt properties; - FT_UInt cluster; + HB_UShort i; + HB_UInt properties; + HB_UInt cluster; error = hb_buffer_ensure( buffer, buffer->out_pos + num_out ); if ( error ) @@ -298,11 +298,11 @@ _hb_buffer_add_output_glyphs( HB_Buffer buffer, HB_INTERNAL HB_Error _hb_buffer_add_output_glyph( HB_Buffer buffer, - FT_UInt glyph_index, - FT_UShort component, - FT_UShort ligID ) + HB_UInt glyph_index, + HB_UShort component, + HB_UShort ligID ) { - FT_UShort glyph_data = glyph_index; + HB_UShort glyph_data = glyph_index; return _hb_buffer_add_output_glyphs ( buffer, 1, 1, &glyph_data, component, ligID ); @@ -331,8 +331,8 @@ _hb_buffer_copy_output_glyph ( HB_Buffer buffer ) HB_INTERNAL HB_Error _hb_buffer_replace_output_glyph( HB_Buffer buffer, - FT_UInt glyph_index, - FT_Bool inplace ) + HB_UInt glyph_index, + HB_Bool inplace ) { HB_Error error; @@ -353,7 +353,7 @@ _hb_buffer_replace_output_glyph( HB_Buffer buffer, return HB_Err_Ok; } -HB_INTERNAL FT_UShort +HB_INTERNAL HB_UShort _hb_buffer_allocate_ligid( HB_Buffer buffer ) { buffer->max_ligID++; diff --git a/src/harfbuzz-buffer.h b/src/harfbuzz-buffer.h index fdc70757..701d083e 100644 --- a/src/harfbuzz-buffer.h +++ b/src/harfbuzz-buffer.h @@ -17,15 +17,15 @@ #include #include FT_FREETYPE_H -FT_BEGIN_HEADER +HB_BEGIN_HEADER typedef struct HB_GlyphItemRec_ { - FT_UInt gindex; - FT_UInt properties; - FT_UInt cluster; - FT_UShort component; - FT_UShort ligID; - FT_UShort gproperties; + HB_UInt gindex; + HB_UInt properties; + HB_UInt cluster; + HB_UShort component; + HB_UShort ligID; + HB_UShort gproperties; } HB_GlyphItemRec, *HB_GlyphItem; typedef struct HB_PositionRec_ { @@ -33,32 +33,32 @@ typedef struct HB_PositionRec_ { FT_Pos y_pos; FT_Pos x_advance; FT_Pos y_advance; - FT_UShort back; /* number of glyphs to go back + HB_UShort back; /* number of glyphs to go back for drawing current glyph */ - FT_Bool new_advance; /* if set, the advance width values are + HB_Bool new_advance; /* if set, the advance width values are absolute, i.e., they won't be added to the original glyph's value but rather replace them. */ - FT_Short cursive_chain; /* character to which this connects, + HB_Short cursive_chain; /* character to which this connects, may be positive or negative; used only internally */ } HB_PositionRec, *HB_Position; typedef struct HB_BufferRec_{ - FT_ULong allocated; + HB_UInt allocated; - FT_ULong in_length; - FT_ULong out_length; - FT_ULong in_pos; - FT_ULong out_pos; + HB_UInt in_length; + HB_UInt out_length; + HB_UInt in_pos; + HB_UInt out_pos; - FT_Bool separate_out; + HB_Bool separate_out; HB_GlyphItem in_string; HB_GlyphItem out_string; HB_GlyphItem alt_string; HB_Position positions; - FT_UShort max_ligID; + HB_UShort max_ligID; } HB_BufferRec, *HB_Buffer; HB_Error @@ -72,10 +72,10 @@ hb_buffer_clear( HB_Buffer buffer ); HB_Error hb_buffer_add_glyph( HB_Buffer buffer, - FT_UInt glyph_index, - FT_UInt properties, - FT_UInt cluster ); + HB_UInt glyph_index, + HB_UInt properties, + HB_UInt cluster ); -FT_END_HEADER +HB_END_HEADER #endif /* HARFBUZZ_BUFFER_H */ diff --git a/src/harfbuzz-dump-main.c b/src/harfbuzz-dump-main.c index 4a95f2e5..16432255 100644 --- a/src/harfbuzz-dump-main.c +++ b/src/harfbuzz-dump-main.c @@ -44,7 +44,7 @@ enum { }; static void -print_tag (FT_ULong tag) +print_tag (HB_UInt tag) { fprintf (stderr, "%c%c%c%c", (unsigned char)(tag >> 24), @@ -55,12 +55,12 @@ print_tag (FT_ULong tag) static void maybe_add_feature (HB_GSUB gsub, - FT_UShort script_index, - FT_ULong tag, - FT_UShort property) + HB_UShort script_index, + HB_UInt tag, + HB_UShort property) { HB_Error error; - FT_UShort feature_index; + HB_UShort feature_index; /* 0xffff == default language system */ error = HB_GSUB_Select_Feature (gsub, tag, script_index, 0xffff, &feature_index); @@ -84,7 +84,7 @@ maybe_add_feature (HB_GSUB gsub, static void select_cmap (FT_Face face) { - FT_UShort i; + HB_UShort i; FT_CharMap cmap = NULL; for (i = 0; i < face->num_charmaps; i++) @@ -123,8 +123,8 @@ static void add_features (HB_GSUB gsub) { HB_Error error; - FT_ULong tag = FT_MAKE_TAG ('a', 'r', 'a', 'b'); - FT_UShort script_index; + HB_UInt tag = FT_MAKE_TAG ('a', 'r', 'a', 'b'); + HB_UShort script_index; error = HB_GSUB_Select_Script (gsub, tag, &script_index); @@ -150,7 +150,7 @@ add_features (HB_GSUB gsub) void dump_string (HB_GSUB_String *str) { - FT_ULong i; + HB_UInt i; fprintf (stderr, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); for (i = 0; i < str->length; i++) @@ -165,8 +165,8 @@ dump_string (HB_GSUB_String *str) fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); } -FT_UShort arabic_str[] = { 0x645, 0x643, 0x64a, 0x644, 0x639, 0x20, 0x645, 0x627, 0x644, 0x633, 0x644, 0x627 }; -FT_UShort arabic_props[] = { I|L, M|L, M|L, M|L, M|L, F|L, I|L, M|L, M|L, M|L, M|L, F|L }; +HB_UShort arabic_str[] = { 0x645, 0x643, 0x64a, 0x644, 0x639, 0x20, 0x645, 0x627, 0x644, 0x633, 0x644, 0x627 }; +HB_UShort arabic_props[] = { I|L, M|L, M|L, M|L, M|L, F|L, I|L, M|L, M|L, M|L, M|L, F|L }; void try_string (FT_Library library, @@ -176,7 +176,7 @@ try_string (FT_Library library, HB_Error error; HB_GSUB_String *in_str; HB_GSUB_String *out_str; - FT_ULong i; + HB_UInt i; if ((error = HB_GSUB_String_New (face->memory, &in_str))) croak ("HB_GSUB_String_New", error); diff --git a/src/harfbuzz-dump.c b/src/harfbuzz-dump.c index 53feba12..d1d4eb96 100644 --- a/src/harfbuzz-dump.c +++ b/src/harfbuzz-dump.c @@ -61,7 +61,7 @@ dump (FILE *stream, int indent, const char *format, ...) } static void -Dump_UShort_Array (FT_UShort *array, int count, const char *name, FILE *stream, int indent) +Dump_UShort_Array (HB_UShort *array, int count, const char *name, FILE *stream, int indent) { int i; @@ -74,7 +74,7 @@ Dump_UShort_Array (FT_UShort *array, int count, const char *name, FILE *stream, } static void -Print_Tag (FT_ULong tag, FILE *stream) +Print_Tag (HB_UInt tag, FILE *stream) { fprintf (stream, "%c%c%c%c", (unsigned char)(tag >> 24), @@ -491,8 +491,8 @@ Dump_Device (HB_Device *Device, FILE *stream, int indent, HB_Type hb_type) for (i = Device->StartSize; i <= Device->EndSize ; i++) { - FT_UShort val = Device->DeltaValue[i / n_per]; - FT_Short signed_val = ((val << ((i % n_per) * bits)) & mask); + HB_UShort val = Device->DeltaValue[i / n_per]; + HB_Short signed_val = ((val << ((i % n_per) * bits)) & mask); dump (stream, indent, "%d", signed_val >> (16 - bits)); if (i != Device->EndSize) DUMP (", "); @@ -502,7 +502,7 @@ Dump_Device (HB_Device *Device, FILE *stream, int indent, HB_Type hb_type) } static void -Dump_ValueRecord (HB_ValueRecord *ValueRecord, FILE *stream, int indent, HB_Type hb_type, FT_UShort value_format) +Dump_ValueRecord (HB_ValueRecord *ValueRecord, FILE *stream, int indent, HB_Type hb_type, HB_UShort value_format) { if (value_format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT) DUMP_FINT (ValueRecord, XPlacement); @@ -555,7 +555,7 @@ Dump_GPOS_Lookup_Single (HB_SubTable *subtable, FILE *stream, int indent, HB_Typ } static void -Dump_PairValueRecord (HB_PairValueRecord *PairValueRecord, FILE *stream, int indent, HB_Type hb_type, FT_UShort ValueFormat1, FT_UShort ValueFormat2) +Dump_PairValueRecord (HB_PairValueRecord *PairValueRecord, FILE *stream, int indent, HB_Type hb_type, HB_UShort ValueFormat1, HB_UShort ValueFormat2) { DUMP_FUINT (PairValueRecord, SecondGlyph); DUMP_VALUE_RECORD (&PairValueRecord->Value1, ValueFormat1); @@ -563,7 +563,7 @@ Dump_PairValueRecord (HB_PairValueRecord *PairValueRecord, FILE *stream, int ind } static void -Dump_PairSet (HB_PairSet *PairSet, FILE *stream, int indent, HB_Type hb_type, FT_UShort ValueFormat1, FT_UShort ValueFormat2) +Dump_PairSet (HB_PairSet *PairSet, FILE *stream, int indent, HB_Type hb_type, HB_UShort ValueFormat1, HB_UShort ValueFormat2) { int i; DUMP_FUINT (PairSet, PairValueCount); diff --git a/src/harfbuzz-dump.h b/src/harfbuzz-dump.h index c41ca683..ac22cc54 100644 --- a/src/harfbuzz-dump.h +++ b/src/harfbuzz-dump.h @@ -24,11 +24,11 @@ #include "harfbuzz-gsub.h" #include "harfbuzz-gpos.h" -FT_BEGIN_HEADER +HB_BEGIN_HEADER void HB_Dump_GSUB_Table (HB_GSUB gsub, FILE *stream); void HB_Dump_GPOS_Table (HB_GPOS gpos, FILE *stream); -FT_END_HEADER +HB_END_HEADER #endif /* HARFBUZZ_DUMP_H */ diff --git a/src/harfbuzz-gdef-private.h b/src/harfbuzz-gdef-private.h index 0d1b9049..dbc77e60 100644 --- a/src/harfbuzz-gdef-private.h +++ b/src/harfbuzz-gdef-private.h @@ -17,22 +17,22 @@ #include "harfbuzz-gdef.h" #include "harfbuzz-buffer.h" -FT_BEGIN_HEADER +HB_BEGIN_HEADER /* Attachment related structures */ struct HB_AttachPoint_ { - FT_UShort PointCount; /* size of the PointIndex array */ - FT_UShort* PointIndex; /* array of contour points */ + HB_UShort PointCount; /* size of the PointIndex array */ + HB_UShort* PointIndex; /* array of contour points */ }; /* Ligature Caret related structures */ struct HB_CaretValueFormat1_ { - FT_Short Coordinate; /* x or y value (in design units) */ + HB_Short Coordinate; /* x or y value (in design units) */ }; typedef struct HB_CaretValueFormat1_ HB_CaretValueFormat1; @@ -40,7 +40,7 @@ typedef struct HB_CaretValueFormat1_ HB_CaretValueFormat1; struct HB_CaretValueFormat2_ { - FT_UShort CaretValuePoint; /* contour point index on glyph */ + HB_UShort CaretValuePoint; /* contour point index on glyph */ }; typedef struct HB_CaretValueFormat2_ HB_CaretValueFormat2; @@ -48,7 +48,7 @@ typedef struct HB_CaretValueFormat2_ HB_CaretValueFormat2; struct HB_CaretValueFormat3_ { - FT_Short Coordinate; /* x or y value (in design units) */ + HB_Short Coordinate; /* x or y value (in design units) */ HB_Device Device; /* Device table for x or y value */ }; @@ -57,7 +57,7 @@ typedef struct HB_CaretValueFormat3_ HB_CaretValueFormat3; struct HB_CaretValueFormat4_ { - FT_UShort IdCaretValue; /* metric ID */ + HB_UShort IdCaretValue; /* metric ID */ }; typedef struct HB_CaretValueFormat4_ HB_CaretValueFormat4; @@ -65,7 +65,7 @@ typedef struct HB_CaretValueFormat4_ HB_CaretValueFormat4; struct HB_CaretValue_ { - FT_UShort CaretValueFormat; /* 1, 2, 3, or 4 */ + HB_UShort CaretValueFormat; /* 1, 2, 3, or 4 */ union { @@ -81,24 +81,24 @@ typedef struct HB_CaretValue_ HB_CaretValue; struct HB_LigGlyph_ { - FT_Bool loaded; + HB_Bool loaded; - FT_UShort CaretCount; /* number of caret values */ + HB_UShort CaretCount; /* number of caret values */ HB_CaretValue* CaretValue; /* array of caret values */ }; HB_INTERNAL HB_Error _HB_GDEF_Add_Glyph_Property( HB_GDEFHeader* gdef, - FT_UShort glyphID, - FT_UShort property ); + HB_UShort glyphID, + HB_UShort property ); HB_INTERNAL HB_Error _HB_GDEF_Check_Property( HB_GDEFHeader* gdef, HB_GlyphItem item, - FT_UShort flags, - FT_UShort* property ); + HB_UShort flags, + HB_UShort* property ); -FT_END_HEADER +HB_END_HEADER #endif /* HARFBUZZ_GDEF_PRIVATE_H */ diff --git a/src/harfbuzz-gdef.c b/src/harfbuzz-gdef.c index 1f86e9bf..d6fdc26d 100644 --- a/src/harfbuzz-gdef.c +++ b/src/harfbuzz-gdef.c @@ -158,7 +158,7 @@ HB_Error HB_Load_GDEF_Table( FT_Face face, { HB_Error error; FT_Stream stream = face->stream; - FT_ULong cur_offset, new_offset, base_offset; + HB_UInt cur_offset, new_offset, base_offset; HB_GDEFHeader* gdef; @@ -303,8 +303,8 @@ static HB_Error Load_AttachPoint( HB_AttachPoint* ap, { HB_Error error; - FT_UShort n, count; - FT_UShort* pi; + HB_UShort n, count; + HB_UShort* pi; if ( ACCESS_Frame( 2L ) ) @@ -318,7 +318,7 @@ static HB_Error Load_AttachPoint( HB_AttachPoint* ap, if ( count ) { - if ( ALLOC_ARRAY( ap->PointIndex, count, FT_UShort ) ) + if ( ALLOC_ARRAY( ap->PointIndex, count, HB_UShort ) ) return error; pi = ap->PointIndex; @@ -352,8 +352,8 @@ static HB_Error Load_AttachList( HB_AttachList* al, { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_AttachPoint* ap; @@ -421,7 +421,7 @@ Fail2: static void Free_AttachList( HB_AttachList* al ) { - FT_UShort n, count; + HB_UShort n, count; HB_AttachPoint* ap; @@ -460,7 +460,7 @@ static HB_Error Load_CaretValue( HB_CaretValue* cv, { HB_Error error; - FT_ULong cur_offset, new_offset, base_offset; + HB_UInt cur_offset, new_offset, base_offset; base_offset = FILE_Pos(); @@ -544,8 +544,8 @@ static HB_Error Load_LigGlyph( HB_LigGlyph* lg, { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_CaretValue* cv; @@ -595,7 +595,7 @@ Fail: static void Free_LigGlyph( HB_LigGlyph* lg ) { - FT_UShort n, count; + HB_UShort n, count; HB_CaretValue* cv; @@ -620,8 +620,8 @@ static HB_Error Load_LigCaretList( HB_LigCaretList* lcl, { HB_Error error; - FT_UShort m, n, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort m, n, count; + HB_UInt cur_offset, new_offset, base_offset; HB_LigGlyph* lg; @@ -689,7 +689,7 @@ Fail2: static void Free_LigCaretList( HB_LigCaretList* lcl ) { - FT_UShort n, count; + HB_UShort n, count; HB_LigGlyph* lg; @@ -718,15 +718,15 @@ static void Free_LigCaretList( HB_LigCaretList* lcl ) ***********/ -static FT_UShort Get_New_Class( HB_GDEFHeader* gdef, - FT_UShort glyphID, - FT_UShort index ) +static HB_UShort Get_New_Class( HB_GDEFHeader* gdef, + HB_UShort glyphID, + HB_UShort index ) { - FT_UShort glyph_index, array_index, count; - FT_UShort byte, bits; + HB_UShort glyph_index, array_index, count; + HB_UShort byte, bits; HB_ClassRangeRecord* gcrr; - FT_UShort** ngc; + HB_UShort** ngc; if ( glyphID >= gdef->LastGlyph ) @@ -759,10 +759,10 @@ static FT_UShort Get_New_Class( HB_GDEFHeader* gdef, HB_Error HB_GDEF_Get_Glyph_Property( HB_GDEFHeader* gdef, - FT_UShort glyphID, - FT_UShort* property ) + HB_UShort glyphID, + HB_UShort* property ) { - FT_UShort class = 0, index = 0; /* shut compiler up */ + HB_UShort class = 0, index = 0; /* shut compiler up */ HB_Error error; @@ -823,12 +823,12 @@ HB_Error HB_GDEF_Get_Glyph_Property( HB_GDEFHeader* gdef, static HB_Error Make_ClassRange( HB_ClassDefinition* cd, - FT_UShort start, - FT_UShort end, - FT_UShort class ) + HB_UShort start, + HB_UShort end, + HB_UShort class ) { HB_Error error; - FT_UShort index; + HB_UShort index; HB_ClassDefFormat2* cdf2; HB_ClassRangeRecord* crr; @@ -858,18 +858,18 @@ static HB_Error Make_ClassRange( HB_ClassDefinition* cd, HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef, - FT_UShort num_glyphs, - FT_UShort glyph_count, - FT_UShort* glyph_array, - FT_UShort* class_array ) + HB_UShort num_glyphs, + HB_UShort glyph_count, + HB_UShort* glyph_array, + HB_UShort* class_array ) { - FT_UShort start, curr_glyph, curr_class; - FT_UShort n, m, count; + HB_UShort start, curr_glyph, curr_class; + HB_UShort n, m, count; HB_Error error; HB_ClassDefinition* gcd; HB_ClassRangeRecord* gcrr; - FT_UShort** ngc; + HB_UShort** ngc; if ( !gdef || !glyph_array || !class_array ) @@ -883,7 +883,7 @@ HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef, /* A GlyphClassDef table contains at most 5 different class values */ - if ( ALLOC_ARRAY( gcd->Defined, 5, FT_Bool ) ) + if ( ALLOC_ARRAY( gcd->Defined, 5, HB_Bool ) ) return error; gcd->cd.cd2.ClassRangeCount = 0; @@ -970,7 +970,7 @@ HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef, process */ if ( ALLOC_ARRAY( gdef->NewGlyphClasses, - gcd->cd.cd2.ClassRangeCount + 1, FT_UShort* ) ) + gcd->cd.cd2.ClassRangeCount + 1, HB_UShort* ) ) goto Fail3; count = gcd->cd.cd2.ClassRangeCount; @@ -984,7 +984,7 @@ HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef, { if ( gcrr[0].Start ) { - if ( ALLOC_ARRAY( ngc[0], ( gcrr[0].Start + 3 ) / 4, FT_UShort ) ) + if ( ALLOC_ARRAY( ngc[0], ( gcrr[0].Start + 3 ) / 4, HB_UShort ) ) goto Fail2; } @@ -993,7 +993,7 @@ HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef, if ( gcrr[n].Start - gcrr[n - 1].End > 1 ) if ( ALLOC_ARRAY( ngc[n], ( gcrr[n].Start - gcrr[n - 1].End + 2 ) / 4, - FT_UShort ) ) + HB_UShort ) ) goto Fail1; } @@ -1001,7 +1001,7 @@ HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef, { if ( ALLOC_ARRAY( ngc[count], ( num_glyphs - gcrr[count - 1].End + 2 ) / 4, - FT_UShort ) ) + HB_UShort ) ) goto Fail1; } } @@ -1009,7 +1009,7 @@ HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef, { if ( ALLOC_ARRAY( ngc[count], ( num_glyphs + 3 ) / 4, - FT_UShort ) ) + HB_UShort ) ) goto Fail2; } @@ -1040,8 +1040,8 @@ Fail4: static void Free_NewGlyphClasses( HB_GDEFHeader* gdef ) { - FT_UShort** ngc; - FT_UShort n, count; + HB_UShort** ngc; + HB_UShort n, count; if ( gdef->NewGlyphClasses ) @@ -1059,16 +1059,16 @@ static void Free_NewGlyphClasses( HB_GDEFHeader* gdef ) HB_INTERNAL HB_Error _HB_GDEF_Add_Glyph_Property( HB_GDEFHeader* gdef, - FT_UShort glyphID, - FT_UShort property ) + HB_UShort glyphID, + HB_UShort property ) { HB_Error error; - FT_UShort class, new_class, index = 0; /* shut compiler up */ - FT_UShort byte, bits, mask; - FT_UShort array_index, glyph_index, count; + HB_UShort class, new_class, index = 0; /* shut compiler up */ + HB_UShort byte, bits, mask; + HB_UShort array_index, glyph_index, count; HB_ClassRangeRecord* gcrr; - FT_UShort** ngc; + HB_UShort** ngc; error = _HB_OPEN_Get_Class( &gdef->GlyphClassDef, glyphID, &class, &index ); @@ -1146,15 +1146,15 @@ _HB_GDEF_Add_Glyph_Property( HB_GDEFHeader* gdef, HB_INTERNAL HB_Error _HB_GDEF_Check_Property( HB_GDEFHeader* gdef, HB_GlyphItem gitem, - FT_UShort flags, - FT_UShort* property ) + HB_UShort flags, + HB_UShort* property ) { HB_Error error; if ( gdef ) { - FT_UShort basic_glyph_class; - FT_UShort desired_attachment_class; + HB_UShort basic_glyph_class; + HB_UShort desired_attachment_class; if ( gitem->gproperties == HB_GLYPH_PROPERTIES_UNKNOWN ) { diff --git a/src/harfbuzz-gdef.h b/src/harfbuzz-gdef.h index b752af6f..08ff3627 100644 --- a/src/harfbuzz-gdef.h +++ b/src/harfbuzz-gdef.h @@ -15,7 +15,7 @@ #include "harfbuzz-open.h" -FT_BEGIN_HEADER +HB_BEGIN_HEADER #define HB_Err_Invalid_GDEF_SubTable_Format 0x1030 #define HB_Err_Invalid_GDEF_SubTable 0x1031 @@ -34,10 +34,10 @@ typedef struct HB_AttachPoint_ HB_AttachPoint; struct HB_AttachList_ { - FT_Bool loaded; + HB_Bool loaded; HB_Coverage Coverage; /* Coverage table */ - FT_UShort GlyphCount; /* number of glyphs with + HB_UShort GlyphCount; /* number of glyphs with attachments */ HB_AttachPoint* AttachPoint; /* array of AttachPoint tables */ }; @@ -48,10 +48,10 @@ typedef struct HB_LigGlyph_ HB_LigGlyph; struct HB_LigCaretList_ { - FT_Bool loaded; + HB_Bool loaded; HB_Coverage Coverage; /* Coverage table */ - FT_UShort LigGlyphCount; /* number of ligature glyphs */ + HB_UShort LigGlyphCount; /* number of ligature glyphs */ HB_LigGlyph* LigGlyph; /* array of LigGlyph tables */ }; @@ -81,18 +81,18 @@ typedef struct HB_LigCaretList_ HB_LigCaretList; struct HB_GDEFHeader_ { - FT_ULong offset; + HB_UInt offset; FT_Fixed Version; HB_ClassDefinition GlyphClassDef; HB_AttachList AttachList; HB_LigCaretList LigCaretList; - FT_ULong MarkAttachClassDef_offset; + HB_UInt MarkAttachClassDef_offset; HB_ClassDefinition MarkAttachClassDef; /* new in OT 1.2 */ - FT_UShort LastGlyph; - FT_UShort** NewGlyphClasses; + HB_UShort LastGlyph; + HB_UShort** NewGlyphClasses; }; typedef struct HB_GDEFHeader_ HB_GDEFHeader; @@ -110,16 +110,16 @@ HB_Error HB_Done_GDEF_Table ( HB_GDEFHeader* gdef ); HB_Error HB_GDEF_Get_Glyph_Property( HB_GDEFHeader* gdef, - FT_UShort glyphID, - FT_UShort* property ); + HB_UShort glyphID, + HB_UShort* property ); HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef, - FT_UShort num_glyphs, - FT_UShort glyph_count, - FT_UShort* glyph_array, - FT_UShort* class_array ); + HB_UShort num_glyphs, + HB_UShort glyph_count, + HB_UShort* glyph_array, + HB_UShort* class_array ); -FT_END_HEADER +HB_END_HEADER #endif /* HARFBUZZ_GDEF_H */ diff --git a/src/harfbuzz-global.h b/src/harfbuzz-global.h new file mode 100644 index 00000000..d6e9047b --- /dev/null +++ b/src/harfbuzz-global.h @@ -0,0 +1,34 @@ +/******************************************************************* + * + * Copyright 1996-2000 by + * David Turner, Robert Wilhelm, and Werner Lemberg. + * Copyright 2007 Trolltech ASA + * Copyright 2007 Behdad Esfahbod + * + * This is part of HarfBuzz, an OpenType Layout engine library. + * + * See the file name COPYING for licensing information. + * + ******************************************************************/ +#ifndef HARFBUZZ_GLOBAL_H +#define HARFBUZZ_GLOBAL_H + +#ifdef __cplusplus +#define HB_BEGIN_HEADER extern "C" { +#define HB_END_HEADER } +#else +#define HB_BEGIN_HEADER /* nothing */ +#define HB_END_HEADER /* nothing */ +#endif + +HB_BEGIN_HEADER + +typedef unsigned short HB_UShort; +typedef signed short HB_Short; +typedef unsigned int HB_UInt; +typedef signed int HB_Int; +typedef int HB_Bool; + +HB_END_HEADER + +#endif diff --git a/src/harfbuzz-gpos-private.h b/src/harfbuzz-gpos-private.h index 1bd6ec4f..7a45d620 100644 --- a/src/harfbuzz-gpos-private.h +++ b/src/harfbuzz-gpos-private.h @@ -16,20 +16,20 @@ #include "harfbuzz-impl.h" #include "harfbuzz-gpos.h" -FT_BEGIN_HEADER +HB_BEGIN_HEADER /* shared tables */ struct HB_ValueRecord_ { - FT_Short XPlacement; /* horizontal adjustment for + HB_Short XPlacement; /* horizontal adjustment for placement */ - FT_Short YPlacement; /* vertical adjustment for + HB_Short YPlacement; /* vertical adjustment for placement */ - FT_Short XAdvance; /* horizontal adjustment for + HB_Short XAdvance; /* horizontal adjustment for advance */ - FT_Short YAdvance; /* vertical adjustment for + HB_Short YAdvance; /* vertical adjustment for advance */ HB_Device XPlacementDevice; /* device table for horizontal placement */ @@ -39,10 +39,10 @@ struct HB_ValueRecord_ advance */ HB_Device YAdvanceDevice; /* device table for vertical advance */ - FT_UShort XIdPlacement; /* horizontal placement metric ID */ - FT_UShort YIdPlacement; /* vertical placement metric ID */ - FT_UShort XIdAdvance; /* horizontal advance metric ID */ - FT_UShort YIdAdvance; /* vertical advance metric ID */ + HB_UShort XIdPlacement; /* horizontal placement metric ID */ + HB_UShort YIdPlacement; /* vertical placement metric ID */ + HB_UShort XIdAdvance; /* horizontal advance metric ID */ + HB_UShort YIdAdvance; /* vertical advance metric ID */ }; typedef struct HB_ValueRecord_ HB_ValueRecord; @@ -67,8 +67,8 @@ typedef struct HB_ValueRecord_ HB_ValueRecord; struct HB_AnchorFormat1_ { - FT_Short XCoordinate; /* horizontal value */ - FT_Short YCoordinate; /* vertical value */ + HB_Short XCoordinate; /* horizontal value */ + HB_Short YCoordinate; /* vertical value */ }; typedef struct HB_AnchorFormat1_ HB_AnchorFormat1; @@ -76,9 +76,9 @@ typedef struct HB_AnchorFormat1_ HB_AnchorFormat1; struct HB_AnchorFormat2_ { - FT_Short XCoordinate; /* horizontal value */ - FT_Short YCoordinate; /* vertical value */ - FT_UShort AnchorPoint; /* index to glyph contour point */ + HB_Short XCoordinate; /* horizontal value */ + HB_Short YCoordinate; /* vertical value */ + HB_UShort AnchorPoint; /* index to glyph contour point */ }; typedef struct HB_AnchorFormat2_ HB_AnchorFormat2; @@ -86,8 +86,8 @@ typedef struct HB_AnchorFormat2_ HB_AnchorFormat2; struct HB_AnchorFormat3_ { - FT_Short XCoordinate; /* horizontal value */ - FT_Short YCoordinate; /* vertical value */ + HB_Short XCoordinate; /* horizontal value */ + HB_Short YCoordinate; /* vertical value */ HB_Device XDeviceTable; /* device table for X coordinate */ HB_Device YDeviceTable; /* device table for Y coordinate */ }; @@ -97,8 +97,8 @@ typedef struct HB_AnchorFormat3_ HB_AnchorFormat3; struct HB_AnchorFormat4_ { - FT_UShort XIdAnchor; /* horizontal metric ID */ - FT_UShort YIdAnchor; /* vertical metric ID */ + HB_UShort XIdAnchor; /* horizontal metric ID */ + HB_UShort YIdAnchor; /* vertical metric ID */ }; typedef struct HB_AnchorFormat4_ HB_AnchorFormat4; @@ -106,7 +106,7 @@ typedef struct HB_AnchorFormat4_ HB_AnchorFormat4; struct HB_Anchor_ { - FT_UShort PosFormat; /* 1, 2, 3, or 4 -- 0 indicates + HB_UShort PosFormat; /* 1, 2, 3, or 4 -- 0 indicates that there is no Anchor table */ union @@ -123,7 +123,7 @@ typedef struct HB_Anchor_ HB_Anchor; struct HB_MarkRecord_ { - FT_UShort Class; /* mark class */ + HB_UShort Class; /* mark class */ HB_Anchor MarkAnchor; /* anchor table */ }; @@ -132,7 +132,7 @@ typedef struct HB_MarkRecord_ HB_MarkRecord; struct HB_MarkArray_ { - FT_UShort MarkCount; /* number of MarkRecord tables */ + HB_UShort MarkCount; /* number of MarkRecord tables */ HB_MarkRecord* MarkRecord; /* array of MarkRecord tables */ }; @@ -152,7 +152,7 @@ typedef struct HB_SinglePosFormat1_ HB_SinglePosFormat1; struct HB_SinglePosFormat2_ { - FT_UShort ValueCount; /* number of ValueRecord tables */ + HB_UShort ValueCount; /* number of ValueRecord tables */ HB_ValueRecord* Value; /* array of ValueRecord tables */ }; @@ -161,10 +161,10 @@ typedef struct HB_SinglePosFormat2_ HB_SinglePosFormat2; struct HB_SinglePos_ { - FT_UShort PosFormat; /* 1 or 2 */ + HB_UShort PosFormat; /* 1 or 2 */ HB_Coverage Coverage; /* Coverage table */ - FT_UShort ValueFormat; /* format of ValueRecord table */ + HB_UShort ValueFormat; /* format of ValueRecord table */ union { @@ -180,7 +180,7 @@ typedef struct HB_SinglePos_ HB_SinglePos; struct HB_PairValueRecord_ { - FT_UShort SecondGlyph; /* glyph ID for second glyph */ + HB_UShort SecondGlyph; /* glyph ID for second glyph */ HB_ValueRecord Value1; /* pos. data for first glyph */ HB_ValueRecord Value2; /* pos. data for second glyph */ }; @@ -190,7 +190,7 @@ typedef struct HB_PairValueRecord_ HB_PairValueRecord; struct HB_PairSet_ { - FT_UShort PairValueCount; + HB_UShort PairValueCount; /* number of PairValueRecord tables */ HB_PairValueRecord* PairValueRecord; /* array of PairValueRecord tables */ @@ -201,7 +201,7 @@ typedef struct HB_PairSet_ HB_PairSet; struct HB_PairPosFormat1_ { - FT_UShort PairSetCount; /* number of PairSet tables */ + HB_UShort PairSetCount; /* number of PairSet tables */ HB_PairSet* PairSet; /* array of PairSet tables */ }; @@ -229,9 +229,9 @@ struct HB_PairPosFormat2_ { HB_ClassDefinition ClassDef1; /* class def. for first glyph */ HB_ClassDefinition ClassDef2; /* class def. for second glyph */ - FT_UShort Class1Count; /* number of classes in ClassDef1 + HB_UShort Class1Count; /* number of classes in ClassDef1 table */ - FT_UShort Class2Count; /* number of classes in ClassDef2 + HB_UShort Class2Count; /* number of classes in ClassDef2 table */ HB_Class1Record* Class1Record; /* array of Class1Record tables */ }; @@ -241,11 +241,11 @@ typedef struct HB_PairPosFormat2_ HB_PairPosFormat2; struct HB_PairPos_ { - FT_UShort PosFormat; /* 1 or 2 */ + HB_UShort PosFormat; /* 1 or 2 */ HB_Coverage Coverage; /* Coverage table */ - FT_UShort ValueFormat1; /* format of ValueRecord table + HB_UShort ValueFormat1; /* format of ValueRecord table for first glyph */ - FT_UShort ValueFormat2; /* format of ValueRecord table + HB_UShort ValueFormat2; /* format of ValueRecord table for second glyph */ union @@ -271,9 +271,9 @@ typedef struct HB_EntryExitRecord_ HB_EntryExitRecord; struct HB_CursivePos_ { - FT_UShort PosFormat; /* always 1 */ + HB_UShort PosFormat; /* always 1 */ HB_Coverage Coverage; /* Coverage table */ - FT_UShort EntryExitCount; + HB_UShort EntryExitCount; /* number of EntryExitRecord tables */ HB_EntryExitRecord* EntryExitRecord; /* array of EntryExitRecord tables */ @@ -295,7 +295,7 @@ typedef struct HB_BaseRecord_ HB_BaseRecord; struct HB_BaseArray_ { - FT_UShort BaseCount; /* number of BaseRecord tables */ + HB_UShort BaseCount; /* number of BaseRecord tables */ HB_BaseRecord* BaseRecord; /* array of BaseRecord tables */ }; @@ -304,10 +304,10 @@ typedef struct HB_BaseArray_ HB_BaseArray; struct HB_MarkBasePos_ { - FT_UShort PosFormat; /* always 1 */ + HB_UShort PosFormat; /* always 1 */ HB_Coverage MarkCoverage; /* mark glyph coverage table */ HB_Coverage BaseCoverage; /* base glyph coverage table */ - FT_UShort ClassCount; /* number of mark classes */ + HB_UShort ClassCount; /* number of mark classes */ HB_MarkArray MarkArray; /* mark array table */ HB_BaseArray BaseArray; /* base array table */ }; @@ -328,7 +328,7 @@ typedef struct HB_ComponentRecord_ HB_ComponentRecord; struct HB_LigatureAttach_ { - FT_UShort ComponentCount; + HB_UShort ComponentCount; /* number of ComponentRecord tables */ HB_ComponentRecord* ComponentRecord; /* array of ComponentRecord tables */ @@ -339,7 +339,7 @@ typedef struct HB_LigatureAttach_ HB_LigatureAttach; struct HB_LigatureArray_ { - FT_UShort LigatureCount; /* number of LigatureAttach tables */ + HB_UShort LigatureCount; /* number of LigatureAttach tables */ HB_LigatureAttach* LigatureAttach; /* array of LigatureAttach tables */ }; @@ -349,11 +349,11 @@ typedef struct HB_LigatureArray_ HB_LigatureArray; struct HB_MarkLigPos_ { - FT_UShort PosFormat; /* always 1 */ + HB_UShort PosFormat; /* always 1 */ HB_Coverage MarkCoverage; /* mark glyph coverage table */ HB_Coverage LigatureCoverage; /* ligature glyph coverage table */ - FT_UShort ClassCount; /* number of mark classes */ + HB_UShort ClassCount; /* number of mark classes */ HB_MarkArray MarkArray; /* mark array table */ HB_LigatureArray LigatureArray; /* ligature array table */ }; @@ -374,7 +374,7 @@ typedef struct HB_Mark2Record_ HB_Mark2Record; struct HB_Mark2Array_ { - FT_UShort Mark2Count; /* number of Mark2Record tables */ + HB_UShort Mark2Count; /* number of Mark2Record tables */ HB_Mark2Record* Mark2Record; /* array of Mark2Record tables */ }; @@ -383,10 +383,10 @@ typedef struct HB_Mark2Array_ HB_Mark2Array; struct HB_MarkMarkPos_ { - FT_UShort PosFormat; /* always 1 */ + HB_UShort PosFormat; /* always 1 */ HB_Coverage Mark1Coverage; /* first mark glyph coverage table */ HB_Coverage Mark2Coverage; /* second mark glyph coverave table */ - FT_UShort ClassCount; /* number of combining mark classes */ + HB_UShort ClassCount; /* number of combining mark classes */ HB_MarkArray Mark1Array; /* MarkArray table for first mark */ HB_Mark2Array Mark2Array; /* MarkArray table for second mark */ }; @@ -398,9 +398,9 @@ typedef struct HB_MarkMarkPos_ HB_MarkMarkPos; struct HB_PosLookupRecord_ { - FT_UShort SequenceIndex; /* index into current + HB_UShort SequenceIndex; /* index into current glyph sequence */ - FT_UShort LookupListIndex; /* Lookup to apply to that pos. */ + HB_UShort LookupListIndex; /* Lookup to apply to that pos. */ }; typedef struct HB_PosLookupRecord_ HB_PosLookupRecord; @@ -410,9 +410,9 @@ typedef struct HB_PosLookupRecord_ HB_PosLookupRecord; struct HB_PosRule_ { - FT_UShort GlyphCount; /* total number of input glyphs */ - FT_UShort PosCount; /* number of PosLookupRecord tables */ - FT_UShort* Input; /* array of input glyph IDs */ + HB_UShort GlyphCount; /* total number of input glyphs */ + HB_UShort PosCount; /* number of PosLookupRecord tables */ + HB_UShort* Input; /* array of input glyph IDs */ HB_PosLookupRecord* PosLookupRecord; /* array of PosLookupRecord tables */ }; @@ -422,7 +422,7 @@ typedef struct HB_PosRule_ HB_PosRule; struct HB_PosRuleSet_ { - FT_UShort PosRuleCount; /* number of PosRule tables */ + HB_UShort PosRuleCount; /* number of PosRule tables */ HB_PosRule* PosRule; /* array of PosRule tables */ }; @@ -432,7 +432,7 @@ typedef struct HB_PosRuleSet_ HB_PosRuleSet; struct HB_ContextPosFormat1_ { HB_Coverage Coverage; /* Coverage table */ - FT_UShort PosRuleSetCount; /* number of PosRuleSet tables */ + HB_UShort PosRuleSetCount; /* number of PosRuleSet tables */ HB_PosRuleSet* PosRuleSet; /* array of PosRuleSet tables */ }; @@ -441,9 +441,9 @@ typedef struct HB_ContextPosFormat1_ HB_ContextPosFormat1; struct HB_PosClassRule_ { - FT_UShort GlyphCount; /* total number of context classes */ - FT_UShort PosCount; /* number of PosLookupRecord tables */ - FT_UShort* Class; /* array of classes */ + HB_UShort GlyphCount; /* total number of context classes */ + HB_UShort PosCount; /* number of PosLookupRecord tables */ + HB_UShort* Class; /* array of classes */ HB_PosLookupRecord* PosLookupRecord; /* array of PosLookupRecord tables */ }; @@ -453,7 +453,7 @@ typedef struct HB_PosClassRule_ HB_PosClassRule; struct HB_PosClassSet_ { - FT_UShort PosClassRuleCount; + HB_UShort PosClassRuleCount; /* number of PosClassRule tables */ HB_PosClassRule* PosClassRule; /* array of PosClassRule tables */ }; @@ -467,11 +467,11 @@ typedef struct HB_PosClassSet_ HB_PosClassSet; struct HB_ContextPosFormat2_ { - FT_UShort MaxContextLength; + HB_UShort MaxContextLength; /* maximal context length */ HB_Coverage Coverage; /* Coverage table */ HB_ClassDefinition ClassDef; /* ClassDef table */ - FT_UShort PosClassSetCount; + HB_UShort PosClassSetCount; /* number of PosClassSet tables */ HB_PosClassSet* PosClassSet; /* array of PosClassSet tables */ }; @@ -481,8 +481,8 @@ typedef struct HB_ContextPosFormat2_ HB_ContextPosFormat2; struct HB_ContextPosFormat3_ { - FT_UShort GlyphCount; /* number of input glyphs */ - FT_UShort PosCount; /* number of PosLookupRecord tables */ + HB_UShort GlyphCount; /* number of input glyphs */ + HB_UShort PosCount; /* number of PosLookupRecord tables */ HB_Coverage* Coverage; /* array of Coverage tables */ HB_PosLookupRecord* PosLookupRecord; /* array of PosLookupRecord tables */ @@ -493,7 +493,7 @@ typedef struct HB_ContextPosFormat3_ HB_ContextPosFormat3; struct HB_ContextPos_ { - FT_UShort PosFormat; /* 1, 2, or 3 */ + HB_UShort PosFormat; /* 1, 2, or 3 */ union { @@ -510,16 +510,16 @@ typedef struct HB_ContextPos_ HB_ContextPos; struct HB_ChainPosRule_ { - FT_UShort BacktrackGlyphCount; + HB_UShort BacktrackGlyphCount; /* total number of backtrack glyphs */ - FT_UShort* Backtrack; /* array of backtrack glyph IDs */ - FT_UShort InputGlyphCount; + HB_UShort* Backtrack; /* array of backtrack glyph IDs */ + HB_UShort InputGlyphCount; /* total number of input glyphs */ - FT_UShort* Input; /* array of input glyph IDs */ - FT_UShort LookaheadGlyphCount; + HB_UShort* Input; /* array of input glyph IDs */ + HB_UShort LookaheadGlyphCount; /* total number of lookahead glyphs */ - FT_UShort* Lookahead; /* array of lookahead glyph IDs */ - FT_UShort PosCount; /* number of PosLookupRecords */ + HB_UShort* Lookahead; /* array of lookahead glyph IDs */ + HB_UShort PosCount; /* number of PosLookupRecords */ HB_PosLookupRecord* PosLookupRecord; /* array of PosLookupRecords */ }; @@ -529,7 +529,7 @@ typedef struct HB_ChainPosRule_ HB_ChainPosRule; struct HB_ChainPosRuleSet_ { - FT_UShort ChainPosRuleCount; + HB_UShort ChainPosRuleCount; /* number of ChainPosRule tables */ HB_ChainPosRule* ChainPosRule; /* array of ChainPosRule tables */ }; @@ -540,7 +540,7 @@ typedef struct HB_ChainPosRuleSet_ HB_ChainPosRuleSet; struct HB_ChainContextPosFormat1_ { HB_Coverage Coverage; /* Coverage table */ - FT_UShort ChainPosRuleSetCount; + HB_UShort ChainPosRuleSetCount; /* number of ChainPosRuleSet tables */ HB_ChainPosRuleSet* ChainPosRuleSet; /* array of ChainPosRuleSet tables */ @@ -551,18 +551,18 @@ typedef struct HB_ChainContextPosFormat1_ HB_ChainContextPosFormat1; struct HB_ChainPosClassRule_ { - FT_UShort BacktrackGlyphCount; + HB_UShort BacktrackGlyphCount; /* total number of backtrack classes */ - FT_UShort* Backtrack; /* array of backtrack classes */ - FT_UShort InputGlyphCount; + HB_UShort* Backtrack; /* array of backtrack classes */ + HB_UShort InputGlyphCount; /* total number of context classes */ - FT_UShort* Input; /* array of context classes */ - FT_UShort LookaheadGlyphCount; + HB_UShort* Input; /* array of context classes */ + HB_UShort LookaheadGlyphCount; /* total number of lookahead classes */ - FT_UShort* Lookahead; /* array of lookahead classes */ - FT_UShort PosCount; /* number of PosLookupRecords */ + HB_UShort* Lookahead; /* array of lookahead classes */ + HB_UShort PosCount; /* number of PosLookupRecords */ HB_PosLookupRecord* PosLookupRecord; /* array of substitution lookups */ }; @@ -572,7 +572,7 @@ typedef struct HB_ChainPosClassRule_ HB_ChainPosClassRule; struct HB_ChainPosClassSet_ { - FT_UShort ChainPosClassRuleCount; + HB_UShort ChainPosClassRuleCount; /* number of ChainPosClassRule tables */ HB_ChainPosClassRule* ChainPosClassRule; @@ -591,20 +591,20 @@ struct HB_ChainContextPosFormat2_ { HB_Coverage Coverage; /* Coverage table */ - FT_UShort MaxBacktrackLength; + HB_UShort MaxBacktrackLength; /* maximal backtrack length */ HB_ClassDefinition BacktrackClassDef; /* BacktrackClassDef table */ - FT_UShort MaxInputLength; + HB_UShort MaxInputLength; /* maximal input length */ HB_ClassDefinition InputClassDef; /* InputClassDef table */ - FT_UShort MaxLookaheadLength; + HB_UShort MaxLookaheadLength; /* maximal lookahead length */ HB_ClassDefinition LookaheadClassDef; /* LookaheadClassDef table */ - FT_UShort ChainPosClassSetCount; + HB_UShort ChainPosClassSetCount; /* number of ChainPosClassSet tables */ HB_ChainPosClassSet* ChainPosClassSet; @@ -617,22 +617,22 @@ typedef struct HB_ChainContextPosFormat2_ HB_ChainContextPosFormat2; struct HB_ChainContextPosFormat3_ { - FT_UShort BacktrackGlyphCount; + HB_UShort BacktrackGlyphCount; /* number of backtrack glyphs */ HB_Coverage* BacktrackCoverage; /* array of backtrack Coverage tables */ - FT_UShort InputGlyphCount; + HB_UShort InputGlyphCount; /* number of input glyphs */ HB_Coverage* InputCoverage; /* array of input coverage tables */ - FT_UShort LookaheadGlyphCount; + HB_UShort LookaheadGlyphCount; /* number of lookahead glyphs */ HB_Coverage* LookaheadCoverage; /* array of lookahead coverage tables */ - FT_UShort PosCount; /* number of PosLookupRecords */ + HB_UShort PosCount; /* number of PosLookupRecords */ HB_PosLookupRecord* PosLookupRecord; /* array of substitution lookups */ }; @@ -642,7 +642,7 @@ typedef struct HB_ChainContextPosFormat3_ HB_ChainContextPosFormat3; struct HB_ChainContextPos_ { - FT_UShort PosFormat; /* 1, 2, or 3 */ + HB_UShort PosFormat; /* 1, 2, or 3 */ union { @@ -659,8 +659,8 @@ typedef struct HB_ChainContextPos_ HB_ChainContextPos; /* LookupType 10 */ struct HB_ExtensionPos_ { - FT_UShort PosFormat; /* always 1 */ - FT_UShort LookuptType; /* lookup-type of referenced subtable */ + HB_UShort PosFormat; /* always 1 */ + HB_UShort LookuptType; /* lookup-type of referenced subtable */ HB_GPOS_SubTable *subtable; /* referenced subtable */ }; @@ -687,12 +687,12 @@ typedef union HB_GPOS_SubTable_ HB_GPOS_SubTable; HB_INTERNAL HB_Error _HB_GPOS_Load_SubTable( HB_GPOS_SubTable* st, FT_Stream stream, - FT_UShort lookup_type ); + HB_UShort lookup_type ); HB_INTERNAL void _HB_GPOS_Free_SubTable( HB_GPOS_SubTable* st, - FT_UShort lookup_type ); + HB_UShort lookup_type ); -FT_END_HEADER +HB_END_HEADER #endif /* HARFBUZZ_GPOS_PRIVATE_H */ diff --git a/src/harfbuzz-gpos.c b/src/harfbuzz-gpos.c index 859524ea..01966ce4 100644 --- a/src/harfbuzz-gpos.c +++ b/src/harfbuzz-gpos.c @@ -20,11 +20,11 @@ struct GPOS_Instance_ { HB_GPOSHeader* gpos; FT_Face face; - FT_Bool dvi; - FT_UShort load_flags; /* how the glyph should be loaded */ - FT_Bool r2l; + HB_Bool dvi; + HB_UShort load_flags; /* how the glyph should be loaded */ + HB_Bool r2l; - FT_UShort last; /* the last valid glyph -- used + HB_UShort last; /* the last valid glyph -- used with cursive positioning */ FT_Pos anchor_x; /* the coordinates of the anchor point */ FT_Pos anchor_y; /* of the last valid glyph */ @@ -34,9 +34,9 @@ typedef struct GPOS_Instance_ GPOS_Instance; static HB_Error GPOS_Do_Glyph_Lookup( GPOS_Instance* gpi, - FT_UShort lookup_index, + HB_UShort lookup_index, HB_Buffer buffer, - FT_UShort context_length, + HB_UShort context_length, int nesting_level ); @@ -45,7 +45,7 @@ static HB_Error GPOS_Do_Glyph_Lookup( GPOS_Instance* gpi, meaningful if multiple master fonts are to be supported. */ static HB_Error default_mmfunc( FT_Face face, - FT_UShort metric_id, + HB_UShort metric_id, FT_Pos* metric_value, void* data ) { @@ -62,9 +62,9 @@ HB_Error HB_Load_GPOS_Table( FT_Face face, HB_GPOSHeader** retptr, HB_GDEFHeader* gdef ) { - FT_ULong cur_offset, new_offset, base_offset; + HB_UInt cur_offset, new_offset, base_offset; - FT_UShort i, num_lookups; + HB_UShort i, num_lookups; HB_GPOSHeader* gpos; HB_Lookup* lo; @@ -206,13 +206,13 @@ HB_Error HB_Done_GPOS_Table( HB_GPOSHeader* gpos ) the parent table and not the parent record. */ static HB_Error Load_ValueRecord( HB_ValueRecord* vr, - FT_UShort format, - FT_ULong base_offset, + HB_UShort format, + HB_UInt base_offset, FT_Stream stream ) { HB_Error error; - FT_ULong cur_offset, new_offset; + HB_UInt cur_offset, new_offset; if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT ) @@ -450,7 +450,7 @@ Fail3: static void Free_ValueRecord( HB_ValueRecord* vr, - FT_UShort format ) + HB_UShort format ) { if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE ) _HB_OPEN_Free_Device( &vr->YAdvanceDevice ); @@ -465,15 +465,15 @@ static void Free_ValueRecord( HB_ValueRecord* vr, static HB_Error Get_ValueRecord( GPOS_Instance* gpi, HB_ValueRecord* vr, - FT_UShort format, + HB_UShort format, HB_Position gd ) { FT_Pos value; - FT_Short pixel_value; + HB_Short pixel_value; HB_Error error = HB_Err_Ok; HB_GPOSHeader* gpos = gpi->gpos; - FT_UShort x_ppem, y_ppem; + HB_UShort x_ppem, y_ppem; FT_Fixed x_scale, y_scale; @@ -571,7 +571,7 @@ static HB_Error Load_Anchor( HB_Anchor* an, { HB_Error error; - FT_ULong cur_offset, new_offset, base_offset; + HB_UInt cur_offset, new_offset, base_offset; base_offset = FILE_Pos(); @@ -695,7 +695,7 @@ static void Free_Anchor( HB_Anchor* an ) static HB_Error Get_Anchor( GPOS_Instance* gpi, HB_Anchor* an, - FT_UShort glyph_index, + HB_UShort glyph_index, FT_Pos* x_value, FT_Pos* y_value ) { @@ -703,12 +703,12 @@ static HB_Error Get_Anchor( GPOS_Instance* gpi, FT_Outline outline; HB_GPOSHeader* gpos = gpi->gpos; - FT_UShort ap; + HB_UShort ap; - FT_Short pixel_value; - FT_UShort load_flags; + HB_Short pixel_value; + HB_UShort load_flags; - FT_UShort x_ppem, y_ppem; + HB_UShort x_ppem, y_ppem; FT_Fixed x_scale, y_scale; @@ -808,8 +808,8 @@ static HB_Error Load_MarkArray ( HB_MarkArray* ma, { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_MarkRecord* mr; @@ -860,7 +860,7 @@ Fail: static void Free_MarkArray( HB_MarkArray* ma ) { - FT_UShort n, count; + HB_UShort n, count; HB_MarkRecord* mr; @@ -889,8 +889,8 @@ static HB_Error Load_SinglePos( HB_GPOS_SubTable* st, HB_Error error; HB_SinglePos* sp = &st->single; - FT_UShort n, m, count, format; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count, format; + HB_UInt cur_offset, new_offset, base_offset; HB_ValueRecord* vr; @@ -968,7 +968,7 @@ Fail2: static void Free_SinglePos( HB_GPOS_SubTable* st ) { - FT_UShort n, count, format; + HB_UShort n, count, format; HB_SinglePos* sp = &st->single; HB_ValueRecord* v; @@ -1004,11 +1004,11 @@ static void Free_SinglePos( HB_GPOS_SubTable* st ) static HB_Error Lookup_SinglePos( GPOS_Instance* gpi, HB_GPOS_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, property; + HB_UShort index, property; HB_Error error; HB_GPOSHeader* gpos = gpi->gpos; HB_SinglePos* sp = &st->single; @@ -1058,14 +1058,14 @@ static HB_Error Lookup_SinglePos( GPOS_Instance* gpi, /* PairSet */ static HB_Error Load_PairSet ( HB_PairSet* ps, - FT_UShort format1, - FT_UShort format2, + HB_UShort format1, + HB_UShort format2, FT_Stream stream ) { HB_Error error; - FT_UShort n, m, count; - FT_ULong base_offset; + HB_UShort n, m, count; + HB_UInt base_offset; HB_PairValueRecord* pvr; @@ -1132,10 +1132,10 @@ Fail: static void Free_PairSet( HB_PairSet* ps, - FT_UShort format1, - FT_UShort format2 ) + HB_UShort format1, + HB_UShort format2 ) { - FT_UShort n, count; + HB_UShort n, count; HB_PairValueRecord* pvr; @@ -1161,14 +1161,14 @@ static void Free_PairSet( HB_PairSet* ps, /* PairPosFormat1 */ static HB_Error Load_PairPos1( HB_PairPosFormat1* ppf1, - FT_UShort format1, - FT_UShort format2, + HB_UShort format1, + HB_UShort format2, FT_Stream stream ) { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_PairSet* ps; @@ -1218,10 +1218,10 @@ Fail: static void Free_PairPos1( HB_PairPosFormat1* ppf1, - FT_UShort format1, - FT_UShort format2 ) + HB_UShort format1, + HB_UShort format2 ) { - FT_UShort n, count; + HB_UShort n, count; HB_PairSet* ps; @@ -1242,14 +1242,14 @@ static void Free_PairPos1( HB_PairPosFormat1* ppf1, /* PairPosFormat2 */ static HB_Error Load_PairPos2( HB_PairPosFormat2* ppf2, - FT_UShort format1, - FT_UShort format2, + HB_UShort format1, + HB_UShort format2, FT_Stream stream ) { HB_Error error; - FT_UShort m, n, k, count1, count2; - FT_ULong cur_offset, new_offset1, new_offset2, base_offset; + HB_UShort m, n, k, count1, count2; + HB_UInt cur_offset, new_offset1, new_offset2, base_offset; HB_Class1Record* c1r; HB_Class2Record* c2r; @@ -1363,10 +1363,10 @@ Fail3: static void Free_PairPos2( HB_PairPosFormat2* ppf2, - FT_UShort format1, - FT_UShort format2 ) + HB_UShort format1, + HB_UShort format2 ) { - FT_UShort m, n, count1, count2; + HB_UShort m, n, count1, count2; HB_Class1Record* c1r; HB_Class2Record* c2r; @@ -1407,8 +1407,8 @@ static HB_Error Load_PairPos( HB_GPOS_SubTable* st, HB_Error error; HB_PairPos* pp = &st->pair; - FT_UShort format1, format2; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort format1, format2; + HB_UInt cur_offset, new_offset, base_offset; base_offset = FILE_Pos(); @@ -1458,7 +1458,7 @@ Fail: static void Free_PairPos( HB_GPOS_SubTable* st ) { - FT_UShort format1, format2; + HB_UShort format1, format2; HB_PairPos* pp = &st->pair; @@ -1486,13 +1486,13 @@ static void Free_PairPos( HB_GPOS_SubTable* st ) static HB_Error Lookup_PairPos1( GPOS_Instance* gpi, HB_PairPosFormat1* ppf1, HB_Buffer buffer, - FT_ULong first_pos, - FT_UShort index, - FT_UShort format1, - FT_UShort format2 ) + HB_UInt first_pos, + HB_UShort index, + HB_UShort format1, + HB_UShort format2 ) { HB_Error error; - FT_UShort numpvr, glyph2; + HB_UShort numpvr, glyph2; HB_PairValueRecord* pvr; @@ -1528,12 +1528,12 @@ static HB_Error Lookup_PairPos1( GPOS_Instance* gpi, static HB_Error Lookup_PairPos2( GPOS_Instance* gpi, HB_PairPosFormat2* ppf2, HB_Buffer buffer, - FT_ULong first_pos, - FT_UShort format1, - FT_UShort format2 ) + HB_UInt first_pos, + HB_UShort format1, + HB_UShort format2 ) { HB_Error error; - FT_UShort cl1 = 0, cl2 = 0; /* shut compiler up */ + HB_UShort cl1 = 0, cl2 = 0; /* shut compiler up */ HB_Class1Record* c1r; HB_Class2Record* c2r; @@ -1563,13 +1563,13 @@ static HB_Error Lookup_PairPos2( GPOS_Instance* gpi, static HB_Error Lookup_PairPos( GPOS_Instance* gpi, HB_GPOS_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { HB_Error error; - FT_UShort index, property; - FT_ULong first_pos; + HB_UShort index, property; + HB_UInt first_pos; HB_GPOSHeader* gpos = gpi->gpos; HB_PairPos* pp = &st->pair; @@ -1650,8 +1650,8 @@ static HB_Error Load_CursivePos( HB_GPOS_SubTable* st, HB_Error error; HB_CursivePos* cp = &st->cursive; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_EntryExitRecord* eer; @@ -1688,7 +1688,7 @@ static HB_Error Load_CursivePos( HB_GPOS_SubTable* st, for ( n = 0; n < count; n++ ) { - FT_ULong entry_offset; + HB_UInt entry_offset; if ( ACCESS_Frame( 2L ) ) return error; @@ -1756,7 +1756,7 @@ Fail2: static void Free_CursivePos( HB_GPOS_SubTable* st ) { - FT_UShort n, count; + HB_UShort n, count; HB_CursivePos* cp = &st->cursive; HB_EntryExitRecord* eer; @@ -1783,11 +1783,11 @@ static void Free_CursivePos( HB_GPOS_SubTable* st ) static HB_Error Lookup_CursivePos( GPOS_Instance* gpi, HB_GPOS_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, property; + HB_UShort index, property; HB_Error error; HB_GPOSHeader* gpos = gpi->gpos; HB_CursivePos* cp = &st->cursive; @@ -2008,13 +2008,13 @@ end: /* BaseArray */ static HB_Error Load_BaseArray( HB_BaseArray* ba, - FT_UShort num_classes, + HB_UShort num_classes, FT_Stream stream ) { HB_Error error; - FT_UShort m, n, k, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort m, n, k, count; + HB_UInt cur_offset, new_offset, base_offset; HB_BaseRecord* br; HB_Anchor* ban; @@ -2096,9 +2096,9 @@ Fail: static void Free_BaseArray( HB_BaseArray* ba, - FT_UShort num_classes ) + HB_UShort num_classes ) { - FT_UShort m, n, count; + HB_UShort m, n, count; HB_BaseRecord* br; HB_Anchor* ban; @@ -2132,7 +2132,7 @@ static HB_Error Load_MarkBasePos( HB_GPOS_SubTable* st, HB_Error error; HB_MarkBasePos* mbp = &st->markbase; - FT_ULong cur_offset, new_offset, base_offset; + HB_UInt cur_offset, new_offset, base_offset; base_offset = FILE_Pos(); @@ -2222,11 +2222,11 @@ static void Free_MarkBasePos( HB_GPOS_SubTable* st ) static HB_Error Lookup_MarkBasePos( GPOS_Instance* gpi, HB_GPOS_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort i, j, mark_index, base_index, property, class; + HB_UShort i, j, mark_index, base_index, property, class; FT_Pos x_mark_value, y_mark_value, x_base_value, y_base_value; HB_Error error; HB_GPOSHeader* gpos = gpi->gpos; @@ -2340,13 +2340,13 @@ static HB_Error Lookup_MarkBasePos( GPOS_Instance* gpi, /* LigatureAttach */ static HB_Error Load_LigatureAttach( HB_LigatureAttach* lat, - FT_UShort num_classes, + HB_UShort num_classes, FT_Stream stream ) { HB_Error error; - FT_UShort m, n, k, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort m, n, k, count; + HB_UInt cur_offset, new_offset, base_offset; HB_ComponentRecord* cr; HB_Anchor* lan; @@ -2426,9 +2426,9 @@ Fail: static void Free_LigatureAttach( HB_LigatureAttach* lat, - FT_UShort num_classes ) + HB_UShort num_classes ) { - FT_UShort m, n, count; + HB_UShort m, n, count; HB_ComponentRecord* cr; HB_Anchor* lan; @@ -2457,13 +2457,13 @@ static void Free_LigatureAttach( HB_LigatureAttach* lat, /* LigatureArray */ static HB_Error Load_LigatureArray( HB_LigatureArray* la, - FT_UShort num_classes, + HB_UShort num_classes, FT_Stream stream ) { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_LigatureAttach* lat; @@ -2513,9 +2513,9 @@ Fail: static void Free_LigatureArray( HB_LigatureArray* la, - FT_UShort num_classes ) + HB_UShort num_classes ) { - FT_UShort n, count; + HB_UShort n, count; HB_LigatureAttach* lat; @@ -2541,7 +2541,7 @@ static HB_Error Load_MarkLigPos( HB_GPOS_SubTable* st, HB_Error error; HB_MarkLigPos* mlp = &st->marklig; - FT_ULong cur_offset, new_offset, base_offset; + HB_UInt cur_offset, new_offset, base_offset; base_offset = FILE_Pos(); @@ -2629,12 +2629,12 @@ static void Free_MarkLigPos( HB_GPOS_SubTable* st ) static HB_Error Lookup_MarkLigPos( GPOS_Instance* gpi, HB_GPOS_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort i, j, mark_index, lig_index, property, class; - FT_UShort mark_glyph; + HB_UShort i, j, mark_index, lig_index, property, class; + HB_UShort mark_glyph; FT_Pos x_mark_value, y_mark_value, x_lig_value, y_lig_value; HB_Error error; HB_GPOSHeader* gpos = gpi->gpos; @@ -2644,7 +2644,7 @@ static HB_Error Lookup_MarkLigPos( GPOS_Instance* gpi, HB_LigatureArray* la; HB_LigatureAttach* lat; HB_ComponentRecord* cr; - FT_UShort comp_index; + HB_UShort comp_index; HB_Anchor* mark_anchor; HB_Anchor* lig_anchor; @@ -2766,13 +2766,13 @@ static HB_Error Lookup_MarkLigPos( GPOS_Instance* gpi, /* Mark2Array */ static HB_Error Load_Mark2Array( HB_Mark2Array* m2a, - FT_UShort num_classes, + HB_UShort num_classes, FT_Stream stream ) { HB_Error error; - FT_UShort k, m, n, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort k, m, n, count; + HB_UInt cur_offset, new_offset, base_offset; HB_Mark2Record* m2r; HB_Anchor* m2an; @@ -2845,9 +2845,9 @@ Fail: static void Free_Mark2Array( HB_Mark2Array* m2a, - FT_UShort num_classes ) + HB_UShort num_classes ) { - FT_UShort m, n, count; + HB_UShort m, n, count; HB_Mark2Record* m2r; HB_Anchor* m2an; @@ -2881,7 +2881,7 @@ static HB_Error Load_MarkMarkPos( HB_GPOS_SubTable* st, HB_Error error; HB_MarkMarkPos* mmp = &st->markmark; - FT_ULong cur_offset, new_offset, base_offset; + HB_UInt cur_offset, new_offset, base_offset; base_offset = FILE_Pos(); @@ -2970,11 +2970,11 @@ static void Free_MarkMarkPos( HB_GPOS_SubTable* st ) static HB_Error Lookup_MarkMarkPos( GPOS_Instance* gpi, HB_GPOS_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort i, j, mark1_index, mark2_index, property, class; + HB_UShort i, j, mark1_index, mark2_index, property, class; FT_Pos x_mark1_value, y_mark1_value, x_mark2_value, y_mark2_value; HB_Error error; @@ -3090,14 +3090,14 @@ static HB_Error Lookup_MarkMarkPos( GPOS_Instance* gpi, matches the subrule. */ static HB_Error Do_ContextPos( GPOS_Instance* gpi, - FT_UShort GlyphCount, - FT_UShort PosCount, + HB_UShort GlyphCount, + HB_UShort PosCount, HB_PosLookupRecord* pos, HB_Buffer buffer, int nesting_level ) { HB_Error error; - FT_ULong i, old_pos; + HB_UInt i, old_pos; i = 0; @@ -3140,8 +3140,8 @@ static HB_Error Load_PosRule( HB_PosRule* pr, { HB_Error error; - FT_UShort n, count; - FT_UShort* i; + HB_UShort n, count; + HB_UShort* i; HB_PosLookupRecord* plr; @@ -3158,7 +3158,7 @@ static HB_Error Load_PosRule( HB_PosRule* pr, count = pr->GlyphCount - 1; /* only GlyphCount - 1 elements */ - if ( ALLOC_ARRAY( pr->Input, count, FT_UShort ) ) + if ( ALLOC_ARRAY( pr->Input, count, HB_UShort ) ) return error; i = pr->Input; @@ -3216,8 +3216,8 @@ static HB_Error Load_PosRuleSet( HB_PosRuleSet* prs, { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_PosRule* pr; @@ -3267,7 +3267,7 @@ Fail: static void Free_PosRuleSet( HB_PosRuleSet* prs ) { - FT_UShort n, count; + HB_UShort n, count; HB_PosRule* pr; @@ -3292,8 +3292,8 @@ static HB_Error Load_ContextPos1( HB_ContextPosFormat1* cpf1, { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_PosRuleSet* prs; @@ -3359,7 +3359,7 @@ Fail2: static void Free_ContextPos1( HB_ContextPosFormat1* cpf1 ) { - FT_UShort n, count; + HB_UShort n, count; HB_PosRuleSet* prs; @@ -3387,11 +3387,11 @@ static HB_Error Load_PosClassRule( HB_ContextPosFormat2* cpf2, { HB_Error error; - FT_UShort n, count; + HB_UShort n, count; - FT_UShort* c; + HB_UShort* c; HB_PosLookupRecord* plr; - FT_Bool* d; + HB_Bool* d; if ( ACCESS_Frame( 4L ) ) @@ -3409,7 +3409,7 @@ static HB_Error Load_PosClassRule( HB_ContextPosFormat2* cpf2, count = pcr->GlyphCount - 1; /* only GlyphCount - 1 elements */ - if ( ALLOC_ARRAY( pcr->Class, count, FT_UShort ) ) + if ( ALLOC_ARRAY( pcr->Class, count, HB_UShort ) ) return error; c = pcr->Class; @@ -3477,8 +3477,8 @@ static HB_Error Load_PosClassSet( HB_ContextPosFormat2* cpf2, { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_PosClassRule* pcr; @@ -3529,7 +3529,7 @@ Fail: static void Free_PosClassSet( HB_PosClassSet* pcs ) { - FT_UShort n, count; + HB_UShort n, count; HB_PosClassRule* pcr; @@ -3554,8 +3554,8 @@ static HB_Error Load_ContextPos2( HB_ContextPosFormat2* cpf2, { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_PosClassSet* pcs; @@ -3648,7 +3648,7 @@ Fail3: static void Free_ContextPos2( HB_ContextPosFormat2* cpf2 ) { - FT_UShort n, count; + HB_UShort n, count; HB_PosClassSet* pcs; @@ -3676,8 +3676,8 @@ static HB_Error Load_ContextPos3( HB_ContextPosFormat3* cpf3, { HB_Error error; - FT_UShort n, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, count; + HB_UInt cur_offset, new_offset, base_offset; HB_Coverage* c; HB_PosLookupRecord* plr; @@ -3754,7 +3754,7 @@ Fail2: static void Free_ContextPos3( HB_ContextPosFormat3* cpf3 ) { - FT_UShort n, count; + HB_UShort n, count; HB_Coverage* c; @@ -3826,12 +3826,12 @@ static void Free_ContextPos( HB_GPOS_SubTable* st ) static HB_Error Lookup_ContextPos1( GPOS_Instance* gpi, HB_ContextPosFormat1* cpf1, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, property; - FT_UShort i, j, k, numpr; + HB_UShort index, property; + HB_UShort i, j, k, numpr; HB_Error error; HB_GPOSHeader* gpos = gpi->gpos; @@ -3866,7 +3866,7 @@ static HB_Error Lookup_ContextPos1( GPOS_Instance* gpi, if ( error && error != HB_Err_Not_Covered ) return error; - if ( j + pr[k].GlyphCount - i == (FT_Long)buffer->in_length ) + if ( j + pr[k].GlyphCount - i == (HB_Int)buffer->in_length ) goto next_posrule; j++; } @@ -3891,16 +3891,16 @@ static HB_Error Lookup_ContextPos1( GPOS_Instance* gpi, static HB_Error Lookup_ContextPos2( GPOS_Instance* gpi, HB_ContextPosFormat2* cpf2, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, property; + HB_UShort index, property; HB_Error error; - FT_UShort i, j, k, known_classes; + HB_UShort i, j, k, known_classes; - FT_UShort* classes; - FT_UShort* cl; + HB_UShort* classes; + HB_UShort* cl; HB_GPOSHeader* gpos = gpi->gpos; HB_PosClassSet* pcs; @@ -3921,7 +3921,7 @@ static HB_Error Lookup_ContextPos2( GPOS_Instance* gpi, if ( error ) return error; - if ( ALLOC_ARRAY( classes, cpf2->MaxContextLength, FT_UShort ) ) + if ( ALLOC_ARRAY( classes, cpf2->MaxContextLength, HB_UShort ) ) return error; error = _HB_OPEN_Get_Class( &cpf2->ClassDef, IN_CURGLYPH(), @@ -3958,7 +3958,7 @@ static HB_Error Lookup_ContextPos2( GPOS_Instance* gpi, if ( error && error != HB_Err_Not_Covered ) goto End; - if ( j + pr->GlyphCount - i == (FT_Long)buffer->in_length ) + if ( j + pr->GlyphCount - i == (HB_Int)buffer->in_length ) goto next_posclassrule; j++; } @@ -3998,12 +3998,12 @@ End: static HB_Error Lookup_ContextPos3( GPOS_Instance* gpi, HB_ContextPosFormat3* cpf3, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { HB_Error error; - FT_UShort index, i, j, property; + HB_UShort index, i, j, property; HB_GPOSHeader* gpos = gpi->gpos; HB_Coverage* c; @@ -4030,7 +4030,7 @@ static HB_Error Lookup_ContextPos3( GPOS_Instance* gpi, if ( error && error != HB_Err_Not_Covered ) return error; - if ( j + cpf3->GlyphCount - i == (FT_Long)buffer->in_length ) + if ( j + cpf3->GlyphCount - i == (HB_Int)buffer->in_length ) return HB_Err_Not_Covered; j++; } @@ -4050,8 +4050,8 @@ static HB_Error Lookup_ContextPos3( GPOS_Instance* gpi, static HB_Error Lookup_ContextPos( GPOS_Instance* gpi, HB_GPOS_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { HB_ContextPos* cp = &st->context; @@ -4087,10 +4087,10 @@ static HB_Error Load_ChainPosRule( HB_ChainPosRule* cpr, { HB_Error error; - FT_UShort n, count; - FT_UShort* b; - FT_UShort* i; - FT_UShort* l; + HB_UShort n, count; + HB_UShort* b; + HB_UShort* i; + HB_UShort* l; HB_PosLookupRecord* plr; @@ -4106,7 +4106,7 @@ static HB_Error Load_ChainPosRule( HB_ChainPosRule* cpr, count = cpr->BacktrackGlyphCount; - if ( ALLOC_ARRAY( cpr->Backtrack, count, FT_UShort ) ) + if ( ALLOC_ARRAY( cpr->Backtrack, count, HB_UShort ) ) return error; b = cpr->Backtrack; @@ -4130,7 +4130,7 @@ static HB_Error Load_ChainPosRule( HB_ChainPosRule* cpr, count = cpr->InputGlyphCount - 1; /* only InputGlyphCount - 1 elements */ - if ( ALLOC_ARRAY( cpr->Input, count, FT_UShort ) ) + if ( ALLOC_ARRAY( cpr->Input, count, HB_UShort ) ) goto Fail4; i = cpr->Input; @@ -4154,7 +4154,7 @@ static HB_Error Load_ChainPosRule( HB_ChainPosRule* cpr, count = cpr->LookaheadGlyphCount; - if ( ALLOC_ARRAY( cpr->Lookahead, count, FT_UShort ) ) + if ( ALLOC_ARRAY( cpr->Lookahead, count, HB_UShort ) ) goto Fail3; l = cpr->Lookahead; @@ -4227,8 +4227,8 @@ static HB_Error Load_ChainPosRuleSet( HB_ChainPosRuleSet* cprs, { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_ChainPosRule* cpr; @@ -4278,7 +4278,7 @@ Fail: static void Free_ChainPosRuleSet( HB_ChainPosRuleSet* cprs ) { - FT_UShort n, count; + HB_UShort n, count; HB_ChainPosRule* cpr; @@ -4303,8 +4303,8 @@ static HB_Error Load_ChainContextPos1( HB_ChainContextPosFormat1* ccpf1, { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_ChainPosRuleSet* cprs; @@ -4370,7 +4370,7 @@ Fail2: static void Free_ChainContextPos1( HB_ChainContextPosFormat1* ccpf1 ) { - FT_UShort n, count; + HB_UShort n, count; HB_ChainPosRuleSet* cprs; @@ -4399,13 +4399,13 @@ static HB_Error Load_ChainPosClassRule( { HB_Error error; - FT_UShort n, count; + HB_UShort n, count; - FT_UShort* b; - FT_UShort* i; - FT_UShort* l; + HB_UShort* b; + HB_UShort* i; + HB_UShort* l; HB_PosLookupRecord* plr; - FT_Bool* d; + HB_Bool* d; if ( ACCESS_Frame( 2L ) ) @@ -4422,7 +4422,7 @@ static HB_Error Load_ChainPosClassRule( count = cpcr->BacktrackGlyphCount; - if ( ALLOC_ARRAY( cpcr->Backtrack, count, FT_UShort ) ) + if ( ALLOC_ARRAY( cpcr->Backtrack, count, HB_UShort ) ) return error; b = cpcr->Backtrack; @@ -4458,7 +4458,7 @@ static HB_Error Load_ChainPosClassRule( count = cpcr->InputGlyphCount - 1; /* only InputGlyphCount - 1 elements */ - if ( ALLOC_ARRAY( cpcr->Input, count, FT_UShort ) ) + if ( ALLOC_ARRAY( cpcr->Input, count, HB_UShort ) ) goto Fail4; i = cpcr->Input; @@ -4491,7 +4491,7 @@ static HB_Error Load_ChainPosClassRule( count = cpcr->LookaheadGlyphCount; - if ( ALLOC_ARRAY( cpcr->Lookahead, count, FT_UShort ) ) + if ( ALLOC_ARRAY( cpcr->Lookahead, count, HB_UShort ) ) goto Fail3; l = cpcr->Lookahead; @@ -4572,8 +4572,8 @@ static HB_Error Load_ChainPosClassSet( { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_ChainPosClassRule* cpcr; @@ -4625,7 +4625,7 @@ Fail: static void Free_ChainPosClassSet( HB_ChainPosClassSet* cpcs ) { - FT_UShort n, count; + HB_UShort n, count; HB_ChainPosClassRule* cpcr; @@ -4650,9 +4650,9 @@ static HB_Error Load_ChainContextPos2( HB_ChainContextPosFormat2* ccpf2, { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; - FT_ULong backtrack_offset, input_offset, lookahead_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; + HB_UInt backtrack_offset, input_offset, lookahead_offset; HB_ChainPosClassSet* cpcs; @@ -4762,7 +4762,7 @@ Fail5: static void Free_ChainContextPos2( HB_ChainContextPosFormat2* ccpf2 ) { - FT_UShort n, count; + HB_UShort n, count; HB_ChainPosClassSet* cpcs; @@ -4793,9 +4793,9 @@ static HB_Error Load_ChainContextPos3( HB_ChainContextPosFormat3* ccpf3, { HB_Error error; - FT_UShort n, nb, ni, nl, m, count; - FT_UShort backtrack_count, input_count, lookahead_count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, nb, ni, nl, m, count; + HB_UShort backtrack_count, input_count, lookahead_count; + HB_UInt cur_offset, new_offset, base_offset; HB_Coverage* b; HB_Coverage* i; @@ -4958,7 +4958,7 @@ Fail4: static void Free_ChainContextPos3( HB_ChainContextPosFormat3* ccpf3 ) { - FT_UShort n, count; + HB_UShort n, count; HB_Coverage* c; @@ -5053,13 +5053,13 @@ static HB_Error Lookup_ChainContextPos1( GPOS_Instance* gpi, HB_ChainContextPosFormat1* ccpf1, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, property; - FT_UShort i, j, k, num_cpr; - FT_UShort bgc, igc, lgc; + HB_UShort index, property; + HB_UShort i, j, k, num_cpr; + HB_UShort bgc, igc, lgc; HB_Error error; HB_GPOSHeader* gpos = gpi->gpos; @@ -5136,7 +5136,7 @@ static HB_Error Lookup_ChainContextPos1( if ( error && error != HB_Err_Not_Covered ) return error; - if ( j + igc - i + lgc == (FT_Long)buffer->in_length ) + if ( j + igc - i + lgc == (HB_Int)buffer->in_length ) goto next_chainposrule; j++; } @@ -5155,7 +5155,7 @@ static HB_Error Lookup_ChainContextPos1( if ( error && error != HB_Err_Not_Covered ) return error; - if ( j + lgc - i == (FT_Long)buffer->in_length ) + if ( j + lgc - i == (HB_Int)buffer->in_length ) goto next_chainposrule; j++; } @@ -5182,25 +5182,25 @@ static HB_Error Lookup_ChainContextPos2( GPOS_Instance* gpi, HB_ChainContextPosFormat2* ccpf2, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, property; + HB_UShort index, property; HB_Error error; - FT_UShort i, j, k; - FT_UShort bgc, igc, lgc; - FT_UShort known_backtrack_classes, + HB_UShort i, j, k; + HB_UShort bgc, igc, lgc; + HB_UShort known_backtrack_classes, known_input_classes, known_lookahead_classes; - FT_UShort* backtrack_classes; - FT_UShort* input_classes; - FT_UShort* lookahead_classes; + HB_UShort* backtrack_classes; + HB_UShort* input_classes; + HB_UShort* lookahead_classes; - FT_UShort* bc; - FT_UShort* ic; - FT_UShort* lc; + HB_UShort* bc; + HB_UShort* ic; + HB_UShort* lc; HB_GPOSHeader* gpos = gpi->gpos; HB_ChainPosClassSet* cpcs; @@ -5221,15 +5221,15 @@ static HB_Error Lookup_ChainContextPos2( if ( error ) return error; - if ( ALLOC_ARRAY( backtrack_classes, ccpf2->MaxBacktrackLength, FT_UShort ) ) + if ( ALLOC_ARRAY( backtrack_classes, ccpf2->MaxBacktrackLength, HB_UShort ) ) return error; known_backtrack_classes = 0; - if ( ALLOC_ARRAY( input_classes, ccpf2->MaxInputLength, FT_UShort ) ) + if ( ALLOC_ARRAY( input_classes, ccpf2->MaxInputLength, HB_UShort ) ) goto End3; known_input_classes = 1; - if ( ALLOC_ARRAY( lookahead_classes, ccpf2->MaxLookaheadLength, FT_UShort ) ) + if ( ALLOC_ARRAY( lookahead_classes, ccpf2->MaxLookaheadLength, HB_UShort ) ) goto End2; known_lookahead_classes = 0; @@ -5307,7 +5307,7 @@ static HB_Error Lookup_ChainContextPos2( if ( error && error != HB_Err_Not_Covered ) goto End1; - if ( j + igc - i + lgc == (FT_Long)buffer->in_length ) + if ( j + igc - i + lgc == (HB_Int)buffer->in_length ) goto next_chainposclassrule; j++; } @@ -5337,7 +5337,7 @@ static HB_Error Lookup_ChainContextPos2( if ( error && error != HB_Err_Not_Covered ) goto End1; - if ( j + lgc - i == (FT_Long)buffer->in_length ) + if ( j + lgc - i == (HB_Int)buffer->in_length ) goto next_chainposclassrule; j++; } @@ -5384,12 +5384,12 @@ static HB_Error Lookup_ChainContextPos3( GPOS_Instance* gpi, HB_ChainContextPosFormat3* ccpf3, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, i, j, property; - FT_UShort bgc, igc, lgc; + HB_UShort index, i, j, property; + HB_UShort bgc, igc, lgc; HB_Error error; HB_GPOSHeader* gpos = gpi->gpos; @@ -5451,7 +5451,7 @@ static HB_Error Lookup_ChainContextPos3( if ( error && error != HB_Err_Not_Covered ) return error; - if ( j + igc - i + lgc == (FT_Long)buffer->in_length ) + if ( j + igc - i + lgc == (HB_Int)buffer->in_length ) return HB_Err_Not_Covered; j++; } @@ -5473,7 +5473,7 @@ static HB_Error Lookup_ChainContextPos3( if ( error && error != HB_Err_Not_Covered ) return error; - if ( j + lgc - i == (FT_Long)buffer->in_length ) + if ( j + lgc - i == (HB_Int)buffer->in_length ) return HB_Err_Not_Covered; j++; } @@ -5495,8 +5495,8 @@ static HB_Error Lookup_ChainContextPos( GPOS_Instance* gpi, HB_GPOS_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { HB_ChainContextPos* ccp = &st->chain; @@ -5534,10 +5534,10 @@ static HB_Error Lookup_ChainContextPos( HB_Error HB_GPOS_Select_Script( HB_GPOSHeader* gpos, - FT_ULong script_tag, - FT_UShort* script_index ) + HB_UInt script_tag, + HB_UShort* script_index ) { - FT_UShort n; + HB_UShort n; HB_ScriptList* sl; HB_ScriptRecord* sr; @@ -5563,12 +5563,12 @@ HB_Error HB_GPOS_Select_Script( HB_GPOSHeader* gpos, HB_Error HB_GPOS_Select_Language( HB_GPOSHeader* gpos, - FT_ULong language_tag, - FT_UShort script_index, - FT_UShort* language_index, - FT_UShort* req_feature_index ) + HB_UInt language_tag, + HB_UShort script_index, + HB_UShort* language_index, + HB_UShort* req_feature_index ) { - FT_UShort n; + HB_UShort n; HB_ScriptList* sl; HB_ScriptRecord* sr; @@ -5606,19 +5606,19 @@ HB_Error HB_GPOS_Select_Language( HB_GPOSHeader* gpos, HB_Error HB_GPOS_Select_Feature( HB_GPOSHeader* gpos, - FT_ULong feature_tag, - FT_UShort script_index, - FT_UShort language_index, - FT_UShort* feature_index ) + HB_UInt feature_tag, + HB_UShort script_index, + HB_UShort language_index, + HB_UShort* feature_index ) { - FT_UShort n; + HB_UShort n; HB_ScriptList* sl; HB_ScriptRecord* sr; HB_Script* s; HB_LangSysRecord* lsr; HB_LangSys* ls; - FT_UShort* fi; + HB_UShort* fi; HB_FeatureList* fl; HB_FeatureRecord* fr; @@ -5672,11 +5672,11 @@ HB_Error HB_GPOS_Select_Feature( HB_GPOSHeader* gpos, HB_Error HB_GPOS_Query_Scripts( HB_GPOSHeader* gpos, - FT_ULong** script_tag_list ) + HB_UInt** script_tag_list ) { HB_Error error; - FT_UShort n; - FT_ULong* stl; + HB_UShort n; + HB_UInt* stl; HB_ScriptList* sl; HB_ScriptRecord* sr; @@ -5688,7 +5688,7 @@ HB_Error HB_GPOS_Query_Scripts( HB_GPOSHeader* gpos, sl = &gpos->ScriptList; sr = sl->ScriptRecord; - if ( ALLOC_ARRAY( stl, sl->ScriptCount + 1, FT_ULong ) ) + if ( ALLOC_ARRAY( stl, sl->ScriptCount + 1, HB_UInt ) ) return error; for ( n = 0; n < sl->ScriptCount; n++ ) @@ -5703,12 +5703,12 @@ HB_Error HB_GPOS_Query_Scripts( HB_GPOSHeader* gpos, HB_Error HB_GPOS_Query_Languages( HB_GPOSHeader* gpos, - FT_UShort script_index, - FT_ULong** language_tag_list ) + HB_UShort script_index, + HB_UInt** language_tag_list ) { HB_Error error; - FT_UShort n; - FT_ULong* ltl; + HB_UShort n; + HB_UInt* ltl; HB_ScriptList* sl; HB_ScriptRecord* sr; @@ -5728,7 +5728,7 @@ HB_Error HB_GPOS_Query_Languages( HB_GPOSHeader* gpos, s = &sr[script_index].Script; lsr = s->LangSysRecord; - if ( ALLOC_ARRAY( ltl, s->LangSysCount + 1, FT_ULong ) ) + if ( ALLOC_ARRAY( ltl, s->LangSysCount + 1, HB_UInt ) ) return error; for ( n = 0; n < s->LangSysCount; n++ ) @@ -5746,20 +5746,20 @@ HB_Error HB_GPOS_Query_Languages( HB_GPOSHeader* gpos, HB_Error HB_GPOS_Query_Features( HB_GPOSHeader* gpos, - FT_UShort script_index, - FT_UShort language_index, - FT_ULong** feature_tag_list ) + HB_UShort script_index, + HB_UShort language_index, + HB_UInt** feature_tag_list ) { - FT_UShort n; + HB_UShort n; HB_Error error; - FT_ULong* ftl; + HB_UInt* ftl; HB_ScriptList* sl; HB_ScriptRecord* sr; HB_Script* s; HB_LangSysRecord* lsr; HB_LangSys* ls; - FT_UShort* fi; + HB_UShort* fi; HB_FeatureList* fl; HB_FeatureRecord* fr; @@ -5792,7 +5792,7 @@ HB_Error HB_GPOS_Query_Features( HB_GPOSHeader* gpos, fi = ls->FeatureIndex; - if ( ALLOC_ARRAY( ftl, ls->FeatureCount + 1, FT_ULong ) ) + if ( ALLOC_ARRAY( ftl, ls->FeatureCount + 1, HB_UInt ) ) return error; for ( n = 0; n < ls->FeatureCount; n++ ) @@ -5815,13 +5815,13 @@ HB_Error HB_GPOS_Query_Features( HB_GPOSHeader* gpos, /* Do an individual subtable lookup. Returns HB_Err_Ok if positioning has been done, or HB_Err_Not_Covered if not. */ static HB_Error GPOS_Do_Glyph_Lookup( GPOS_Instance* gpi, - FT_UShort lookup_index, + HB_UShort lookup_index, HB_Buffer buffer, - FT_UShort context_length, + HB_UShort context_length, int nesting_level ) { HB_Error error = HB_Err_Not_Covered; - FT_UShort i, flags, lookup_count; + HB_UShort i, flags, lookup_count; HB_GPOSHeader* gpos = gpi->gpos; HB_Lookup* lo; int lookup_type; @@ -5880,7 +5880,7 @@ static HB_Error GPOS_Do_Glyph_Lookup( GPOS_Instance* gpi, HB_INTERNAL HB_Error _HB_GPOS_Load_SubTable( HB_GPOS_SubTable* st, FT_Stream stream, - FT_UShort lookup_type ) + HB_UShort lookup_type ) { switch ( lookup_type ) { case HB_GPOS_LOOKUP_SINGLE: return Load_SinglePos ( st, stream ); @@ -5899,7 +5899,7 @@ _HB_GPOS_Load_SubTable( HB_GPOS_SubTable* st, HB_INTERNAL void _HB_GPOS_Free_SubTable( HB_GPOS_SubTable* st, - FT_UShort lookup_type ) + HB_UShort lookup_type ) { switch ( lookup_type ) { case HB_GPOS_LOOKUP_SINGLE: Free_SinglePos ( st ); return; @@ -5919,17 +5919,17 @@ _HB_GPOS_Free_SubTable( HB_GPOS_SubTable* st, /* apply one lookup to the input string object */ static HB_Error GPOS_Do_String_Lookup( GPOS_Instance* gpi, - FT_UShort lookup_index, + HB_UShort lookup_index, HB_Buffer buffer ) { HB_Error error, retError = HB_Err_Not_Covered; HB_GPOSHeader* gpos = gpi->gpos; - FT_UInt* properties = gpos->LookupList.Properties; + HB_UInt* properties = gpos->LookupList.Properties; const int nesting_level = 0; /* 0xFFFF indicates that we don't have a context length yet */ - const FT_UShort context_length = 0xFFFF; + const HB_UShort context_length = 0xFFFF; gpi->last = 0xFFFF; /* no last valid glyph for cursive pos. */ @@ -5971,7 +5971,7 @@ static HB_Error GPOS_Do_String_Lookup( GPOS_Instance* gpi, static HB_Error Position_CursiveChain ( HB_Buffer buffer ) { - FT_ULong i, j; + HB_UInt i, j; HB_Position positions = buffer->positions; /* First handle all left-to-right connections */ @@ -5995,15 +5995,15 @@ static HB_Error Position_CursiveChain ( HB_Buffer buffer ) HB_Error HB_GPOS_Add_Feature( HB_GPOSHeader* gpos, - FT_UShort feature_index, - FT_UInt property ) + HB_UShort feature_index, + HB_UInt property ) { - FT_UShort i; + HB_UShort i; HB_Feature feature; - FT_UInt* properties; - FT_UShort* index; - FT_UShort lookup_count; + HB_UInt* properties; + HB_UShort* index; + HB_UShort lookup_count; /* Each feature can only be added once */ @@ -6022,7 +6022,7 @@ HB_Error HB_GPOS_Add_Feature( HB_GPOSHeader* gpos, for ( i = 0; i < feature.LookupListCount; i++ ) { - FT_UShort lookup_index = index[i]; + HB_UShort lookup_index = index[i]; if (lookup_index < lookup_count) properties[lookup_index] |= property; } @@ -6034,9 +6034,9 @@ HB_Error HB_GPOS_Add_Feature( HB_GPOSHeader* gpos, HB_Error HB_GPOS_Clear_Features( HB_GPOSHeader* gpos ) { - FT_UShort i; + HB_UShort i; - FT_UInt* properties; + HB_UInt* properties; if ( !gpos ) @@ -6086,10 +6086,10 @@ HB_Error HB_GPOS_Register_MM_Function( HB_GPOSHeader* gpos, HB_Error HB_GPOS_Apply_String( FT_Face face, HB_GPOSHeader* gpos, - FT_UShort load_flags, + HB_UShort load_flags, HB_Buffer buffer, - FT_Bool dvi, - FT_Bool r2l ) + HB_Bool dvi, + HB_Bool r2l ) { HB_Error error, retError = HB_Err_Not_Covered; GPOS_Instance gpi; @@ -6119,12 +6119,12 @@ HB_Error HB_GPOS_Apply_String( FT_Face face, for ( i = 0; i < num_features; i++ ) { - FT_UShort feature_index = gpos->FeatureList.ApplyOrder[i]; + HB_UShort feature_index = gpos->FeatureList.ApplyOrder[i]; HB_Feature feature = gpos->FeatureList.FeatureRecord[feature_index].Feature; for ( j = 0; j < feature.LookupListCount; j++ ) { - FT_UShort lookup_index = feature.LookupListIndex[j]; + HB_UShort lookup_index = feature.LookupListIndex[j]; /* Skip nonexistant lookups */ if (lookup_index >= lookup_count) diff --git a/src/harfbuzz-gpos.h b/src/harfbuzz-gpos.h index 893f20f2..6d8cd8d5 100644 --- a/src/harfbuzz-gpos.h +++ b/src/harfbuzz-gpos.h @@ -16,7 +16,7 @@ #include "harfbuzz-gdef.h" #include "harfbuzz-buffer.h" -FT_BEGIN_HEADER +HB_BEGIN_HEADER #define HB_Err_Invalid_GPOS_SubTable_Format 0x1020 #define HB_Err_Invalid_GPOS_SubTable 0x1021 @@ -49,8 +49,8 @@ FT_BEGIN_HEADER _glyph = HANDLE_Glyph( glyph ) */ typedef HB_Error (*HB_GlyphFunction)(FT_Face face, - FT_UInt glyphIndex, - FT_Int loadFlags ); + HB_UInt glyphIndex, + HB_Int loadFlags ); /* A pointer to a function which accesses the PostScript interpreter. @@ -65,7 +65,7 @@ typedef HB_Error (*HB_GlyphFunction)(FT_Face face, be rounded). */ typedef HB_Error (*HB_MMFunction)(FT_Face face, - FT_UShort metric_id, + HB_UShort metric_id, FT_Pos* metric_value, void* data ); @@ -106,38 +106,38 @@ HB_Error HB_Done_GPOS_Table( HB_GPOSHeader* gpos ); HB_Error HB_GPOS_Select_Script( HB_GPOSHeader* gpos, - FT_ULong script_tag, - FT_UShort* script_index ); + HB_UInt script_tag, + HB_UShort* script_index ); HB_Error HB_GPOS_Select_Language( HB_GPOSHeader* gpos, - FT_ULong language_tag, - FT_UShort script_index, - FT_UShort* language_index, - FT_UShort* req_feature_index ); + HB_UInt language_tag, + HB_UShort script_index, + HB_UShort* language_index, + HB_UShort* req_feature_index ); HB_Error HB_GPOS_Select_Feature( HB_GPOSHeader* gpos, - FT_ULong feature_tag, - FT_UShort script_index, - FT_UShort language_index, - FT_UShort* feature_index ); + HB_UInt feature_tag, + HB_UShort script_index, + HB_UShort language_index, + HB_UShort* feature_index ); HB_Error HB_GPOS_Query_Scripts( HB_GPOSHeader* gpos, - FT_ULong** script_tag_list ); + HB_UInt** script_tag_list ); HB_Error HB_GPOS_Query_Languages( HB_GPOSHeader* gpos, - FT_UShort script_index, - FT_ULong** language_tag_list ); + HB_UShort script_index, + HB_UInt** language_tag_list ); HB_Error HB_GPOS_Query_Features( HB_GPOSHeader* gpos, - FT_UShort script_index, - FT_UShort language_index, - FT_ULong** feature_tag_list ); + HB_UShort script_index, + HB_UShort language_index, + HB_UInt** feature_tag_list ); HB_Error HB_GPOS_Add_Feature( HB_GPOSHeader* gpos, - FT_UShort feature_index, - FT_UInt property ); + HB_UShort feature_index, + HB_UInt property ); HB_Error HB_GPOS_Clear_Features( HB_GPOSHeader* gpos ); @@ -156,11 +156,11 @@ HB_Error HB_GPOS_Register_MM_Function( HB_GPOSHeader* gpos, HB_Error HB_GPOS_Apply_String( FT_Face face, HB_GPOSHeader* gpos, - FT_UShort load_flags, + HB_UShort load_flags, HB_Buffer buffer, - FT_Bool dvi, - FT_Bool r2l ); + HB_Bool dvi, + HB_Bool r2l ); -FT_END_HEADER +HB_END_HEADER #endif /* HARFBUZZ_GPOS_H */ diff --git a/src/harfbuzz-gsub-private.h b/src/harfbuzz-gsub-private.h index 45bae945..9e39815d 100644 --- a/src/harfbuzz-gsub-private.h +++ b/src/harfbuzz-gsub-private.h @@ -16,7 +16,7 @@ #include "harfbuzz-impl.h" #include "harfbuzz-gsub.h" -FT_BEGIN_HEADER +HB_BEGIN_HEADER typedef union HB_GSUB_SubTable_ HB_GSUB_SubTable; @@ -25,7 +25,7 @@ typedef union HB_GSUB_SubTable_ HB_GSUB_SubTable; struct HB_SingleSubstFormat1_ { - FT_Short DeltaGlyphID; /* constant added to get + HB_Short DeltaGlyphID; /* constant added to get substitution glyph index */ }; @@ -34,9 +34,9 @@ typedef struct HB_SingleSubstFormat1_ HB_SingleSubstFormat1; struct HB_SingleSubstFormat2_ { - FT_UShort GlyphCount; /* number of glyph IDs in + HB_UShort GlyphCount; /* number of glyph IDs in Substitute array */ - FT_UShort* Substitute; /* array of substitute glyph IDs */ + HB_UShort* Substitute; /* array of substitute glyph IDs */ }; typedef struct HB_SingleSubstFormat2_ HB_SingleSubstFormat2; @@ -44,7 +44,7 @@ typedef struct HB_SingleSubstFormat2_ HB_SingleSubstFormat2; struct HB_SingleSubst_ { - FT_UShort SubstFormat; /* 1 or 2 */ + HB_UShort SubstFormat; /* 1 or 2 */ HB_Coverage Coverage; /* Coverage table */ union @@ -61,9 +61,9 @@ typedef struct HB_SingleSubst_ HB_SingleSubst; struct HB_Sequence_ { - FT_UShort GlyphCount; /* number of glyph IDs in the + HB_UShort GlyphCount; /* number of glyph IDs in the Substitute array */ - FT_UShort* Substitute; /* string of glyph IDs to + HB_UShort* Substitute; /* string of glyph IDs to substitute */ }; @@ -72,9 +72,9 @@ typedef struct HB_Sequence_ HB_Sequence; struct HB_MultipleSubst_ { - FT_UShort SubstFormat; /* always 1 */ + HB_UShort SubstFormat; /* always 1 */ HB_Coverage Coverage; /* Coverage table */ - FT_UShort SequenceCount; /* number of Sequence tables */ + HB_UShort SequenceCount; /* number of Sequence tables */ HB_Sequence* Sequence; /* array of Sequence tables */ }; @@ -85,9 +85,9 @@ typedef struct HB_MultipleSubst_ HB_MultipleSubst; struct HB_AlternateSet_ { - FT_UShort GlyphCount; /* number of glyph IDs in the + HB_UShort GlyphCount; /* number of glyph IDs in the Alternate array */ - FT_UShort* Alternate; /* array of alternate glyph IDs */ + HB_UShort* Alternate; /* array of alternate glyph IDs */ }; typedef struct HB_AlternateSet_ HB_AlternateSet; @@ -95,9 +95,9 @@ typedef struct HB_AlternateSet_ HB_AlternateSet; struct HB_AlternateSubst_ { - FT_UShort SubstFormat; /* always 1 */ + HB_UShort SubstFormat; /* always 1 */ HB_Coverage Coverage; /* Coverage table */ - FT_UShort AlternateSetCount; + HB_UShort AlternateSetCount; /* number of AlternateSet tables */ HB_AlternateSet* AlternateSet; /* array of AlternateSet tables */ }; @@ -109,10 +109,10 @@ typedef struct HB_AlternateSubst_ HB_AlternateSubst; struct HB_Ligature_ { - FT_UShort LigGlyph; /* glyphID of ligature + HB_UShort LigGlyph; /* glyphID of ligature to substitute */ - FT_UShort ComponentCount; /* number of components in ligature */ - FT_UShort* Component; /* array of component glyph IDs */ + HB_UShort ComponentCount; /* number of components in ligature */ + HB_UShort* Component; /* array of component glyph IDs */ }; typedef struct HB_Ligature_ HB_Ligature; @@ -120,7 +120,7 @@ typedef struct HB_Ligature_ HB_Ligature; struct HB_LigatureSet_ { - FT_UShort LigatureCount; /* number of Ligature tables */ + HB_UShort LigatureCount; /* number of Ligature tables */ HB_Ligature* Ligature; /* array of Ligature tables */ }; @@ -129,9 +129,9 @@ typedef struct HB_LigatureSet_ HB_LigatureSet; struct HB_LigatureSubst_ { - FT_UShort SubstFormat; /* always 1 */ + HB_UShort SubstFormat; /* always 1 */ HB_Coverage Coverage; /* Coverage table */ - FT_UShort LigatureSetCount; /* number of LigatureSet tables */ + HB_UShort LigatureSetCount; /* number of LigatureSet tables */ HB_LigatureSet* LigatureSet; /* array of LigatureSet tables */ }; @@ -142,9 +142,9 @@ typedef struct HB_LigatureSubst_ HB_LigatureSubst; struct HB_SubstLookupRecord_ { - FT_UShort SequenceIndex; /* index into current + HB_UShort SequenceIndex; /* index into current glyph sequence */ - FT_UShort LookupListIndex; /* Lookup to apply to that pos. */ + HB_UShort LookupListIndex; /* Lookup to apply to that pos. */ }; typedef struct HB_SubstLookupRecord_ HB_SubstLookupRecord; @@ -154,10 +154,10 @@ typedef struct HB_SubstLookupRecord_ HB_SubstLookupRecord; struct HB_SubRule_ { - FT_UShort GlyphCount; /* total number of input glyphs */ - FT_UShort SubstCount; /* number of SubstLookupRecord + HB_UShort GlyphCount; /* total number of input glyphs */ + HB_UShort SubstCount; /* number of SubstLookupRecord tables */ - FT_UShort* Input; /* array of input glyph IDs */ + HB_UShort* Input; /* array of input glyph IDs */ HB_SubstLookupRecord* SubstLookupRecord; /* array of SubstLookupRecord tables */ @@ -168,7 +168,7 @@ typedef struct HB_SubRule_ HB_SubRule; struct HB_SubRuleSet_ { - FT_UShort SubRuleCount; /* number of SubRule tables */ + HB_UShort SubRuleCount; /* number of SubRule tables */ HB_SubRule* SubRule; /* array of SubRule tables */ }; @@ -178,7 +178,7 @@ typedef struct HB_SubRuleSet_ HB_SubRuleSet; struct HB_ContextSubstFormat1_ { HB_Coverage Coverage; /* Coverage table */ - FT_UShort SubRuleSetCount; /* number of SubRuleSet tables */ + HB_UShort SubRuleSetCount; /* number of SubRuleSet tables */ HB_SubRuleSet* SubRuleSet; /* array of SubRuleSet tables */ }; @@ -187,10 +187,10 @@ typedef struct HB_ContextSubstFormat1_ HB_ContextSubstFormat1; struct HB_SubClassRule_ { - FT_UShort GlyphCount; /* total number of context classes */ - FT_UShort SubstCount; /* number of SubstLookupRecord + HB_UShort GlyphCount; /* total number of context classes */ + HB_UShort SubstCount; /* number of SubstLookupRecord tables */ - FT_UShort* Class; /* array of classes */ + HB_UShort* Class; /* array of classes */ HB_SubstLookupRecord* SubstLookupRecord; /* array of SubstLookupRecord tables */ @@ -201,7 +201,7 @@ typedef struct HB_SubClassRule_ HB_SubClassRule; struct HB_SubClassSet_ { - FT_UShort SubClassRuleCount; + HB_UShort SubClassRuleCount; /* number of SubClassRule tables */ HB_SubClassRule* SubClassRule; /* array of SubClassRule tables */ }; @@ -215,11 +215,11 @@ typedef struct HB_SubClassSet_ HB_SubClassSet; struct HB_ContextSubstFormat2_ { - FT_UShort MaxContextLength; + HB_UShort MaxContextLength; /* maximal context length */ HB_Coverage Coverage; /* Coverage table */ HB_ClassDefinition ClassDef; /* ClassDef table */ - FT_UShort SubClassSetCount; + HB_UShort SubClassSetCount; /* number of SubClassSet tables */ HB_SubClassSet* SubClassSet; /* array of SubClassSet tables */ }; @@ -229,8 +229,8 @@ typedef struct HB_ContextSubstFormat2_ HB_ContextSubstFormat2; struct HB_ContextSubstFormat3_ { - FT_UShort GlyphCount; /* number of input glyphs */ - FT_UShort SubstCount; /* number of SubstLookupRecords */ + HB_UShort GlyphCount; /* number of input glyphs */ + HB_UShort SubstCount; /* number of SubstLookupRecords */ HB_Coverage* Coverage; /* array of Coverage tables */ HB_SubstLookupRecord* SubstLookupRecord; /* array of substitution lookups */ @@ -241,7 +241,7 @@ typedef struct HB_ContextSubstFormat3_ HB_ContextSubstFormat3; struct HB_ContextSubst_ { - FT_UShort SubstFormat; /* 1, 2, or 3 */ + HB_UShort SubstFormat; /* 1, 2, or 3 */ union { @@ -258,16 +258,16 @@ typedef struct HB_ContextSubst_ HB_ContextSubst; struct HB_ChainSubRule_ { - FT_UShort BacktrackGlyphCount; + HB_UShort BacktrackGlyphCount; /* total number of backtrack glyphs */ - FT_UShort* Backtrack; /* array of backtrack glyph IDs */ - FT_UShort InputGlyphCount; + HB_UShort* Backtrack; /* array of backtrack glyph IDs */ + HB_UShort InputGlyphCount; /* total number of input glyphs */ - FT_UShort* Input; /* array of input glyph IDs */ - FT_UShort LookaheadGlyphCount; + HB_UShort* Input; /* array of input glyph IDs */ + HB_UShort LookaheadGlyphCount; /* total number of lookahead glyphs */ - FT_UShort* Lookahead; /* array of lookahead glyph IDs */ - FT_UShort SubstCount; /* number of SubstLookupRecords */ + HB_UShort* Lookahead; /* array of lookahead glyph IDs */ + HB_UShort SubstCount; /* number of SubstLookupRecords */ HB_SubstLookupRecord* SubstLookupRecord; /* array of SubstLookupRecords */ }; @@ -277,7 +277,7 @@ typedef struct HB_ChainSubRule_ HB_ChainSubRule; struct HB_ChainSubRuleSet_ { - FT_UShort ChainSubRuleCount; + HB_UShort ChainSubRuleCount; /* number of ChainSubRule tables */ HB_ChainSubRule* ChainSubRule; /* array of ChainSubRule tables */ }; @@ -288,7 +288,7 @@ typedef struct HB_ChainSubRuleSet_ HB_ChainSubRuleSet; struct HB_ChainContextSubstFormat1_ { HB_Coverage Coverage; /* Coverage table */ - FT_UShort ChainSubRuleSetCount; + HB_UShort ChainSubRuleSetCount; /* number of ChainSubRuleSet tables */ HB_ChainSubRuleSet* ChainSubRuleSet; /* array of ChainSubRuleSet tables */ @@ -299,18 +299,18 @@ typedef struct HB_ChainContextSubstFormat1_ HB_ChainContextSubstFormat1; struct HB_ChainSubClassRule_ { - FT_UShort BacktrackGlyphCount; + HB_UShort BacktrackGlyphCount; /* total number of backtrack classes */ - FT_UShort* Backtrack; /* array of backtrack classes */ - FT_UShort InputGlyphCount; + HB_UShort* Backtrack; /* array of backtrack classes */ + HB_UShort InputGlyphCount; /* total number of context classes */ - FT_UShort* Input; /* array of context classes */ - FT_UShort LookaheadGlyphCount; + HB_UShort* Input; /* array of context classes */ + HB_UShort LookaheadGlyphCount; /* total number of lookahead classes */ - FT_UShort* Lookahead; /* array of lookahead classes */ - FT_UShort SubstCount; /* number of SubstLookupRecords */ + HB_UShort* Lookahead; /* array of lookahead classes */ + HB_UShort SubstCount; /* number of SubstLookupRecords */ HB_SubstLookupRecord* SubstLookupRecord; /* array of substitution lookups */ }; @@ -320,7 +320,7 @@ typedef struct HB_ChainSubClassRule_ HB_ChainSubClassRule; struct HB_ChainSubClassSet_ { - FT_UShort ChainSubClassRuleCount; + HB_UShort ChainSubClassRuleCount; /* number of ChainSubClassRule tables */ HB_ChainSubClassRule* ChainSubClassRule; @@ -339,20 +339,20 @@ struct HB_ChainContextSubstFormat2_ { HB_Coverage Coverage; /* Coverage table */ - FT_UShort MaxBacktrackLength; + HB_UShort MaxBacktrackLength; /* maximal backtrack length */ HB_ClassDefinition BacktrackClassDef; /* BacktrackClassDef table */ - FT_UShort MaxInputLength; + HB_UShort MaxInputLength; /* maximal input length */ HB_ClassDefinition InputClassDef; /* InputClassDef table */ - FT_UShort MaxLookaheadLength; + HB_UShort MaxLookaheadLength; /* maximal lookahead length */ HB_ClassDefinition LookaheadClassDef; /* LookaheadClassDef table */ - FT_UShort ChainSubClassSetCount; + HB_UShort ChainSubClassSetCount; /* number of ChainSubClassSet tables */ HB_ChainSubClassSet* ChainSubClassSet; @@ -365,22 +365,22 @@ typedef struct HB_ChainContextSubstFormat2_ HB_ChainContextSubstFormat2; struct HB_ChainContextSubstFormat3_ { - FT_UShort BacktrackGlyphCount; + HB_UShort BacktrackGlyphCount; /* number of backtrack glyphs */ HB_Coverage* BacktrackCoverage; /* array of backtrack Coverage tables */ - FT_UShort InputGlyphCount; + HB_UShort InputGlyphCount; /* number of input glyphs */ HB_Coverage* InputCoverage; /* array of input coverage tables */ - FT_UShort LookaheadGlyphCount; + HB_UShort LookaheadGlyphCount; /* number of lookahead glyphs */ HB_Coverage* LookaheadCoverage; /* array of lookahead coverage tables */ - FT_UShort SubstCount; /* number of SubstLookupRecords */ + HB_UShort SubstCount; /* number of SubstLookupRecords */ HB_SubstLookupRecord* SubstLookupRecord; /* array of substitution lookups */ }; @@ -390,7 +390,7 @@ typedef struct HB_ChainContextSubstFormat3_ HB_ChainContextSubstFormat3; struct HB_ChainContextSubst_ { - FT_UShort SubstFormat; /* 1, 2, or 3 */ + HB_UShort SubstFormat; /* 1, 2, or 3 */ union { @@ -407,8 +407,8 @@ typedef struct HB_ChainContextSubst_ HB_ChainContextSubst; /* LookupType 7 */ struct HB_ExtensionSubst_ { - FT_UShort SubstFormat; /* always 1 */ - FT_UShort LookuptType; /* lookup-type of referenced subtable */ + HB_UShort SubstFormat; /* always 1 */ + HB_UShort LookuptType; /* lookup-type of referenced subtable */ HB_GSUB_SubTable *subtable; /* referenced subtable */ }; @@ -419,16 +419,16 @@ typedef struct HB_ExtensionSubst_ HB_ExtensionSubst; /* LookupType 8 */ struct HB_ReverseChainContextSubst_ { - FT_UShort SubstFormat; /* always 1 */ + HB_UShort SubstFormat; /* always 1 */ HB_Coverage Coverage; /* coverage table for input glyphs */ - FT_UShort BacktrackGlyphCount; /* number of backtrack glyphs */ + HB_UShort BacktrackGlyphCount; /* number of backtrack glyphs */ HB_Coverage* BacktrackCoverage; /* array of backtrack Coverage tables */ - FT_UShort LookaheadGlyphCount; /* number of lookahead glyphs */ + HB_UShort LookaheadGlyphCount; /* number of lookahead glyphs */ HB_Coverage* LookaheadCoverage; /* array of lookahead Coverage tables */ - FT_UShort GlyphCount; /* number of Glyph IDs */ - FT_UShort* Substitute; /* array of substitute Glyph ID */ + HB_UShort GlyphCount; /* number of Glyph IDs */ + HB_UShort* Substitute; /* array of substitute Glyph ID */ }; typedef struct HB_ReverseChainContextSubst_ HB_ReverseChainContextSubst; @@ -451,12 +451,12 @@ union HB_GSUB_SubTable_ HB_INTERNAL HB_Error _HB_GSUB_Load_SubTable( HB_GSUB_SubTable* st, FT_Stream stream, - FT_UShort lookup_type ); + HB_UShort lookup_type ); HB_INTERNAL void _HB_GSUB_Free_SubTable( HB_GSUB_SubTable* st, - FT_UShort lookup_type ); + HB_UShort lookup_type ); -FT_END_HEADER +HB_END_HEADER #endif /* HARFBUZZ_GSUB_PRIVATE_H */ diff --git a/src/harfbuzz-gsub.c b/src/harfbuzz-gsub.c index 7ef3bcb3..b02249d2 100644 --- a/src/harfbuzz-gsub.c +++ b/src/harfbuzz-gsub.c @@ -17,9 +17,9 @@ #include "harfbuzz-gdef-private.h" static HB_Error GSUB_Do_Glyph_Lookup( HB_GSUBHeader* gsub, - FT_UShort lookup_index, + HB_UShort lookup_index, HB_Buffer buffer, - FT_UShort context_length, + HB_UShort context_length, int nesting_level ); @@ -36,9 +36,9 @@ HB_Error HB_Load_GSUB_Table( FT_Face face, { FT_Stream stream = face->stream; HB_Error error; - FT_ULong cur_offset, new_offset, base_offset; + HB_UInt cur_offset, new_offset, base_offset; - FT_UShort i, num_lookups; + HB_UShort i, num_lookups; HB_GSUBHeader* gsub; HB_Lookup* lo; @@ -178,10 +178,10 @@ static HB_Error Load_SingleSubst( HB_GSUB_SubTable* st, HB_Error error; HB_SingleSubst* ss = &st->single; - FT_UShort n, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, count; + HB_UInt cur_offset, new_offset, base_offset; - FT_UShort* s; + HB_UShort* s; base_offset = FILE_Pos(); @@ -222,7 +222,7 @@ static HB_Error Load_SingleSubst( HB_GSUB_SubTable* st, ss->ssf.ssf2.Substitute = NULL; - if ( ALLOC_ARRAY( ss->ssf.ssf2.Substitute, count, FT_UShort ) ) + if ( ALLOC_ARRAY( ss->ssf.ssf2.Substitute, count, HB_UShort ) ) goto Fail2; s = ss->ssf.ssf2.Substitute; @@ -276,11 +276,11 @@ static void Free_SingleSubst( HB_GSUB_SubTable* st ) static HB_Error Lookup_SingleSubst( HB_GSUBHeader* gsub, HB_GSUB_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, value, property; + HB_UShort index, value, property; HB_Error error; HB_SingleSubst* ss = &st->single; HB_GDEFHeader* gdef = gsub->gdef; @@ -339,8 +339,8 @@ static HB_Error Load_Sequence( HB_Sequence* s, { HB_Error error; - FT_UShort n, count; - FT_UShort* sub; + HB_UShort n, count; + HB_UShort* sub; if ( ACCESS_Frame( 2L ) ) @@ -354,7 +354,7 @@ static HB_Error Load_Sequence( HB_Sequence* s, if ( count ) { - if ( ALLOC_ARRAY( s->Substitute, count, FT_UShort ) ) + if ( ALLOC_ARRAY( s->Substitute, count, HB_UShort ) ) return error; sub = s->Substitute; @@ -389,8 +389,8 @@ static HB_Error Load_MultipleSubst( HB_GSUB_SubTable* st, HB_Error error; HB_MultipleSubst* ms = &st->multiple; - FT_UShort n = 0, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n = 0, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_Sequence* s; @@ -457,7 +457,7 @@ Fail2: static void Free_MultipleSubst( HB_GSUB_SubTable* st ) { - FT_UShort n, count; + HB_UShort n, count; HB_MultipleSubst* ms = &st->multiple; HB_Sequence* s; @@ -481,13 +481,13 @@ static void Free_MultipleSubst( HB_GSUB_SubTable* st ) static HB_Error Lookup_MultipleSubst( HB_GSUBHeader* gsub, HB_GSUB_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { HB_Error error; - FT_UShort index, property, n, count; - FT_UShort*s; + HB_UShort index, property, n, count; + HB_UShort*s; HB_MultipleSubst* ms = &st->multiple; HB_GDEFHeader* gdef = gsub->gdef; @@ -540,8 +540,8 @@ static HB_Error Load_AlternateSet( HB_AlternateSet* as, { HB_Error error; - FT_UShort n, count; - FT_UShort* a; + HB_UShort n, count; + HB_UShort* a; if ( ACCESS_Frame( 2L ) ) @@ -553,7 +553,7 @@ static HB_Error Load_AlternateSet( HB_AlternateSet* as, as->Alternate = NULL; - if ( ALLOC_ARRAY( as->Alternate, count, FT_UShort ) ) + if ( ALLOC_ARRAY( as->Alternate, count, HB_UShort ) ) return error; a = as->Alternate; @@ -587,8 +587,8 @@ static HB_Error Load_AlternateSubst( HB_GSUB_SubTable* st, HB_Error error; HB_AlternateSubst* as = &st->alternate; - FT_UShort n = 0, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n = 0, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_AlternateSet* aset; @@ -655,7 +655,7 @@ Fail2: static void Free_AlternateSubst( HB_GSUB_SubTable* st ) { - FT_UShort n, count; + HB_UShort n, count; HB_AlternateSubst* as = &st->alternate; HB_AlternateSet* aset; @@ -679,12 +679,12 @@ static void Free_AlternateSubst( HB_GSUB_SubTable* st ) static HB_Error Lookup_AlternateSubst( HB_GSUBHeader* gsub, HB_GSUB_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { HB_Error error; - FT_UShort index, value, alt_index, property; + HB_UShort index, value, alt_index, property; HB_AlternateSubst* as = &st->alternate; HB_GDEFHeader* gdef = gsub->gdef; HB_AlternateSet aset; @@ -738,8 +738,8 @@ static HB_Error Load_Ligature( HB_Ligature* l, { HB_Error error; - FT_UShort n, count; - FT_UShort* c; + HB_UShort n, count; + HB_UShort* c; if ( ACCESS_Frame( 4L ) ) @@ -754,7 +754,7 @@ static HB_Error Load_Ligature( HB_Ligature* l, count = l->ComponentCount - 1; /* only ComponentCount - 1 elements */ - if ( ALLOC_ARRAY( l->Component, count, FT_UShort ) ) + if ( ALLOC_ARRAY( l->Component, count, HB_UShort ) ) return error; c = l->Component; @@ -787,8 +787,8 @@ static HB_Error Load_LigatureSet( HB_LigatureSet* ls, { HB_Error error; - FT_UShort n = 0, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n = 0, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_Ligature* l; @@ -838,7 +838,7 @@ Fail: static void Free_LigatureSet( HB_LigatureSet* ls ) { - FT_UShort n, count; + HB_UShort n, count; HB_Ligature* l; @@ -864,8 +864,8 @@ static HB_Error Load_LigatureSubst( HB_GSUB_SubTable* st, HB_Error error; HB_LigatureSubst* ls = &st->ligature; - FT_UShort n = 0, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n = 0, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_LigatureSet* lset; @@ -932,7 +932,7 @@ Fail2: static void Free_LigatureSubst( HB_GSUB_SubTable* st ) { - FT_UShort n, count; + HB_UShort n, count; HB_LigatureSubst* ls = &st->ligature; HB_LigatureSet* lset; @@ -956,14 +956,14 @@ static void Free_LigatureSubst( HB_GSUB_SubTable* st ) static HB_Error Lookup_LigatureSubst( HB_GSUBHeader* gsub, HB_GSUB_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, property; + HB_UShort index, property; HB_Error error; - FT_UShort numlig, i, j, is_mark, first_is_mark = FALSE; - FT_UShort* c; + HB_UShort numlig, i, j, is_mark, first_is_mark = FALSE; + HB_UShort* c; HB_LigatureSubst* ls = &st->ligature; HB_GDEFHeader* gdef = gsub->gdef; @@ -1007,7 +1007,7 @@ static HB_Error Lookup_LigatureSubst( HB_GSUBHeader* gsub, if ( error && error != HB_Err_Not_Covered ) return error; - if ( j + lig->ComponentCount - i == (FT_Long)buffer->in_length ) + if ( j + lig->ComponentCount - i == (HB_Int)buffer->in_length ) goto next_ligature; j++; } @@ -1042,7 +1042,7 @@ static HB_Error Lookup_LigatureSubst( HB_GSUBHeader* gsub, } else { - FT_UShort ligID = _hb_buffer_allocate_ligid( buffer ); + HB_UShort ligID = _hb_buffer_allocate_ligid( buffer ); if ( ADD_String( buffer, i, 1, &lig->LigGlyph, 0xFFFF, ligID ) ) return error; @@ -1050,7 +1050,7 @@ static HB_Error Lookup_LigatureSubst( HB_GSUBHeader* gsub, } else { - FT_UShort ligID = _hb_buffer_allocate_ligid( buffer ); + HB_UShort ligID = _hb_buffer_allocate_ligid( buffer ); if ( ADD_Glyph( buffer, lig->LigGlyph, 0xFFFF, ligID ) ) return error; @@ -1087,14 +1087,14 @@ static HB_Error Lookup_LigatureSubst( HB_GSUBHeader* gsub, matches the subrule. */ static HB_Error Do_ContextSubst( HB_GSUBHeader* gsub, - FT_UShort GlyphCount, - FT_UShort SubstCount, + HB_UShort GlyphCount, + HB_UShort SubstCount, HB_SubstLookupRecord* subst, HB_Buffer buffer, int nesting_level ) { HB_Error error; - FT_ULong i, old_pos; + HB_UInt i, old_pos; i = 0; @@ -1146,8 +1146,8 @@ static HB_Error Load_SubRule( HB_SubRule* sr, { HB_Error error; - FT_UShort n, count; - FT_UShort* i; + HB_UShort n, count; + HB_UShort* i; HB_SubstLookupRecord* slr; @@ -1164,7 +1164,7 @@ static HB_Error Load_SubRule( HB_SubRule* sr, count = sr->GlyphCount - 1; /* only GlyphCount - 1 elements */ - if ( ALLOC_ARRAY( sr->Input, count, FT_UShort ) ) + if ( ALLOC_ARRAY( sr->Input, count, HB_UShort ) ) return error; i = sr->Input; @@ -1222,8 +1222,8 @@ static HB_Error Load_SubRuleSet( HB_SubRuleSet* srs, { HB_Error error; - FT_UShort n = 0, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n = 0, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_SubRule* sr; @@ -1273,7 +1273,7 @@ Fail: static void Free_SubRuleSet( HB_SubRuleSet* srs ) { - FT_UShort n, count; + HB_UShort n, count; HB_SubRule* sr; @@ -1298,8 +1298,8 @@ static HB_Error Load_ContextSubst1( HB_ContextSubstFormat1* csf1, { HB_Error error; - FT_UShort n = 0, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n = 0, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_SubRuleSet* srs; @@ -1365,7 +1365,7 @@ Fail2: static void Free_ContextSubst1( HB_ContextSubstFormat1* csf1 ) { - FT_UShort n, count; + HB_UShort n, count; HB_SubRuleSet* srs; @@ -1393,11 +1393,11 @@ static HB_Error Load_SubClassRule( HB_ContextSubstFormat2* csf2, { HB_Error error; - FT_UShort n, count; + HB_UShort n, count; - FT_UShort* c; + HB_UShort* c; HB_SubstLookupRecord* slr; - FT_Bool* d; + HB_Bool* d; if ( ACCESS_Frame( 4L ) ) @@ -1415,7 +1415,7 @@ static HB_Error Load_SubClassRule( HB_ContextSubstFormat2* csf2, count = scr->GlyphCount - 1; /* only GlyphCount - 1 elements */ - if ( ALLOC_ARRAY( scr->Class, count, FT_UShort ) ) + if ( ALLOC_ARRAY( scr->Class, count, HB_UShort ) ) return error; c = scr->Class; @@ -1482,8 +1482,8 @@ static HB_Error Load_SubClassSet( HB_ContextSubstFormat2* csf2, { HB_Error error; - FT_UShort n = 0, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n = 0, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_SubClassRule* scr; @@ -1534,7 +1534,7 @@ Fail: static void Free_SubClassSet( HB_SubClassSet* scs ) { - FT_UShort n, count; + HB_UShort n, count; HB_SubClassRule* scr; @@ -1559,8 +1559,8 @@ static HB_Error Load_ContextSubst2( HB_ContextSubstFormat2* csf2, { HB_Error error; - FT_UShort n = 0, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n = 0, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_SubClassSet* scs; @@ -1653,7 +1653,7 @@ Fail3: static void Free_ContextSubst2( HB_ContextSubstFormat2* csf2 ) { - FT_UShort n, count; + HB_UShort n, count; HB_SubClassSet* scs; @@ -1681,8 +1681,8 @@ static HB_Error Load_ContextSubst3( HB_ContextSubstFormat3* csf3, { HB_Error error; - FT_UShort n = 0, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n = 0, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_Coverage* c; HB_SubstLookupRecord* slr; @@ -1760,7 +1760,7 @@ Fail2: static void Free_ContextSubst3( HB_ContextSubstFormat3* csf3 ) { - FT_UShort n, count; + HB_UShort n, count; HB_Coverage* c; @@ -1825,12 +1825,12 @@ static void Free_ContextSubst( HB_GSUB_SubTable* st ) static HB_Error Lookup_ContextSubst1( HB_GSUBHeader* gsub, HB_ContextSubstFormat1* csf1, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, property; - FT_UShort i, j, k, numsr; + HB_UShort index, property; + HB_UShort i, j, k, numsr; HB_Error error; HB_SubRule* sr; @@ -1864,7 +1864,7 @@ static HB_Error Lookup_ContextSubst1( HB_GSUBHeader* gsub, if ( error && error != HB_Err_Not_Covered ) return error; - if ( j + sr[k].GlyphCount - i == (FT_Long)buffer->in_length ) + if ( j + sr[k].GlyphCount - i == (HB_Int)buffer->in_length ) goto next_subrule; j++; } @@ -1888,16 +1888,16 @@ static HB_Error Lookup_ContextSubst1( HB_GSUBHeader* gsub, static HB_Error Lookup_ContextSubst2( HB_GSUBHeader* gsub, HB_ContextSubstFormat2* csf2, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, property; + HB_UShort index, property; HB_Error error; - FT_UShort i, j, k, known_classes; + HB_UShort i, j, k, known_classes; - FT_UShort* classes; - FT_UShort* cl; + HB_UShort* classes; + HB_UShort* cl; HB_SubClassSet* scs; HB_SubClassRule* sr; @@ -1917,7 +1917,7 @@ static HB_Error Lookup_ContextSubst2( HB_GSUBHeader* gsub, if ( error ) return error; - if ( ALLOC_ARRAY( classes, csf2->MaxContextLength, FT_UShort ) ) + if ( ALLOC_ARRAY( classes, csf2->MaxContextLength, HB_UShort ) ) return error; error = _HB_OPEN_Get_Class( &csf2->ClassDef, IN_CURGLYPH(), @@ -1954,7 +1954,7 @@ static HB_Error Lookup_ContextSubst2( HB_GSUBHeader* gsub, if ( error && error != HB_Err_Not_Covered ) goto End; - if ( j + sr->GlyphCount - i < (FT_Long)buffer->in_length ) + if ( j + sr->GlyphCount - i < (HB_Int)buffer->in_length ) goto next_subclassrule; j++; } @@ -1994,12 +1994,12 @@ End: static HB_Error Lookup_ContextSubst3( HB_GSUBHeader* gsub, HB_ContextSubstFormat3* csf3, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { HB_Error error; - FT_UShort index, i, j, property; + HB_UShort index, i, j, property; HB_Coverage* c; HB_GDEFHeader* gdef; @@ -2025,7 +2025,7 @@ static HB_Error Lookup_ContextSubst3( HB_GSUBHeader* gsub, if ( error && error != HB_Err_Not_Covered ) return error; - if ( j + csf3->GlyphCount - i == (FT_Long)buffer->in_length ) + if ( j + csf3->GlyphCount - i == (HB_Int)buffer->in_length ) return HB_Err_Not_Covered; j++; } @@ -2045,8 +2045,8 @@ static HB_Error Lookup_ContextSubst3( HB_GSUBHeader* gsub, static HB_Error Lookup_ContextSubst( HB_GSUBHeader* gsub, HB_GSUB_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { HB_ContextSubst* cs = &st->context; @@ -2072,10 +2072,10 @@ static HB_Error Load_ChainSubRule( HB_ChainSubRule* csr, { HB_Error error; - FT_UShort n, count; - FT_UShort* b; - FT_UShort* i; - FT_UShort* l; + HB_UShort n, count; + HB_UShort* b; + HB_UShort* i; + HB_UShort* l; HB_SubstLookupRecord* slr; @@ -2091,7 +2091,7 @@ static HB_Error Load_ChainSubRule( HB_ChainSubRule* csr, count = csr->BacktrackGlyphCount; - if ( ALLOC_ARRAY( csr->Backtrack, count, FT_UShort ) ) + if ( ALLOC_ARRAY( csr->Backtrack, count, HB_UShort ) ) return error; b = csr->Backtrack; @@ -2115,7 +2115,7 @@ static HB_Error Load_ChainSubRule( HB_ChainSubRule* csr, count = csr->InputGlyphCount - 1; /* only InputGlyphCount - 1 elements */ - if ( ALLOC_ARRAY( csr->Input, count, FT_UShort ) ) + if ( ALLOC_ARRAY( csr->Input, count, HB_UShort ) ) goto Fail4; i = csr->Input; @@ -2139,7 +2139,7 @@ static HB_Error Load_ChainSubRule( HB_ChainSubRule* csr, count = csr->LookaheadGlyphCount; - if ( ALLOC_ARRAY( csr->Lookahead, count, FT_UShort ) ) + if ( ALLOC_ARRAY( csr->Lookahead, count, HB_UShort ) ) goto Fail3; l = csr->Lookahead; @@ -2212,8 +2212,8 @@ static HB_Error Load_ChainSubRuleSet( HB_ChainSubRuleSet* csrs, { HB_Error error; - FT_UShort n = 0, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n = 0, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_ChainSubRule* csr; @@ -2263,7 +2263,7 @@ Fail: static void Free_ChainSubRuleSet( HB_ChainSubRuleSet* csrs ) { - FT_UShort n, count; + HB_UShort n, count; HB_ChainSubRule* csr; @@ -2289,8 +2289,8 @@ static HB_Error Load_ChainContextSubst1( { HB_Error error; - FT_UShort n = 0, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n = 0, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_ChainSubRuleSet* csrs; @@ -2356,7 +2356,7 @@ Fail2: static void Free_ChainContextSubst1( HB_ChainContextSubstFormat1* ccsf1 ) { - FT_UShort n, count; + HB_UShort n, count; HB_ChainSubRuleSet* csrs; @@ -2385,13 +2385,13 @@ static HB_Error Load_ChainSubClassRule( { HB_Error error; - FT_UShort n, count; + HB_UShort n, count; - FT_UShort* b; - FT_UShort* i; - FT_UShort* l; + HB_UShort* b; + HB_UShort* i; + HB_UShort* l; HB_SubstLookupRecord* slr; - FT_Bool* d; + HB_Bool* d; if ( ACCESS_Frame( 2L ) ) @@ -2408,7 +2408,7 @@ static HB_Error Load_ChainSubClassRule( count = cscr->BacktrackGlyphCount; - if ( ALLOC_ARRAY( cscr->Backtrack, count, FT_UShort ) ) + if ( ALLOC_ARRAY( cscr->Backtrack, count, HB_UShort ) ) return error; b = cscr->Backtrack; @@ -2444,7 +2444,7 @@ static HB_Error Load_ChainSubClassRule( count = cscr->InputGlyphCount - 1; /* only InputGlyphCount - 1 elements */ - if ( ALLOC_ARRAY( cscr->Input, count, FT_UShort ) ) + if ( ALLOC_ARRAY( cscr->Input, count, HB_UShort ) ) goto Fail4; i = cscr->Input; @@ -2477,7 +2477,7 @@ static HB_Error Load_ChainSubClassRule( count = cscr->LookaheadGlyphCount; - if ( ALLOC_ARRAY( cscr->Lookahead, count, FT_UShort ) ) + if ( ALLOC_ARRAY( cscr->Lookahead, count, HB_UShort ) ) goto Fail3; l = cscr->Lookahead; @@ -2559,8 +2559,8 @@ static HB_Error Load_ChainSubClassSet( { HB_Error error; - FT_UShort n = 0, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n = 0, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_ChainSubClassRule* cscr; @@ -2612,7 +2612,7 @@ Fail: static void Free_ChainSubClassSet( HB_ChainSubClassSet* cscs ) { - FT_UShort n, count; + HB_UShort n, count; HB_ChainSubClassRule* cscr; @@ -2638,9 +2638,9 @@ static HB_Error Load_ChainContextSubst2( { HB_Error error; - FT_UShort n = 0, m, count; - FT_ULong cur_offset, new_offset, base_offset; - FT_ULong backtrack_offset, input_offset, lookahead_offset; + HB_UShort n = 0, m, count; + HB_UInt cur_offset, new_offset, base_offset; + HB_UInt backtrack_offset, input_offset, lookahead_offset; HB_ChainSubClassSet* cscs; @@ -2751,7 +2751,7 @@ Fail5: static void Free_ChainContextSubst2( HB_ChainContextSubstFormat2* ccsf2 ) { - FT_UShort n, count; + HB_UShort n, count; HB_ChainSubClassSet* cscs; @@ -2783,9 +2783,9 @@ static HB_Error Load_ChainContextSubst3( { HB_Error error; - FT_UShort n, nb = 0, ni =0, nl = 0, m, count; - FT_UShort backtrack_count, input_count, lookahead_count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, nb = 0, ni =0, nl = 0, m, count; + HB_UShort backtrack_count, input_count, lookahead_count; + HB_UInt cur_offset, new_offset, base_offset; HB_Coverage* b; HB_Coverage* i; @@ -2949,7 +2949,7 @@ Fail4: static void Free_ChainContextSubst3( HB_ChainContextSubstFormat3* ccsf3 ) { - FT_UShort n, count; + HB_UShort n, count; HB_Coverage* c; @@ -3033,13 +3033,13 @@ static void Free_ChainContextSubst( HB_GSUB_SubTable* st ) static HB_Error Lookup_ChainContextSubst1( HB_GSUBHeader* gsub, HB_ChainContextSubstFormat1* ccsf1, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, property; - FT_UShort i, j, k, num_csr; - FT_UShort bgc, igc, lgc; + HB_UShort index, property; + HB_UShort i, j, k, num_csr; + HB_UShort bgc, igc, lgc; HB_Error error; HB_ChainSubRule* csr; @@ -3115,7 +3115,7 @@ static HB_Error Lookup_ChainContextSubst1( HB_GSUBHeader* gsub, if ( error && error != HB_Err_Not_Covered ) return error; - if ( j + igc - i + lgc == (FT_Long)buffer->in_length ) + if ( j + igc - i + lgc == (HB_Int)buffer->in_length ) goto next_chainsubrule; j++; } @@ -3134,7 +3134,7 @@ static HB_Error Lookup_ChainContextSubst1( HB_GSUBHeader* gsub, if ( error && error != HB_Err_Not_Covered ) return error; - if ( j + lgc - i == (FT_Long)buffer->in_length ) + if ( j + lgc - i == (HB_Int)buffer->in_length ) goto next_chainsubrule; j++; } @@ -3160,25 +3160,25 @@ static HB_Error Lookup_ChainContextSubst1( HB_GSUBHeader* gsub, static HB_Error Lookup_ChainContextSubst2( HB_GSUBHeader* gsub, HB_ChainContextSubstFormat2* ccsf2, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, property; + HB_UShort index, property; HB_Error error; - FT_UShort i, j, k; - FT_UShort bgc, igc, lgc; - FT_UShort known_backtrack_classes, + HB_UShort i, j, k; + HB_UShort bgc, igc, lgc; + HB_UShort known_backtrack_classes, known_input_classes, known_lookahead_classes; - FT_UShort* backtrack_classes; - FT_UShort* input_classes; - FT_UShort* lookahead_classes; + HB_UShort* backtrack_classes; + HB_UShort* input_classes; + HB_UShort* lookahead_classes; - FT_UShort* bc; - FT_UShort* ic; - FT_UShort* lc; + HB_UShort* bc; + HB_UShort* ic; + HB_UShort* lc; HB_ChainSubClassSet* cscs; HB_ChainSubClassRule ccsr; @@ -3198,15 +3198,15 @@ static HB_Error Lookup_ChainContextSubst2( HB_GSUBHeader* gsub, if ( error ) return error; - if ( ALLOC_ARRAY( backtrack_classes, ccsf2->MaxBacktrackLength, FT_UShort ) ) + if ( ALLOC_ARRAY( backtrack_classes, ccsf2->MaxBacktrackLength, HB_UShort ) ) return error; known_backtrack_classes = 0; - if ( ALLOC_ARRAY( input_classes, ccsf2->MaxInputLength, FT_UShort ) ) + if ( ALLOC_ARRAY( input_classes, ccsf2->MaxInputLength, HB_UShort ) ) goto End3; known_input_classes = 1; - if ( ALLOC_ARRAY( lookahead_classes, ccsf2->MaxLookaheadLength, FT_UShort ) ) + if ( ALLOC_ARRAY( lookahead_classes, ccsf2->MaxLookaheadLength, HB_UShort ) ) goto End2; known_lookahead_classes = 0; @@ -3284,7 +3284,7 @@ static HB_Error Lookup_ChainContextSubst2( HB_GSUBHeader* gsub, if ( error && error != HB_Err_Not_Covered ) goto End1; - if ( j + igc - i + lgc == (FT_Long)buffer->in_length ) + if ( j + igc - i + lgc == (HB_Int)buffer->in_length ) goto next_chainsubclassrule; j++; } @@ -3314,7 +3314,7 @@ static HB_Error Lookup_ChainContextSubst2( HB_GSUBHeader* gsub, if ( error && error != HB_Err_Not_Covered ) goto End1; - if ( j + lgc - i == (FT_Long)buffer->in_length ) + if ( j + lgc - i == (HB_Int)buffer->in_length ) goto next_chainsubclassrule; j++; } @@ -3360,12 +3360,12 @@ End3: static HB_Error Lookup_ChainContextSubst3( HB_GSUBHeader* gsub, HB_ChainContextSubstFormat3* ccsf3, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, i, j, property; - FT_UShort bgc, igc, lgc; + HB_UShort index, i, j, property; + HB_UShort bgc, igc, lgc; HB_Error error; HB_Coverage* bc; @@ -3426,7 +3426,7 @@ static HB_Error Lookup_ChainContextSubst3( HB_GSUBHeader* gsub, if ( error && error != HB_Err_Not_Covered ) return error; - if ( j + igc - i + lgc == (FT_Long)buffer->in_length ) + if ( j + igc - i + lgc == (HB_Int)buffer->in_length ) return HB_Err_Not_Covered; j++; } @@ -3448,7 +3448,7 @@ static HB_Error Lookup_ChainContextSubst3( HB_GSUBHeader* gsub, if ( error && error != HB_Err_Not_Covered ) return error; - if ( j + lgc - i == (FT_Long)buffer->in_length ) + if ( j + lgc - i == (HB_Int)buffer->in_length ) return HB_Err_Not_Covered; j++; } @@ -3469,8 +3469,8 @@ static HB_Error Lookup_ChainContextSubst3( HB_GSUBHeader* gsub, static HB_Error Lookup_ChainContextSubst( HB_GSUBHeader* gsub, HB_GSUB_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { HB_ChainContextSubst* ccs = &st->chain; @@ -3490,15 +3490,15 @@ static HB_Error Load_ReverseChainContextSubst( HB_GSUB_SubTable* st, HB_Error error; HB_ReverseChainContextSubst* rccs = &st->reverse; - FT_UShort m, count; + HB_UShort m, count; - FT_UShort nb = 0, nl = 0, n; - FT_UShort backtrack_count, lookahead_count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort nb = 0, nl = 0, n; + HB_UShort backtrack_count, lookahead_count; + HB_UInt cur_offset, new_offset, base_offset; HB_Coverage* b; HB_Coverage* l; - FT_UShort* sub; + HB_UShort* sub; base_offset = FILE_Pos(); @@ -3605,7 +3605,7 @@ static HB_Error Load_ReverseChainContextSubst( HB_GSUB_SubTable* st, count = rccs->GlyphCount; if ( ALLOC_ARRAY( rccs->Substitute, count, - FT_UShort ) ) + HB_UShort ) ) goto Fail2; sub = rccs->Substitute; @@ -3643,7 +3643,7 @@ Fail4: static void Free_ReverseChainContextSubst( HB_GSUB_SubTable* st ) { - FT_UShort n, count; + HB_UShort n, count; HB_ReverseChainContextSubst* rccs = &st->reverse; HB_Coverage* c; @@ -3679,12 +3679,12 @@ static void Free_ReverseChainContextSubst( HB_GSUB_SubTable* st ) static HB_Error Lookup_ReverseChainContextSubst( HB_GSUBHeader* gsub, HB_GSUB_SubTable* st, HB_Buffer buffer, - FT_UShort flags, - FT_UShort context_length, + HB_UShort flags, + HB_UShort context_length, int nesting_level ) { - FT_UShort index, input_index, i, j, property; - FT_UShort bgc, lgc; + HB_UShort index, input_index, i, j, property; + HB_UShort bgc, lgc; HB_Error error; HB_ReverseChainContextSubst* rccs = &st->reverse; @@ -3748,7 +3748,7 @@ static HB_Error Lookup_ReverseChainContextSubst( HB_GSUBHeader* gsub, if ( error && error != HB_Err_Not_Covered ) return error; - if ( j + lgc - i == (FT_Long)buffer->in_length ) + if ( j + lgc - i == (HB_Int)buffer->in_length ) return HB_Err_Not_Covered; j++; } @@ -3773,10 +3773,10 @@ static HB_Error Lookup_ReverseChainContextSubst( HB_GSUBHeader* gsub, HB_Error HB_GSUB_Select_Script( HB_GSUBHeader* gsub, - FT_ULong script_tag, - FT_UShort* script_index ) + HB_UInt script_tag, + HB_UShort* script_index ) { - FT_UShort n; + HB_UShort n; HB_ScriptList* sl; HB_ScriptRecord* sr; @@ -3802,12 +3802,12 @@ HB_Error HB_GSUB_Select_Script( HB_GSUBHeader* gsub, HB_Error HB_GSUB_Select_Language( HB_GSUBHeader* gsub, - FT_ULong language_tag, - FT_UShort script_index, - FT_UShort* language_index, - FT_UShort* req_feature_index ) + HB_UInt language_tag, + HB_UShort script_index, + HB_UShort* language_index, + HB_UShort* req_feature_index ) { - FT_UShort n; + HB_UShort n; HB_ScriptList* sl; HB_ScriptRecord* sr; @@ -3845,19 +3845,19 @@ HB_Error HB_GSUB_Select_Language( HB_GSUBHeader* gsub, HB_Error HB_GSUB_Select_Feature( HB_GSUBHeader* gsub, - FT_ULong feature_tag, - FT_UShort script_index, - FT_UShort language_index, - FT_UShort* feature_index ) + HB_UInt feature_tag, + HB_UShort script_index, + HB_UShort language_index, + HB_UShort* feature_index ) { - FT_UShort n; + HB_UShort n; HB_ScriptList* sl; HB_ScriptRecord* sr; HB_Script* s; HB_LangSysRecord* lsr; HB_LangSys* ls; - FT_UShort* fi; + HB_UShort* fi; HB_FeatureList* fl; HB_FeatureRecord* fr; @@ -3911,11 +3911,11 @@ HB_Error HB_GSUB_Select_Feature( HB_GSUBHeader* gsub, HB_Error HB_GSUB_Query_Scripts( HB_GSUBHeader* gsub, - FT_ULong** script_tag_list ) + HB_UInt** script_tag_list ) { - FT_UShort n; + HB_UShort n; HB_Error error; - FT_ULong* stl; + HB_UInt* stl; HB_ScriptList* sl; HB_ScriptRecord* sr; @@ -3927,7 +3927,7 @@ HB_Error HB_GSUB_Query_Scripts( HB_GSUBHeader* gsub, sl = &gsub->ScriptList; sr = sl->ScriptRecord; - if ( ALLOC_ARRAY( stl, sl->ScriptCount + 1, FT_ULong ) ) + if ( ALLOC_ARRAY( stl, sl->ScriptCount + 1, HB_UInt ) ) return error; for ( n = 0; n < sl->ScriptCount; n++ ) @@ -3942,12 +3942,12 @@ HB_Error HB_GSUB_Query_Scripts( HB_GSUBHeader* gsub, HB_Error HB_GSUB_Query_Languages( HB_GSUBHeader* gsub, - FT_UShort script_index, - FT_ULong** language_tag_list ) + HB_UShort script_index, + HB_UInt** language_tag_list ) { - FT_UShort n; + HB_UShort n; HB_Error error; - FT_ULong* ltl; + HB_UInt* ltl; HB_ScriptList* sl; HB_ScriptRecord* sr; @@ -3967,7 +3967,7 @@ HB_Error HB_GSUB_Query_Languages( HB_GSUBHeader* gsub, s = &sr[script_index].Script; lsr = s->LangSysRecord; - if ( ALLOC_ARRAY( ltl, s->LangSysCount + 1, FT_ULong ) ) + if ( ALLOC_ARRAY( ltl, s->LangSysCount + 1, HB_UInt ) ) return error; for ( n = 0; n < s->LangSysCount; n++ ) @@ -3985,20 +3985,20 @@ HB_Error HB_GSUB_Query_Languages( HB_GSUBHeader* gsub, HB_Error HB_GSUB_Query_Features( HB_GSUBHeader* gsub, - FT_UShort script_index, - FT_UShort language_index, - FT_ULong** feature_tag_list ) + HB_UShort script_index, + HB_UShort language_index, + HB_UInt** feature_tag_list ) { - FT_UShort n; + HB_UShort n; HB_Error error; - FT_ULong* ftl; + HB_UInt* ftl; HB_ScriptList* sl; HB_ScriptRecord* sr; HB_Script* s; HB_LangSysRecord* lsr; HB_LangSys* ls; - FT_UShort* fi; + HB_UShort* fi; HB_FeatureList* fl; HB_FeatureRecord* fr; @@ -4031,7 +4031,7 @@ HB_Error HB_GSUB_Query_Features( HB_GSUBHeader* gsub, fi = ls->FeatureIndex; - if ( ALLOC_ARRAY( ftl, ls->FeatureCount + 1, FT_ULong ) ) + if ( ALLOC_ARRAY( ftl, ls->FeatureCount + 1, HB_UInt ) ) return error; for ( n = 0; n < ls->FeatureCount; n++ ) @@ -4054,13 +4054,13 @@ HB_Error HB_GSUB_Query_Features( HB_GSUBHeader* gsub, /* Do an individual subtable lookup. Returns HB_Err_Ok if substitution has been done, or HB_Err_Not_Covered if not. */ static HB_Error GSUB_Do_Glyph_Lookup( HB_GSUBHeader* gsub, - FT_UShort lookup_index, + HB_UShort lookup_index, HB_Buffer buffer, - FT_UShort context_length, + HB_UShort context_length, int nesting_level ) { HB_Error error = HB_Err_Not_Covered; - FT_UShort i, flags, lookup_count; + HB_UShort i, flags, lookup_count; HB_Lookup* lo; int lookup_type; @@ -4115,7 +4115,7 @@ static HB_Error GSUB_Do_Glyph_Lookup( HB_GSUBHeader* gsub, HB_INTERNAL HB_Error _HB_GSUB_Load_SubTable( HB_GSUB_SubTable* st, FT_Stream stream, - FT_UShort lookup_type ) + HB_UShort lookup_type ) { switch (lookup_type) { case HB_GSUB_LOOKUP_SINGLE: return Load_SingleSubst ( st, stream ); @@ -4133,7 +4133,7 @@ _HB_GSUB_Load_SubTable( HB_GSUB_SubTable* st, HB_INTERNAL void _HB_GSUB_Free_SubTable( HB_GSUB_SubTable* st, - FT_UShort lookup_type ) + HB_UShort lookup_type ) { switch ( lookup_type ) { case HB_GSUB_LOOKUP_SINGLE: Free_SingleSubst ( st ); return; @@ -4153,17 +4153,17 @@ _HB_GSUB_Free_SubTable( HB_GSUB_SubTable* st, /* apply one lookup to the input string object */ static HB_Error GSUB_Do_String_Lookup( HB_GSUBHeader* gsub, - FT_UShort lookup_index, + HB_UShort lookup_index, HB_Buffer buffer ) { HB_Error error, retError = HB_Err_Not_Covered; - FT_UInt* properties = gsub->LookupList.Properties; + HB_UInt* properties = gsub->LookupList.Properties; int lookup_type = gsub->LookupList.Lookup[lookup_index].LookupType; const int nesting_level = 0; /* 0xFFFF indicates that we don't have a context length yet */ - const FT_UShort context_length = 0xFFFF; + const HB_UShort context_length = 0xFFFF; switch (lookup_type) { @@ -4242,15 +4242,15 @@ static HB_Error GSUB_Do_String_Lookup( HB_GSUBHeader* gsub, HB_Error HB_GSUB_Add_Feature( HB_GSUBHeader* gsub, - FT_UShort feature_index, - FT_UInt property ) + HB_UShort feature_index, + HB_UInt property ) { - FT_UShort i; + HB_UShort i; HB_Feature feature; - FT_UInt* properties; - FT_UShort* index; - FT_UShort lookup_count; + HB_UInt* properties; + HB_UShort* index; + HB_UShort lookup_count; /* Each feature can only be added once */ @@ -4269,7 +4269,7 @@ HB_Error HB_GSUB_Add_Feature( HB_GSUBHeader* gsub, for ( i = 0; i < feature.LookupListCount; i++ ) { - FT_UShort lookup_index = index[i]; + HB_UShort lookup_index = index[i]; if (lookup_index < lookup_count) properties[lookup_index] |= property; } @@ -4281,9 +4281,9 @@ HB_Error HB_GSUB_Add_Feature( HB_GSUBHeader* gsub, HB_Error HB_GSUB_Clear_Features( HB_GSUBHeader* gsub ) { - FT_UShort i; + HB_UShort i; - FT_UInt* properties; + HB_UInt* properties; if ( !gsub ) @@ -4335,12 +4335,12 @@ HB_Error HB_GSUB_Apply_String( HB_GSUBHeader* gsub, for ( i = 0; i < num_features; i++) { - FT_UShort feature_index = gsub->FeatureList.ApplyOrder[i]; + HB_UShort feature_index = gsub->FeatureList.ApplyOrder[i]; HB_Feature feature = gsub->FeatureList.FeatureRecord[feature_index].Feature; for ( j = 0; j < feature.LookupListCount; j++ ) { - FT_UShort lookup_index = feature.LookupListIndex[j]; + HB_UShort lookup_index = feature.LookupListIndex[j]; /* Skip nonexistant lookups */ if (lookup_index >= lookup_count) diff --git a/src/harfbuzz-gsub.h b/src/harfbuzz-gsub.h index 129671b4..3f8ed7c0 100644 --- a/src/harfbuzz-gsub.h +++ b/src/harfbuzz-gsub.h @@ -16,7 +16,7 @@ #include "harfbuzz-gdef.h" #include "harfbuzz-buffer.h" -FT_BEGIN_HEADER +HB_BEGIN_HEADER #define HB_Err_Invalid_GSUB_SubTable_Format 0x1010 #define HB_Err_Invalid_GSUB_SubTable 0x1011 @@ -41,16 +41,16 @@ FT_BEGIN_HEADER HB_GSUB_Register_Alternate_Function(). The function must return an index into the `alternates' array. */ -typedef FT_UShort (*HB_AltFunction)(FT_ULong pos, - FT_UShort glyphID, - FT_UShort num_alternates, - FT_UShort* alternates, +typedef HB_UShort (*HB_AltFunction)(HB_UInt pos, + HB_UShort glyphID, + HB_UShort num_alternates, + HB_UShort* alternates, void* data ); struct HB_GSUBHeader_ { - FT_ULong offset; + HB_UInt offset; FT_Fixed Version; @@ -80,38 +80,38 @@ HB_Error HB_Done_GSUB_Table( HB_GSUBHeader* gsub ); HB_Error HB_GSUB_Select_Script( HB_GSUBHeader* gsub, - FT_ULong script_tag, - FT_UShort* script_index ); + HB_UInt script_tag, + HB_UShort* script_index ); HB_Error HB_GSUB_Select_Language( HB_GSUBHeader* gsub, - FT_ULong language_tag, - FT_UShort script_index, - FT_UShort* language_index, - FT_UShort* req_feature_index ); + HB_UInt language_tag, + HB_UShort script_index, + HB_UShort* language_index, + HB_UShort* req_feature_index ); HB_Error HB_GSUB_Select_Feature( HB_GSUBHeader* gsub, - FT_ULong feature_tag, - FT_UShort script_index, - FT_UShort language_index, - FT_UShort* feature_index ); + HB_UInt feature_tag, + HB_UShort script_index, + HB_UShort language_index, + HB_UShort* feature_index ); HB_Error HB_GSUB_Query_Scripts( HB_GSUBHeader* gsub, - FT_ULong** script_tag_list ); + HB_UInt** script_tag_list ); HB_Error HB_GSUB_Query_Languages( HB_GSUBHeader* gsub, - FT_UShort script_index, - FT_ULong** language_tag_list ); + HB_UShort script_index, + HB_UInt** language_tag_list ); HB_Error HB_GSUB_Query_Features( HB_GSUBHeader* gsub, - FT_UShort script_index, - FT_UShort language_index, - FT_ULong** feature_tag_list ); + HB_UShort script_index, + HB_UShort language_index, + HB_UInt** feature_tag_list ); HB_Error HB_GSUB_Add_Feature( HB_GSUBHeader* gsub, - FT_UShort feature_index, - FT_UInt property ); + HB_UShort feature_index, + HB_UInt property ); HB_Error HB_GSUB_Clear_Features( HB_GSUBHeader* gsub ); @@ -125,6 +125,6 @@ HB_Error HB_GSUB_Apply_String( HB_GSUBHeader* gsub, HB_Buffer buffer ); -FT_END_HEADER +HB_END_HEADER #endif /* HARFBUZZ_GSUB_H */ diff --git a/src/harfbuzz-impl.h b/src/harfbuzz-impl.h index dc89fa67..6fd04da9 100644 --- a/src/harfbuzz-impl.h +++ b/src/harfbuzz-impl.h @@ -17,7 +17,9 @@ #include FT_FREETYPE_H #include FT_TRUETYPE_TAGS_H -FT_BEGIN_HEADER +#include "harfbuzz-global.h" + +HB_BEGIN_HEADER #ifndef HB_INTERNAL # define HB_INTERNAL @@ -89,6 +91,6 @@ FT_BEGIN_HEADER #define COPY_Glyph( buffer ) \ ( (error = _hb_buffer_copy_output_glyph ( buffer ) ) != HB_Err_Ok ) -FT_END_HEADER +HB_END_HEADER #endif /* HARFBUZZ_IMPL_H */ diff --git a/src/harfbuzz-open-private.h b/src/harfbuzz-open-private.h index f3f6cc99..de566e34 100644 --- a/src/harfbuzz-open-private.h +++ b/src/harfbuzz-open-private.h @@ -18,7 +18,7 @@ #include "harfbuzz-gsub-private.h" #include "harfbuzz-gpos-private.h" -FT_BEGIN_HEADER +HB_BEGIN_HEADER struct HB_SubTable_ @@ -47,13 +47,13 @@ _HB_OPEN_Load_Coverage( HB_Coverage* c, FT_Stream input ); HB_INTERNAL HB_Error _HB_OPEN_Load_ClassDefinition( HB_ClassDefinition* cd, - FT_UShort limit, + HB_UShort limit, FT_Stream input ); HB_INTERNAL HB_Error _HB_OPEN_Load_EmptyOrClassDefinition( HB_ClassDefinition* cd, - FT_UShort limit, - FT_ULong class_offset, - FT_ULong base_offset, + HB_UShort limit, + HB_UInt class_offset, + HB_UInt base_offset, FT_Stream stream ); HB_INTERNAL HB_Error _HB_OPEN_Load_Device( HB_Device* d, @@ -72,18 +72,18 @@ HB_INTERNAL void _HB_OPEN_Free_Device( HB_Device* d ); HB_INTERNAL HB_Error _HB_OPEN_Coverage_Index( HB_Coverage* c, - FT_UShort glyphID, - FT_UShort* index ); + HB_UShort glyphID, + HB_UShort* index ); HB_INTERNAL HB_Error _HB_OPEN_Get_Class( HB_ClassDefinition* cd, - FT_UShort glyphID, - FT_UShort* klass, - FT_UShort* index ); + HB_UShort glyphID, + HB_UShort* klass, + HB_UShort* index ); HB_INTERNAL HB_Error _HB_OPEN_Get_Device( HB_Device* d, - FT_UShort size, - FT_Short* value ); + HB_UShort size, + HB_Short* value ); -FT_END_HEADER +HB_END_HEADER #endif /* HARFBUZZ_OPEN_PRIVATE_H */ diff --git a/src/harfbuzz-open.c b/src/harfbuzz-open.c index e7881f3a..5f997e29 100644 --- a/src/harfbuzz-open.c +++ b/src/harfbuzz-open.c @@ -25,8 +25,8 @@ static HB_Error Load_LangSys( HB_LangSys* ls, FT_Stream stream ) { HB_Error error; - FT_UShort n, count; - FT_UShort* fi; + HB_UShort n, count; + HB_UShort* fi; if ( ACCESS_Frame( 6L ) ) @@ -40,7 +40,7 @@ static HB_Error Load_LangSys( HB_LangSys* ls, ls->FeatureIndex = NULL; - if ( ALLOC_ARRAY( ls->FeatureIndex, count, FT_UShort ) ) + if ( ALLOC_ARRAY( ls->FeatureIndex, count, HB_UShort ) ) return error; if ( ACCESS_Frame( count * 2L ) ) @@ -72,8 +72,8 @@ static HB_Error Load_Script( HB_Script* s, FT_Stream stream ) { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_LangSysRecord* lsr; @@ -162,7 +162,7 @@ Fail2: static void Free_Script( HB_Script* s ) { - FT_UShort n, count; + HB_UShort n, count; HB_LangSysRecord* lsr; @@ -190,8 +190,8 @@ _HB_OPEN_Load_ScriptList( HB_ScriptList* sl, { HB_Error error; - FT_UShort n, script_count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, script_count; + HB_UInt cur_offset, new_offset, base_offset; HB_ScriptRecord* sr; @@ -262,7 +262,7 @@ Fail: HB_INTERNAL void _HB_OPEN_Free_ScriptList( HB_ScriptList* sl ) { - FT_UShort n, count; + HB_UShort n, count; HB_ScriptRecord* sr; @@ -293,9 +293,9 @@ static HB_Error Load_Feature( HB_Feature* f, { HB_Error error; - FT_UShort n, count; + HB_UShort n, count; - FT_UShort* lli; + HB_UShort* lli; if ( ACCESS_Frame( 4L ) ) @@ -308,7 +308,7 @@ static HB_Error Load_Feature( HB_Feature* f, f->LookupListIndex = NULL; - if ( ALLOC_ARRAY( f->LookupListIndex, count, FT_UShort ) ) + if ( ALLOC_ARRAY( f->LookupListIndex, count, HB_UShort ) ) return error; lli = f->LookupListIndex; @@ -342,8 +342,8 @@ _HB_OPEN_Load_FeatureList( HB_FeatureList* fl, { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_FeatureRecord* fr; @@ -361,7 +361,7 @@ _HB_OPEN_Load_FeatureList( HB_FeatureList* fl, if ( ALLOC_ARRAY( fl->FeatureRecord, count, HB_FeatureRecord ) ) return error; - if ( ALLOC_ARRAY( fl->ApplyOrder, count, FT_UShort ) ) + if ( ALLOC_ARRAY( fl->ApplyOrder, count, HB_UShort ) ) goto Fail2; fl->ApplyCount = 0; @@ -403,7 +403,7 @@ Fail2: HB_INTERNAL void _HB_OPEN_Free_FeatureList( HB_FeatureList* fl ) { - FT_UShort n, count; + HB_UShort n, count; HB_FeatureRecord* fr; @@ -437,7 +437,7 @@ _HB_OPEN_Free_FeatureList( HB_FeatureList* fl ) static HB_Error Load_SubTable( HB_SubTable* st, FT_Stream stream, HB_Type table_type, - FT_UShort lookup_type ) + HB_UShort lookup_type ) { if ( table_type == HB_Type_GSUB ) return _HB_GSUB_Load_SubTable ( &st->st.gsub, stream, lookup_type ); @@ -448,7 +448,7 @@ static HB_Error Load_SubTable( HB_SubTable* st, static void Free_SubTable( HB_SubTable* st, HB_Type table_type, - FT_UShort lookup_type ) + HB_UShort lookup_type ) { if ( table_type == HB_Type_GSUB ) _HB_GSUB_Free_SubTable ( &st->st.gsub, lookup_type ); @@ -465,12 +465,12 @@ static HB_Error Load_Lookup( HB_Lookup* l, { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_SubTable* st; - FT_Bool is_extension = FALSE; + HB_Bool is_extension = FALSE; base_offset = FILE_Pos(); @@ -541,7 +541,7 @@ Fail: static void Free_Lookup( HB_Lookup* l, HB_Type type ) { - FT_UShort n, count; + HB_UShort n, count; HB_SubTable* st; @@ -568,8 +568,8 @@ _HB_OPEN_Load_LookupList( HB_LookupList* ll, { HB_Error error; - FT_UShort n, m, count; - FT_ULong cur_offset, new_offset, base_offset; + HB_UShort n, m, count; + HB_UInt cur_offset, new_offset, base_offset; HB_Lookup* l; @@ -587,7 +587,7 @@ _HB_OPEN_Load_LookupList( HB_LookupList* ll, if ( ALLOC_ARRAY( ll->Lookup, count, HB_Lookup ) ) return error; - if ( ALLOC_ARRAY( ll->Properties, count, FT_UInt ) ) + if ( ALLOC_ARRAY( ll->Properties, count, HB_UInt ) ) goto Fail2; l = ll->Lookup; @@ -626,7 +626,7 @@ HB_INTERNAL void _HB_OPEN_Free_LookupList( HB_LookupList* ll, HB_Type type ) { - FT_UShort n, count; + HB_UShort n, count; HB_Lookup* l; @@ -659,9 +659,9 @@ static HB_Error Load_Coverage1( HB_CoverageFormat1* cf1, { HB_Error error; - FT_UShort n, count; + HB_UShort n, count; - FT_UShort* ga; + HB_UShort* ga; if ( ACCESS_Frame( 2L ) ) @@ -673,7 +673,7 @@ static HB_Error Load_Coverage1( HB_CoverageFormat1* cf1, cf1->GlyphArray = NULL; - if ( ALLOC_ARRAY( cf1->GlyphArray, count, FT_UShort ) ) + if ( ALLOC_ARRAY( cf1->GlyphArray, count, HB_UShort ) ) return error; ga = cf1->GlyphArray; @@ -706,7 +706,7 @@ static HB_Error Load_Coverage2( HB_CoverageFormat2* cf2, { HB_Error error; - FT_UShort n, count; + HB_UShort n, count; HB_RangeRecord* rr; @@ -797,12 +797,12 @@ _HB_OPEN_Free_Coverage( HB_Coverage* c ) static HB_Error Coverage_Index1( HB_CoverageFormat1* cf1, - FT_UShort glyphID, - FT_UShort* index ) + HB_UShort glyphID, + HB_UShort* index ) { - FT_UShort min, max, new_min, new_max, middle; + HB_UShort min, max, new_min, new_max, middle; - FT_UShort* array = cf1->GlyphArray; + HB_UShort* array = cf1->GlyphArray; /* binary search */ @@ -847,10 +847,10 @@ static HB_Error Coverage_Index1( HB_CoverageFormat1* cf1, static HB_Error Coverage_Index2( HB_CoverageFormat2* cf2, - FT_UShort glyphID, - FT_UShort* index ) + HB_UShort glyphID, + HB_UShort* index ) { - FT_UShort min, max, new_min, new_max, middle; + HB_UShort min, max, new_min, new_max, middle; HB_RangeRecord* rr = cf2->RangeRecord; @@ -898,8 +898,8 @@ static HB_Error Coverage_Index2( HB_CoverageFormat2* cf2, HB_INTERNAL HB_Error _HB_OPEN_Coverage_Index( HB_Coverage* c, - FT_UShort glyphID, - FT_UShort* index ) + HB_UShort glyphID, + HB_UShort* index ) { switch ( c->CoverageFormat ) { @@ -921,15 +921,15 @@ _HB_OPEN_Coverage_Index( HB_Coverage* c, /* ClassDefFormat1 */ static HB_Error Load_ClassDef1( HB_ClassDefinition* cd, - FT_UShort limit, + HB_UShort limit, FT_Stream stream ) { HB_Error error; - FT_UShort n, count; + HB_UShort n, count; - FT_UShort* cva; - FT_Bool* d; + HB_UShort* cva; + HB_Bool* d; HB_ClassDefFormat1* cdf1; @@ -951,7 +951,7 @@ static HB_Error Load_ClassDef1( HB_ClassDefinition* cd, cdf1->ClassValueArray = NULL; - if ( ALLOC_ARRAY( cdf1->ClassValueArray, count, FT_UShort ) ) + if ( ALLOC_ARRAY( cdf1->ClassValueArray, count, HB_UShort ) ) return error; d = cd->Defined; @@ -991,15 +991,15 @@ static void Free_ClassDef1( HB_ClassDefFormat1* cdf1 ) /* ClassDefFormat2 */ static HB_Error Load_ClassDef2( HB_ClassDefinition* cd, - FT_UShort limit, + HB_UShort limit, FT_Stream stream ) { HB_Error error; - FT_UShort n, count; + HB_UShort n, count; HB_ClassRangeRecord* crr; - FT_Bool* d; + HB_Bool* d; HB_ClassDefFormat2* cdf2; @@ -1070,12 +1070,12 @@ static void Free_ClassDef2( HB_ClassDefFormat2* cdf2 ) HB_INTERNAL HB_Error _HB_OPEN_Load_ClassDefinition( HB_ClassDefinition* cd, - FT_UShort limit, + HB_UShort limit, FT_Stream stream ) { HB_Error error; - if ( ALLOC_ARRAY( cd->Defined, limit, FT_Bool ) ) + if ( ALLOC_ARRAY( cd->Defined, limit, HB_Bool ) ) return error; if ( ACCESS_Frame( 2L ) ) @@ -1110,13 +1110,13 @@ _HB_OPEN_Load_EmptyClassDefinition( HB_ClassDefinition* cd ) { HB_Error error; - if ( ALLOC_ARRAY( cd->Defined, 1, FT_Bool ) ) + if ( ALLOC_ARRAY( cd->Defined, 1, HB_Bool ) ) return error; cd->ClassFormat = 1; /* Meaningless */ cd->Defined[0] = FALSE; - if ( ALLOC_ARRAY( cd->cd.cd1.ClassValueArray, 1, FT_UShort ) ) + if ( ALLOC_ARRAY( cd->cd.cd1.ClassValueArray, 1, HB_UShort ) ) goto Fail; return HB_Err_Ok; @@ -1128,13 +1128,13 @@ Fail: HB_INTERNAL HB_Error _HB_OPEN_Load_EmptyOrClassDefinition( HB_ClassDefinition* cd, - FT_UShort limit, - FT_ULong class_offset, - FT_ULong base_offset, + HB_UShort limit, + HB_UInt class_offset, + HB_UInt base_offset, FT_Stream stream ) { HB_Error error; - FT_ULong cur_offset; + HB_UInt cur_offset; cur_offset = FILE_Pos(); @@ -1170,11 +1170,11 @@ _HB_OPEN_Free_ClassDefinition( HB_ClassDefinition* cd ) static HB_Error Get_Class1( HB_ClassDefFormat1* cdf1, - FT_UShort glyphID, - FT_UShort* klass, - FT_UShort* index ) + HB_UShort glyphID, + HB_UShort* klass, + HB_UShort* index ) { - FT_UShort* cva = cdf1->ClassValueArray; + HB_UShort* cva = cdf1->ClassValueArray; if ( index ) @@ -1198,12 +1198,12 @@ static HB_Error Get_Class1( HB_ClassDefFormat1* cdf1, in case of failure for constructed GDEF tables */ static HB_Error Get_Class2( HB_ClassDefFormat2* cdf2, - FT_UShort glyphID, - FT_UShort* klass, - FT_UShort* index ) + HB_UShort glyphID, + HB_UShort* klass, + HB_UShort* index ) { HB_Error error = HB_Err_Ok; - FT_UShort min, max, new_min, new_max, middle; + HB_UShort min, max, new_min, new_max, middle; HB_ClassRangeRecord* crr = cdf2->ClassRangeRecord; @@ -1269,9 +1269,9 @@ static HB_Error Get_Class2( HB_ClassDefFormat2* cdf2, HB_INTERNAL HB_Error _HB_OPEN_Get_Class( HB_ClassDefinition* cd, - FT_UShort glyphID, - FT_UShort* klass, - FT_UShort* index ) + HB_UShort glyphID, + HB_UShort* klass, + HB_UShort* index ) { switch ( cd->ClassFormat ) { @@ -1296,9 +1296,9 @@ _HB_OPEN_Load_Device( HB_Device* d, { HB_Error error; - FT_UShort n, count; + HB_UShort n, count; - FT_UShort* dv; + HB_UShort* dv; if ( ACCESS_Frame( 6L ) ) @@ -1326,7 +1326,7 @@ _HB_OPEN_Load_Device( HB_Device* d, count = ( ( d->EndSize - d->StartSize + 1 ) >> ( 4 - d->DeltaFormat ) ) + 1; - if ( ALLOC_ARRAY( d->DeltaValue, count, FT_UShort ) ) + if ( ALLOC_ARRAY( d->DeltaValue, count, HB_UShort ) ) return error; if ( ACCESS_Frame( count * 2L ) ) @@ -1390,10 +1390,10 @@ _HB_OPEN_Free_Device( HB_Device* d ) HB_INTERNAL HB_Error _HB_OPEN_Get_Device( HB_Device* d, - FT_UShort size, - FT_Short* value ) + HB_UShort size, + HB_Short* value ) { - FT_UShort byte, bits, mask, f, s; + HB_UShort byte, bits, mask, f, s; f = d->DeltaFormat; @@ -1405,7 +1405,7 @@ _HB_OPEN_Get_Device( HB_Device* d, bits = byte >> ( 16 - ( ( s % ( 1 << ( 4 - f ) ) + 1 ) << f ) ); mask = 0xFFFF >> ( 16 - ( 1 << f ) ); - *value = (FT_Short)( bits & mask ); + *value = (HB_Short)( bits & mask ); /* conversion to a signed value */ diff --git a/src/harfbuzz-open.h b/src/harfbuzz-open.h index 5864405c..73857f86 100644 --- a/src/harfbuzz-open.h +++ b/src/harfbuzz-open.h @@ -16,7 +16,9 @@ #include #include FT_FREETYPE_H -FT_BEGIN_HEADER +#include "harfbuzz-global.h" + +HB_BEGIN_HEADER /* Use this if a feature applies to all glyphs */ #define HB_ALL_GLYPHS 0xFFFF @@ -46,10 +48,10 @@ typedef FT_Error HB_Error; struct HB_LangSys_ { - FT_UShort LookupOrderOffset; /* always 0 for TT Open 1.0 */ - FT_UShort ReqFeatureIndex; /* required FeatureIndex */ - FT_UShort FeatureCount; /* number of Feature indices */ - FT_UShort* FeatureIndex; /* array of Feature indices */ + HB_UShort LookupOrderOffset; /* always 0 for TT Open 1.0 */ + HB_UShort ReqFeatureIndex; /* required FeatureIndex */ + HB_UShort FeatureCount; /* number of Feature indices */ + HB_UShort* FeatureIndex; /* array of Feature indices */ }; typedef struct HB_LangSys_ HB_LangSys; @@ -57,7 +59,7 @@ typedef struct HB_LangSys_ HB_LangSys; struct HB_LangSysRecord_ { - FT_ULong LangSysTag; /* LangSysTag identifier */ + HB_UInt LangSysTag; /* LangSysTag identifier */ HB_LangSys LangSys; /* LangSys table */ }; @@ -67,7 +69,7 @@ typedef struct HB_LangSysRecord_ HB_LangSysRecord; struct HB_Script_ { HB_LangSys DefaultLangSys; /* DefaultLangSys table */ - FT_UShort LangSysCount; /* number of LangSysRecords */ + HB_UShort LangSysCount; /* number of LangSysRecords */ HB_LangSysRecord* LangSysRecord; /* array of LangSysRecords */ }; @@ -76,7 +78,7 @@ typedef struct HB_Script_ HB_Script; struct HB_ScriptRecord_ { - FT_ULong ScriptTag; /* ScriptTag identifier */ + HB_UInt ScriptTag; /* ScriptTag identifier */ HB_Script Script; /* Script table */ }; @@ -85,7 +87,7 @@ typedef struct HB_ScriptRecord_ HB_ScriptRecord; struct HB_ScriptList_ { - FT_UShort ScriptCount; /* number of ScriptRecords */ + HB_UShort ScriptCount; /* number of ScriptRecords */ HB_ScriptRecord* ScriptRecord; /* array of ScriptRecords */ }; @@ -96,9 +98,9 @@ typedef struct HB_ScriptList_ HB_ScriptList; struct HB_Feature_ { - FT_UShort FeatureParams; /* always 0 for TT Open 1.0 */ - FT_UShort LookupListCount; /* number of LookupList indices */ - FT_UShort* LookupListIndex; /* array of LookupList indices */ + HB_UShort FeatureParams; /* always 0 for TT Open 1.0 */ + HB_UShort LookupListCount; /* number of LookupList indices */ + HB_UShort* LookupListIndex; /* array of LookupList indices */ }; typedef struct HB_Feature_ HB_Feature; @@ -106,7 +108,7 @@ typedef struct HB_Feature_ HB_Feature; struct HB_FeatureRecord_ { - FT_ULong FeatureTag; /* FeatureTag identifier */ + HB_UInt FeatureTag; /* FeatureTag identifier */ HB_Feature Feature; /* Feature table */ }; @@ -115,10 +117,10 @@ typedef struct HB_FeatureRecord_ HB_FeatureRecord; struct HB_FeatureList_ { - FT_UShort FeatureCount; /* number of FeatureRecords */ + HB_UShort FeatureCount; /* number of FeatureRecords */ HB_FeatureRecord* FeatureRecord; /* array of FeatureRecords */ - FT_UShort* ApplyOrder; /* order to apply features */ - FT_UShort ApplyCount; /* number of elements in ApplyOrder */ + HB_UShort* ApplyOrder; /* order to apply features */ + HB_UShort ApplyCount; /* number of elements in ApplyOrder */ }; typedef struct HB_FeatureList_ HB_FeatureList; @@ -131,9 +133,9 @@ typedef struct HB_SubTable_ HB_SubTable; struct HB_Lookup_ { - FT_UShort LookupType; /* Lookup type */ - FT_UShort LookupFlag; /* Lookup qualifiers */ - FT_UShort SubTableCount; /* number of SubTables */ + HB_UShort LookupType; /* Lookup type */ + HB_UShort LookupFlag; /* Lookup qualifiers */ + HB_UShort SubTableCount; /* number of SubTables */ HB_SubTable* SubTable; /* array of SubTables */ }; @@ -148,9 +150,9 @@ typedef struct HB_Lookup_ HB_Lookup; struct HB_LookupList_ { - FT_UShort LookupCount; /* number of Lookups */ + HB_UShort LookupCount; /* number of Lookups */ HB_Lookup* Lookup; /* array of Lookup records */ - FT_UInt* Properties; /* array of flags */ + HB_UInt* Properties; /* array of flags */ }; typedef struct HB_LookupList_ HB_LookupList; @@ -171,8 +173,8 @@ typedef struct HB_LookupList_ HB_LookupList; struct HB_CoverageFormat1_ { - FT_UShort GlyphCount; /* number of glyphs in GlyphArray */ - FT_UShort* GlyphArray; /* array of glyph IDs */ + HB_UShort GlyphCount; /* number of glyphs in GlyphArray */ + HB_UShort* GlyphArray; /* array of glyph IDs */ }; typedef struct HB_CoverageFormat1_ HB_CoverageFormat1; @@ -180,9 +182,9 @@ typedef struct HB_CoverageFormat1_ HB_CoverageFormat1; struct HB_RangeRecord_ { - FT_UShort Start; /* first glyph ID in the range */ - FT_UShort End; /* last glyph ID in the range */ - FT_UShort StartCoverageIndex; /* coverage index of first + HB_UShort Start; /* first glyph ID in the range */ + HB_UShort End; /* last glyph ID in the range */ + HB_UShort StartCoverageIndex; /* coverage index of first glyph ID in the range */ }; @@ -191,7 +193,7 @@ typedef struct HB_RangeRecord_ HB_RangeRecord; struct HB_CoverageFormat2_ { - FT_UShort RangeCount; /* number of RangeRecords */ + HB_UShort RangeCount; /* number of RangeRecords */ HB_RangeRecord* RangeRecord; /* array of RangeRecords */ }; @@ -200,7 +202,7 @@ typedef struct HB_CoverageFormat2_ HB_CoverageFormat2; struct HB_Coverage_ { - FT_UShort CoverageFormat; /* 1 or 2 */ + HB_UShort CoverageFormat; /* 1 or 2 */ union { @@ -214,10 +216,10 @@ typedef struct HB_Coverage_ HB_Coverage; struct HB_ClassDefFormat1_ { - FT_UShort StartGlyph; /* first glyph ID of the + HB_UShort StartGlyph; /* first glyph ID of the ClassValueArray */ - FT_UShort GlyphCount; /* size of the ClassValueArray */ - FT_UShort* ClassValueArray; /* array of class values */ + HB_UShort GlyphCount; /* size of the ClassValueArray */ + HB_UShort* ClassValueArray; /* array of class values */ }; typedef struct HB_ClassDefFormat1_ HB_ClassDefFormat1; @@ -225,9 +227,9 @@ typedef struct HB_ClassDefFormat1_ HB_ClassDefFormat1; struct HB_ClassRangeRecord_ { - FT_UShort Start; /* first glyph ID in the range */ - FT_UShort End; /* last glyph ID in the range */ - FT_UShort Class; /* applied to all glyphs in range */ + HB_UShort Start; /* first glyph ID in the range */ + HB_UShort End; /* last glyph ID in the range */ + HB_UShort Class; /* applied to all glyphs in range */ }; typedef struct HB_ClassRangeRecord_ HB_ClassRangeRecord; @@ -235,7 +237,7 @@ typedef struct HB_ClassRangeRecord_ HB_ClassRangeRecord; struct HB_ClassDefFormat2_ { - FT_UShort ClassRangeCount; + HB_UShort ClassRangeCount; /* number of ClassRangeRecords */ HB_ClassRangeRecord* ClassRangeRecord; /* array of ClassRangeRecords */ @@ -251,12 +253,12 @@ typedef struct HB_ClassDefFormat2_ HB_ClassDefFormat2; struct HB_ClassDefinition_ { - FT_Bool loaded; + HB_Bool loaded; - FT_Bool* Defined; /* array of Booleans. + HB_Bool* Defined; /* array of Booleans. If Defined[n] is FALSE, class n contains no glyphs. */ - FT_UShort ClassFormat; /* 1 or 2 */ + HB_UShort ClassFormat; /* 1 or 2 */ union { @@ -270,11 +272,11 @@ typedef struct HB_ClassDefinition_ HB_ClassDefinition; struct HB_Device_ { - FT_UShort StartSize; /* smallest size to correct */ - FT_UShort EndSize; /* largest size to correct */ - FT_UShort DeltaFormat; /* DeltaValue array data format: + HB_UShort StartSize; /* smallest size to correct */ + HB_UShort EndSize; /* largest size to correct */ + HB_UShort DeltaFormat; /* DeltaValue array data format: 1, 2, or 3 */ - FT_UShort* DeltaValue; /* array of compressed data */ + HB_UShort* DeltaValue; /* array of compressed data */ }; typedef struct HB_Device_ HB_Device; @@ -289,6 +291,6 @@ enum HB_Type_ typedef enum HB_Type_ HB_Type; -FT_END_HEADER +HB_END_HEADER #endif /* HARFBUZZ_OPEN_H */ diff --git a/src/harfbuzz.h b/src/harfbuzz.h index e8e08a2a..8bf03be6 100644 --- a/src/harfbuzz.h +++ b/src/harfbuzz.h @@ -13,6 +13,7 @@ #ifndef HARFBUZZ_H #define HARFBUZZ_H +#include "harfbuzz-global.h" #include "harfbuzz-open.h" #include "harfbuzz-buffer.h" #include "harfbuzz-gdef.h" -- GitLab