New header file harfbuzz-global.h. Rename FT_* int types to HB_* types.

2007-10-24  Behdad Esfahbod  <behdad@gnome.org>

        * pango/opentype/*: New header file harfbuzz-global.h.  Rename
        FT_* int types to HB_* types.
This commit is contained in:
Behdad Esfahbod 2007-10-24 22:44:47 +00:00 committed by Behdad Esfahbod
parent 2130d852c7
commit 5716ae278a
24 changed files with 1056 additions and 1016 deletions

View File

@ -19,6 +19,7 @@ INCLUDEDSOURCES = \
PUBLICHEADERS = \ PUBLICHEADERS = \
harfbuzz.h \ harfbuzz.h \
harfbuzz-global.h \
harfbuzz-buffer.h \ harfbuzz-buffer.h \
harfbuzz-gdef.h \ harfbuzz-gdef.h \
harfbuzz-gpos.h \ harfbuzz-gpos.h \

View File

@ -30,7 +30,7 @@ _hb_ftglue_log( const char* format, ... )
/* only used internally */ /* only used internally */
static FT_Pointer static FT_Pointer
_hb_ftglue_qalloc( FT_ULong size, _hb_ftglue_qalloc( HB_UInt size,
HB_Error *perror ) HB_Error *perror )
{ {
HB_Error error = 0; HB_Error error = 0;
@ -52,7 +52,7 @@ _hb_ftglue_qalloc( FT_ULong size,
HB_INTERNAL FT_Pointer HB_INTERNAL FT_Pointer
_hb_ftglue_alloc( FT_ULong size, _hb_ftglue_alloc( HB_UInt size,
HB_Error *perror ) HB_Error *perror )
{ {
HB_Error error = 0; HB_Error error = 0;
@ -74,7 +74,7 @@ _hb_ftglue_alloc( FT_ULong size,
HB_INTERNAL FT_Pointer HB_INTERNAL FT_Pointer
_hb_ftglue_realloc( FT_Pointer block, _hb_ftglue_realloc( FT_Pointer block,
FT_ULong new_size, HB_UInt new_size,
HB_Error *perror ) HB_Error *perror )
{ {
FT_Pointer block2 = NULL; 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 ) _hb_ftglue_stream_pos( FT_Stream stream )
{ {
LOG(( "ftglue:stream:pos() -> %ld\n", stream->pos )); LOG(( "ftglue:stream:pos() -> %ld\n", stream->pos ));
@ -110,7 +110,7 @@ _hb_ftglue_stream_pos( FT_Stream stream )
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_hb_ftglue_stream_seek( FT_Stream stream, _hb_ftglue_stream_seek( FT_Stream stream,
FT_Long pos ) HB_Int pos )
{ {
HB_Error error = 0; HB_Error error = 0;
@ -120,7 +120,7 @@ _hb_ftglue_stream_seek( FT_Stream stream,
if ( stream->read( stream, pos, NULL, 0 ) ) if ( stream->read( stream, pos, NULL, 0 ) )
error = HB_Err_Invalid_Stream_Operation; 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; error = HB_Err_Invalid_Stream_Operation;
LOG(( "ftglue:stream:seek(%ld) -> %d\n", pos, error )); 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_INTERNAL HB_Error
_hb_ftglue_stream_frame_enter( FT_Stream stream, _hb_ftglue_stream_frame_enter( FT_Stream stream,
FT_ULong count ) HB_UInt count )
{ {
HB_Error error = HB_Err_Ok; HB_Error error = HB_Err_Ok;
FT_ULong read_bytes; HB_UInt read_bytes;
if ( stream->read ) if ( stream->read )
{ {
@ -192,7 +192,7 @@ _hb_ftglue_stream_frame_exit( FT_Stream stream )
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_hb_ftglue_face_goto_table( FT_Face face, _hb_ftglue_face_goto_table( FT_Face face,
FT_ULong the_tag, HB_UInt the_tag,
FT_Stream stream ) FT_Stream stream )
{ {
HB_Error error; HB_Error error;
@ -215,8 +215,8 @@ _hb_ftglue_face_goto_table( FT_Face face,
/* parse the directory table directly, without using /* parse the directory table directly, without using
* FreeType's built-in data structures * FreeType's built-in data structures
*/ */
FT_ULong offset = 0; HB_UInt offset = 0;
FT_UInt count, nn; HB_UInt count, nn;
if ( face->num_faces > 1 ) if ( face->num_faces > 1 )
{ {
@ -248,10 +248,10 @@ _hb_ftglue_face_goto_table( FT_Face face,
for ( nn = 0; nn < count; nn++ ) for ( nn = 0; nn < count; nn++ )
{ {
FT_ULong tag = GET_ULong(); HB_UInt tag = GET_ULong();
FT_ULong checksum = GET_ULong(); HB_UInt checksum = GET_ULong();
FT_ULong start = GET_ULong(); HB_UInt start = GET_ULong();
FT_ULong size = GET_ULong(); HB_UInt size = GET_ULong();
FT_UNUSED(checksum); FT_UNUSED(checksum);
FT_UNUSED(size); FT_UNUSED(size);

View File

@ -46,10 +46,10 @@
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#include "harfbuzz-impl.h"
#include "harfbuzz-open.h" #include "harfbuzz-open.h"
#include "harfbuzz-impl.h"
FT_BEGIN_HEADER HB_BEGIN_HEADER
/* utility macros */ /* utility macros */
@ -67,11 +67,11 @@ FT_BEGIN_HEADER
#define FORGET_Frame() _hb_ftglue_stream_frame_exit( stream ) #define FORGET_Frame() _hb_ftglue_stream_frame_exit( stream )
#define GET_Byte() (*stream->cursor++) #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)-2) << 8) | \
*(((FT_Byte*)stream->cursor)-1) \ *(((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)-4) << 24) | \
(*(((FT_Byte*)stream->cursor)-3) << 16) | \ (*(((FT_Byte*)stream->cursor)-3) << 16) | \
(*(((FT_Byte*)stream->cursor)-2) << 8) | \ (*(((FT_Byte*)stream->cursor)-2) << 8) | \
@ -80,27 +80,27 @@ FT_BEGIN_HEADER
#define GET_Char() ((FT_Char)GET_Byte()) #define GET_Char() ((FT_Char)GET_Byte())
#define GET_UShort() ((FT_UShort)GET_Short()) #define GET_UShort() ((HB_UShort)GET_Short())
#define GET_ULong() ((FT_ULong)GET_Long()) #define GET_ULong() ((HB_UInt)GET_Long())
#define GET_Tag4() GET_ULong() #define GET_Tag4() GET_ULong()
HB_INTERNAL FT_Long HB_INTERNAL HB_Int
_hb_ftglue_stream_pos( FT_Stream stream ); _hb_ftglue_stream_pos( FT_Stream stream );
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_hb_ftglue_stream_seek( FT_Stream stream, _hb_ftglue_stream_seek( FT_Stream stream,
FT_Long pos ); HB_Int pos );
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_hb_ftglue_stream_frame_enter( FT_Stream stream, _hb_ftglue_stream_frame_enter( FT_Stream stream,
FT_ULong size ); HB_UInt size );
HB_INTERNAL void HB_INTERNAL void
_hb_ftglue_stream_frame_exit( FT_Stream stream ); _hb_ftglue_stream_frame_exit( FT_Stream stream );
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_hb_ftglue_face_goto_table( FT_Face face, _hb_ftglue_face_goto_table( FT_Face face,
FT_ULong tag, HB_UInt tag,
FT_Stream stream ); FT_Stream stream );
/* memory macros used by the OpenType parser */ /* memory macros used by the OpenType parser */
@ -129,12 +129,12 @@ _hb_ftglue_face_goto_table( FT_Face face,
HB_INTERNAL FT_Pointer HB_INTERNAL FT_Pointer
_hb_ftglue_alloc( FT_ULong size, _hb_ftglue_alloc( HB_UInt size,
HB_Error *perror_ ); HB_Error *perror_ );
HB_INTERNAL FT_Pointer HB_INTERNAL FT_Pointer
_hb_ftglue_realloc( FT_Pointer block, _hb_ftglue_realloc( FT_Pointer block,
FT_ULong new_size, HB_UInt new_size,
HB_Error *perror_ ); HB_Error *perror_ );
HB_INTERNAL void HB_INTERNAL void
@ -146,6 +146,6 @@ _hb_ftglue_free( FT_Pointer block );
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_hb_err (HB_Error code); _hb_err (HB_Error code);
FT_END_HEADER HB_END_HEADER
#endif /* FTGLUE_H */ #endif /* FTGLUE_H */

View File

@ -17,7 +17,7 @@
#include "harfbuzz-impl.h" #include "harfbuzz-impl.h"
#include "harfbuzz-buffer.h" #include "harfbuzz-buffer.h"
FT_BEGIN_HEADER HB_BEGIN_HEADER
#define HB_GLYPH_PROPERTIES_UNKNOWN 0xFFFF #define HB_GLYPH_PROPERTIES_UNKNOWN 0xFFFF
@ -32,29 +32,29 @@ _hb_buffer_clear_positions( HB_Buffer buffer );
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_hb_buffer_add_output_glyphs( HB_Buffer buffer, _hb_buffer_add_output_glyphs( HB_Buffer buffer,
FT_UShort num_in, HB_UShort num_in,
FT_UShort num_out, HB_UShort num_out,
FT_UShort *glyph_data, HB_UShort *glyph_data,
FT_UShort component, HB_UShort component,
FT_UShort ligID ); HB_UShort ligID );
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_hb_buffer_add_output_glyph ( HB_Buffer buffer, _hb_buffer_add_output_glyph ( HB_Buffer buffer,
FT_UInt glyph_index, HB_UInt glyph_index,
FT_UShort component, HB_UShort component,
FT_UShort ligID ); HB_UShort ligID );
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_hb_buffer_copy_output_glyph ( HB_Buffer buffer ); _hb_buffer_copy_output_glyph ( HB_Buffer buffer );
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_hb_buffer_replace_output_glyph ( HB_Buffer buffer, _hb_buffer_replace_output_glyph ( HB_Buffer buffer,
FT_UInt glyph_index, HB_UInt glyph_index,
FT_Bool inplace ); HB_Bool inplace );
HB_INTERNAL FT_UShort HB_INTERNAL HB_UShort
_hb_buffer_allocate_ligid( HB_Buffer buffer ); _hb_buffer_allocate_ligid( HB_Buffer buffer );
FT_END_HEADER HB_END_HEADER
#endif /* HARFBUZZ_BUFFER_PRIVATE_H */ #endif /* HARFBUZZ_BUFFER_PRIVATE_H */

View File

@ -42,9 +42,9 @@
static HB_Error static HB_Error
hb_buffer_ensure( HB_Buffer buffer, 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) if (size > new_allocated)
{ {
@ -151,9 +151,9 @@ hb_buffer_clear( HB_Buffer buffer )
HB_Error HB_Error
hb_buffer_add_glyph( HB_Buffer buffer, hb_buffer_add_glyph( HB_Buffer buffer,
FT_UInt glyph_index, HB_UInt glyph_index,
FT_UInt properties, HB_UInt properties,
FT_UInt cluster ) HB_UInt cluster )
{ {
HB_Error error; HB_Error error;
HB_GlyphItem glyph; HB_GlyphItem glyph;
@ -247,16 +247,16 @@ _hb_buffer_swap( HB_Buffer buffer )
for all replacement glyphs */ for all replacement glyphs */
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_hb_buffer_add_output_glyphs( HB_Buffer buffer, _hb_buffer_add_output_glyphs( HB_Buffer buffer,
FT_UShort num_in, HB_UShort num_in,
FT_UShort num_out, HB_UShort num_out,
FT_UShort *glyph_data, HB_UShort *glyph_data,
FT_UShort component, HB_UShort component,
FT_UShort ligID ) HB_UShort ligID )
{ {
HB_Error error; HB_Error error;
FT_UShort i; HB_UShort i;
FT_UInt properties; HB_UInt properties;
FT_UInt cluster; HB_UInt cluster;
error = hb_buffer_ensure( buffer, buffer->out_pos + num_out ); error = hb_buffer_ensure( buffer, buffer->out_pos + num_out );
if ( error ) if ( error )
@ -298,11 +298,11 @@ _hb_buffer_add_output_glyphs( HB_Buffer buffer,
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_hb_buffer_add_output_glyph( HB_Buffer buffer, _hb_buffer_add_output_glyph( HB_Buffer buffer,
FT_UInt glyph_index, HB_UInt glyph_index,
FT_UShort component, HB_UShort component,
FT_UShort ligID ) HB_UShort ligID )
{ {
FT_UShort glyph_data = glyph_index; HB_UShort glyph_data = glyph_index;
return _hb_buffer_add_output_glyphs ( buffer, 1, 1, return _hb_buffer_add_output_glyphs ( buffer, 1, 1,
&glyph_data, component, ligID ); &glyph_data, component, ligID );
@ -331,8 +331,8 @@ _hb_buffer_copy_output_glyph ( HB_Buffer buffer )
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_hb_buffer_replace_output_glyph( HB_Buffer buffer, _hb_buffer_replace_output_glyph( HB_Buffer buffer,
FT_UInt glyph_index, HB_UInt glyph_index,
FT_Bool inplace ) HB_Bool inplace )
{ {
HB_Error error; HB_Error error;
@ -353,7 +353,7 @@ _hb_buffer_replace_output_glyph( HB_Buffer buffer,
return HB_Err_Ok; return HB_Err_Ok;
} }
HB_INTERNAL FT_UShort HB_INTERNAL HB_UShort
_hb_buffer_allocate_ligid( HB_Buffer buffer ) _hb_buffer_allocate_ligid( HB_Buffer buffer )
{ {
buffer->max_ligID++; buffer->max_ligID++;

View File

@ -17,15 +17,15 @@
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
FT_BEGIN_HEADER HB_BEGIN_HEADER
typedef struct HB_GlyphItemRec_ { typedef struct HB_GlyphItemRec_ {
FT_UInt gindex; HB_UInt gindex;
FT_UInt properties; HB_UInt properties;
FT_UInt cluster; HB_UInt cluster;
FT_UShort component; HB_UShort component;
FT_UShort ligID; HB_UShort ligID;
FT_UShort gproperties; HB_UShort gproperties;
} HB_GlyphItemRec, *HB_GlyphItem; } HB_GlyphItemRec, *HB_GlyphItem;
typedef struct HB_PositionRec_ { typedef struct HB_PositionRec_ {
@ -33,32 +33,32 @@ typedef struct HB_PositionRec_ {
FT_Pos y_pos; FT_Pos y_pos;
FT_Pos x_advance; FT_Pos x_advance;
FT_Pos y_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 */ 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 absolute, i.e., they won't be
added to the original glyph's value added to the original glyph's value
but rather replace them. */ 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 may be positive or negative; used
only internally */ only internally */
} HB_PositionRec, *HB_Position; } HB_PositionRec, *HB_Position;
typedef struct HB_BufferRec_{ typedef struct HB_BufferRec_{
FT_ULong allocated; HB_UInt allocated;
FT_ULong in_length; HB_UInt in_length;
FT_ULong out_length; HB_UInt out_length;
FT_ULong in_pos; HB_UInt in_pos;
FT_ULong out_pos; HB_UInt out_pos;
FT_Bool separate_out; HB_Bool separate_out;
HB_GlyphItem in_string; HB_GlyphItem in_string;
HB_GlyphItem out_string; HB_GlyphItem out_string;
HB_GlyphItem alt_string; HB_GlyphItem alt_string;
HB_Position positions; HB_Position positions;
FT_UShort max_ligID; HB_UShort max_ligID;
} HB_BufferRec, *HB_Buffer; } HB_BufferRec, *HB_Buffer;
HB_Error HB_Error
@ -72,10 +72,10 @@ hb_buffer_clear( HB_Buffer buffer );
HB_Error HB_Error
hb_buffer_add_glyph( HB_Buffer buffer, hb_buffer_add_glyph( HB_Buffer buffer,
FT_UInt glyph_index, HB_UInt glyph_index,
FT_UInt properties, HB_UInt properties,
FT_UInt cluster ); HB_UInt cluster );
FT_END_HEADER HB_END_HEADER
#endif /* HARFBUZZ_BUFFER_H */ #endif /* HARFBUZZ_BUFFER_H */

View File

@ -44,7 +44,7 @@ enum {
}; };
static void static void
print_tag (FT_ULong tag) print_tag (HB_UInt tag)
{ {
fprintf (stderr, "%c%c%c%c", fprintf (stderr, "%c%c%c%c",
(unsigned char)(tag >> 24), (unsigned char)(tag >> 24),
@ -55,12 +55,12 @@ print_tag (FT_ULong tag)
static void static void
maybe_add_feature (HB_GSUB gsub, maybe_add_feature (HB_GSUB gsub,
FT_UShort script_index, HB_UShort script_index,
FT_ULong tag, HB_UInt tag,
FT_UShort property) HB_UShort property)
{ {
HB_Error error; HB_Error error;
FT_UShort feature_index; HB_UShort feature_index;
/* 0xffff == default language system */ /* 0xffff == default language system */
error = HB_GSUB_Select_Feature (gsub, tag, script_index, 0xffff, &feature_index); error = HB_GSUB_Select_Feature (gsub, tag, script_index, 0xffff, &feature_index);
@ -84,7 +84,7 @@ maybe_add_feature (HB_GSUB gsub,
static void static void
select_cmap (FT_Face face) select_cmap (FT_Face face)
{ {
FT_UShort i; HB_UShort i;
FT_CharMap cmap = NULL; FT_CharMap cmap = NULL;
for (i = 0; i < face->num_charmaps; i++) for (i = 0; i < face->num_charmaps; i++)
@ -123,8 +123,8 @@ static void
add_features (HB_GSUB gsub) add_features (HB_GSUB gsub)
{ {
HB_Error error; HB_Error error;
FT_ULong tag = FT_MAKE_TAG ('a', 'r', 'a', 'b'); HB_UInt tag = FT_MAKE_TAG ('a', 'r', 'a', 'b');
FT_UShort script_index; HB_UShort script_index;
error = HB_GSUB_Select_Script (gsub, tag, &script_index); error = HB_GSUB_Select_Script (gsub, tag, &script_index);
@ -150,7 +150,7 @@ add_features (HB_GSUB gsub)
void void
dump_string (HB_GSUB_String *str) dump_string (HB_GSUB_String *str)
{ {
FT_ULong i; HB_UInt i;
fprintf (stderr, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); fprintf (stderr, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
for (i = 0; i < str->length; i++) for (i = 0; i < str->length; i++)
@ -165,8 +165,8 @@ dump_string (HB_GSUB_String *str)
fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
} }
FT_UShort arabic_str[] = { 0x645, 0x643, 0x64a, 0x644, 0x639, 0x20, 0x645, 0x627, 0x644, 0x633, 0x644, 0x627 }; HB_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_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 void
try_string (FT_Library library, try_string (FT_Library library,
@ -176,7 +176,7 @@ try_string (FT_Library library,
HB_Error error; HB_Error error;
HB_GSUB_String *in_str; HB_GSUB_String *in_str;
HB_GSUB_String *out_str; HB_GSUB_String *out_str;
FT_ULong i; HB_UInt i;
if ((error = HB_GSUB_String_New (face->memory, &in_str))) if ((error = HB_GSUB_String_New (face->memory, &in_str)))
croak ("HB_GSUB_String_New", error); croak ("HB_GSUB_String_New", error);

View File

@ -61,7 +61,7 @@ dump (FILE *stream, int indent, const char *format, ...)
} }
static void 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; int i;
@ -74,7 +74,7 @@ Dump_UShort_Array (FT_UShort *array, int count, const char *name, FILE *stream,
} }
static void static void
Print_Tag (FT_ULong tag, FILE *stream) Print_Tag (HB_UInt tag, FILE *stream)
{ {
fprintf (stream, "%c%c%c%c", fprintf (stream, "%c%c%c%c",
(unsigned char)(tag >> 24), (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++) for (i = Device->StartSize; i <= Device->EndSize ; i++)
{ {
FT_UShort val = Device->DeltaValue[i / n_per]; HB_UShort val = Device->DeltaValue[i / n_per];
FT_Short signed_val = ((val << ((i % n_per) * bits)) & mask); HB_Short signed_val = ((val << ((i % n_per) * bits)) & mask);
dump (stream, indent, "%d", signed_val >> (16 - bits)); dump (stream, indent, "%d", signed_val >> (16 - bits));
if (i != Device->EndSize) if (i != Device->EndSize)
DUMP (", "); DUMP (", ");
@ -502,7 +502,7 @@ Dump_Device (HB_Device *Device, FILE *stream, int indent, HB_Type hb_type)
} }
static void 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) if (value_format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT)
DUMP_FINT (ValueRecord, XPlacement); DUMP_FINT (ValueRecord, XPlacement);
@ -555,7 +555,7 @@ Dump_GPOS_Lookup_Single (HB_SubTable *subtable, FILE *stream, int indent, HB_Typ
} }
static void 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_FUINT (PairValueRecord, SecondGlyph);
DUMP_VALUE_RECORD (&PairValueRecord->Value1, ValueFormat1); DUMP_VALUE_RECORD (&PairValueRecord->Value1, ValueFormat1);
@ -563,7 +563,7 @@ Dump_PairValueRecord (HB_PairValueRecord *PairValueRecord, FILE *stream, int ind
} }
static void 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; int i;
DUMP_FUINT (PairSet, PairValueCount); DUMP_FUINT (PairSet, PairValueCount);

View File

@ -24,11 +24,11 @@
#include "harfbuzz-gsub.h" #include "harfbuzz-gsub.h"
#include "harfbuzz-gpos.h" #include "harfbuzz-gpos.h"
FT_BEGIN_HEADER HB_BEGIN_HEADER
void HB_Dump_GSUB_Table (HB_GSUB gsub, FILE *stream); void HB_Dump_GSUB_Table (HB_GSUB gsub, FILE *stream);
void HB_Dump_GPOS_Table (HB_GPOS gpos, FILE *stream); void HB_Dump_GPOS_Table (HB_GPOS gpos, FILE *stream);
FT_END_HEADER HB_END_HEADER
#endif /* HARFBUZZ_DUMP_H */ #endif /* HARFBUZZ_DUMP_H */

View File

@ -17,22 +17,22 @@
#include "harfbuzz-gdef.h" #include "harfbuzz-gdef.h"
#include "harfbuzz-buffer.h" #include "harfbuzz-buffer.h"
FT_BEGIN_HEADER HB_BEGIN_HEADER
/* Attachment related structures */ /* Attachment related structures */
struct HB_AttachPoint_ struct HB_AttachPoint_
{ {
FT_UShort PointCount; /* size of the PointIndex array */ HB_UShort PointCount; /* size of the PointIndex array */
FT_UShort* PointIndex; /* array of contour points */ HB_UShort* PointIndex; /* array of contour points */
}; };
/* Ligature Caret related structures */ /* Ligature Caret related structures */
struct HB_CaretValueFormat1_ 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; typedef struct HB_CaretValueFormat1_ HB_CaretValueFormat1;
@ -40,7 +40,7 @@ typedef struct HB_CaretValueFormat1_ HB_CaretValueFormat1;
struct HB_CaretValueFormat2_ 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; typedef struct HB_CaretValueFormat2_ HB_CaretValueFormat2;
@ -48,7 +48,7 @@ typedef struct HB_CaretValueFormat2_ HB_CaretValueFormat2;
struct HB_CaretValueFormat3_ 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 */ HB_Device Device; /* Device table for x or y value */
}; };
@ -57,7 +57,7 @@ typedef struct HB_CaretValueFormat3_ HB_CaretValueFormat3;
struct HB_CaretValueFormat4_ struct HB_CaretValueFormat4_
{ {
FT_UShort IdCaretValue; /* metric ID */ HB_UShort IdCaretValue; /* metric ID */
}; };
typedef struct HB_CaretValueFormat4_ HB_CaretValueFormat4; typedef struct HB_CaretValueFormat4_ HB_CaretValueFormat4;
@ -65,7 +65,7 @@ typedef struct HB_CaretValueFormat4_ HB_CaretValueFormat4;
struct HB_CaretValue_ struct HB_CaretValue_
{ {
FT_UShort CaretValueFormat; /* 1, 2, 3, or 4 */ HB_UShort CaretValueFormat; /* 1, 2, 3, or 4 */
union union
{ {
@ -81,24 +81,24 @@ typedef struct HB_CaretValue_ HB_CaretValue;
struct HB_LigGlyph_ 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_CaretValue* CaretValue; /* array of caret values */
}; };
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_HB_GDEF_Add_Glyph_Property( HB_GDEFHeader* gdef, _HB_GDEF_Add_Glyph_Property( HB_GDEFHeader* gdef,
FT_UShort glyphID, HB_UShort glyphID,
FT_UShort property ); HB_UShort property );
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_HB_GDEF_Check_Property( HB_GDEFHeader* gdef, _HB_GDEF_Check_Property( HB_GDEFHeader* gdef,
HB_GlyphItem item, HB_GlyphItem item,
FT_UShort flags, HB_UShort flags,
FT_UShort* property ); HB_UShort* property );
FT_END_HEADER HB_END_HEADER
#endif /* HARFBUZZ_GDEF_PRIVATE_H */ #endif /* HARFBUZZ_GDEF_PRIVATE_H */

View File

@ -158,7 +158,7 @@ HB_Error HB_Load_GDEF_Table( FT_Face face,
{ {
HB_Error error; HB_Error error;
FT_Stream stream = face->stream; FT_Stream stream = face->stream;
FT_ULong cur_offset, new_offset, base_offset; HB_UInt cur_offset, new_offset, base_offset;
HB_GDEFHeader* gdef; HB_GDEFHeader* gdef;
@ -303,8 +303,8 @@ static HB_Error Load_AttachPoint( HB_AttachPoint* ap,
{ {
HB_Error error; HB_Error error;
FT_UShort n, count; HB_UShort n, count;
FT_UShort* pi; HB_UShort* pi;
if ( ACCESS_Frame( 2L ) ) if ( ACCESS_Frame( 2L ) )
@ -318,7 +318,7 @@ static HB_Error Load_AttachPoint( HB_AttachPoint* ap,
if ( count ) if ( count )
{ {
if ( ALLOC_ARRAY( ap->PointIndex, count, FT_UShort ) ) if ( ALLOC_ARRAY( ap->PointIndex, count, HB_UShort ) )
return error; return error;
pi = ap->PointIndex; pi = ap->PointIndex;
@ -352,8 +352,8 @@ static HB_Error Load_AttachList( HB_AttachList* al,
{ {
HB_Error error; HB_Error error;
FT_UShort n, m, count; HB_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset; HB_UInt cur_offset, new_offset, base_offset;
HB_AttachPoint* ap; HB_AttachPoint* ap;
@ -421,7 +421,7 @@ Fail2:
static void Free_AttachList( HB_AttachList* al ) static void Free_AttachList( HB_AttachList* al )
{ {
FT_UShort n, count; HB_UShort n, count;
HB_AttachPoint* ap; HB_AttachPoint* ap;
@ -460,7 +460,7 @@ static HB_Error Load_CaretValue( HB_CaretValue* cv,
{ {
HB_Error error; HB_Error error;
FT_ULong cur_offset, new_offset, base_offset; HB_UInt cur_offset, new_offset, base_offset;
base_offset = FILE_Pos(); base_offset = FILE_Pos();
@ -544,8 +544,8 @@ static HB_Error Load_LigGlyph( HB_LigGlyph* lg,
{ {
HB_Error error; HB_Error error;
FT_UShort n, m, count; HB_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset; HB_UInt cur_offset, new_offset, base_offset;
HB_CaretValue* cv; HB_CaretValue* cv;
@ -595,7 +595,7 @@ Fail:
static void Free_LigGlyph( HB_LigGlyph* lg ) static void Free_LigGlyph( HB_LigGlyph* lg )
{ {
FT_UShort n, count; HB_UShort n, count;
HB_CaretValue* cv; HB_CaretValue* cv;
@ -620,8 +620,8 @@ static HB_Error Load_LigCaretList( HB_LigCaretList* lcl,
{ {
HB_Error error; HB_Error error;
FT_UShort m, n, count; HB_UShort m, n, count;
FT_ULong cur_offset, new_offset, base_offset; HB_UInt cur_offset, new_offset, base_offset;
HB_LigGlyph* lg; HB_LigGlyph* lg;
@ -689,7 +689,7 @@ Fail2:
static void Free_LigCaretList( HB_LigCaretList* lcl ) static void Free_LigCaretList( HB_LigCaretList* lcl )
{ {
FT_UShort n, count; HB_UShort n, count;
HB_LigGlyph* lg; HB_LigGlyph* lg;
@ -718,15 +718,15 @@ static void Free_LigCaretList( HB_LigCaretList* lcl )
***********/ ***********/
static FT_UShort Get_New_Class( HB_GDEFHeader* gdef, static HB_UShort Get_New_Class( HB_GDEFHeader* gdef,
FT_UShort glyphID, HB_UShort glyphID,
FT_UShort index ) HB_UShort index )
{ {
FT_UShort glyph_index, array_index, count; HB_UShort glyph_index, array_index, count;
FT_UShort byte, bits; HB_UShort byte, bits;
HB_ClassRangeRecord* gcrr; HB_ClassRangeRecord* gcrr;
FT_UShort** ngc; HB_UShort** ngc;
if ( glyphID >= gdef->LastGlyph ) 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, HB_Error HB_GDEF_Get_Glyph_Property( HB_GDEFHeader* gdef,
FT_UShort glyphID, HB_UShort glyphID,
FT_UShort* property ) HB_UShort* property )
{ {
FT_UShort class = 0, index = 0; /* shut compiler up */ HB_UShort class = 0, index = 0; /* shut compiler up */
HB_Error error; 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, static HB_Error Make_ClassRange( HB_ClassDefinition* cd,
FT_UShort start, HB_UShort start,
FT_UShort end, HB_UShort end,
FT_UShort class ) HB_UShort class )
{ {
HB_Error error; HB_Error error;
FT_UShort index; HB_UShort index;
HB_ClassDefFormat2* cdf2; HB_ClassDefFormat2* cdf2;
HB_ClassRangeRecord* crr; HB_ClassRangeRecord* crr;
@ -858,18 +858,18 @@ static HB_Error Make_ClassRange( HB_ClassDefinition* cd,
HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef, HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef,
FT_UShort num_glyphs, HB_UShort num_glyphs,
FT_UShort glyph_count, HB_UShort glyph_count,
FT_UShort* glyph_array, HB_UShort* glyph_array,
FT_UShort* class_array ) HB_UShort* class_array )
{ {
FT_UShort start, curr_glyph, curr_class; HB_UShort start, curr_glyph, curr_class;
FT_UShort n, m, count; HB_UShort n, m, count;
HB_Error error; HB_Error error;
HB_ClassDefinition* gcd; HB_ClassDefinition* gcd;
HB_ClassRangeRecord* gcrr; HB_ClassRangeRecord* gcrr;
FT_UShort** ngc; HB_UShort** ngc;
if ( !gdef || !glyph_array || !class_array ) 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 */ /* 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; return error;
gcd->cd.cd2.ClassRangeCount = 0; gcd->cd.cd2.ClassRangeCount = 0;
@ -970,7 +970,7 @@ HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef,
process */ process */
if ( ALLOC_ARRAY( gdef->NewGlyphClasses, if ( ALLOC_ARRAY( gdef->NewGlyphClasses,
gcd->cd.cd2.ClassRangeCount + 1, FT_UShort* ) ) gcd->cd.cd2.ClassRangeCount + 1, HB_UShort* ) )
goto Fail3; goto Fail3;
count = gcd->cd.cd2.ClassRangeCount; count = gcd->cd.cd2.ClassRangeCount;
@ -984,7 +984,7 @@ HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef,
{ {
if ( gcrr[0].Start ) 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; 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 ( gcrr[n].Start - gcrr[n - 1].End > 1 )
if ( ALLOC_ARRAY( ngc[n], if ( ALLOC_ARRAY( ngc[n],
( gcrr[n].Start - gcrr[n - 1].End + 2 ) / 4, ( gcrr[n].Start - gcrr[n - 1].End + 2 ) / 4,
FT_UShort ) ) HB_UShort ) )
goto Fail1; goto Fail1;
} }
@ -1001,7 +1001,7 @@ HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef,
{ {
if ( ALLOC_ARRAY( ngc[count], if ( ALLOC_ARRAY( ngc[count],
( num_glyphs - gcrr[count - 1].End + 2 ) / 4, ( num_glyphs - gcrr[count - 1].End + 2 ) / 4,
FT_UShort ) ) HB_UShort ) )
goto Fail1; goto Fail1;
} }
} }
@ -1009,7 +1009,7 @@ HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef,
{ {
if ( ALLOC_ARRAY( ngc[count], if ( ALLOC_ARRAY( ngc[count],
( num_glyphs + 3 ) / 4, ( num_glyphs + 3 ) / 4,
FT_UShort ) ) HB_UShort ) )
goto Fail2; goto Fail2;
} }
@ -1040,8 +1040,8 @@ Fail4:
static void Free_NewGlyphClasses( HB_GDEFHeader* gdef ) static void Free_NewGlyphClasses( HB_GDEFHeader* gdef )
{ {
FT_UShort** ngc; HB_UShort** ngc;
FT_UShort n, count; HB_UShort n, count;
if ( gdef->NewGlyphClasses ) if ( gdef->NewGlyphClasses )
@ -1059,16 +1059,16 @@ static void Free_NewGlyphClasses( HB_GDEFHeader* gdef )
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_HB_GDEF_Add_Glyph_Property( HB_GDEFHeader* gdef, _HB_GDEF_Add_Glyph_Property( HB_GDEFHeader* gdef,
FT_UShort glyphID, HB_UShort glyphID,
FT_UShort property ) HB_UShort property )
{ {
HB_Error error; HB_Error error;
FT_UShort class, new_class, index = 0; /* shut compiler up */ HB_UShort class, new_class, index = 0; /* shut compiler up */
FT_UShort byte, bits, mask; HB_UShort byte, bits, mask;
FT_UShort array_index, glyph_index, count; HB_UShort array_index, glyph_index, count;
HB_ClassRangeRecord* gcrr; HB_ClassRangeRecord* gcrr;
FT_UShort** ngc; HB_UShort** ngc;
error = _HB_OPEN_Get_Class( &gdef->GlyphClassDef, glyphID, &class, &index ); 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_INTERNAL HB_Error
_HB_GDEF_Check_Property( HB_GDEFHeader* gdef, _HB_GDEF_Check_Property( HB_GDEFHeader* gdef,
HB_GlyphItem gitem, HB_GlyphItem gitem,
FT_UShort flags, HB_UShort flags,
FT_UShort* property ) HB_UShort* property )
{ {
HB_Error error; HB_Error error;
if ( gdef ) if ( gdef )
{ {
FT_UShort basic_glyph_class; HB_UShort basic_glyph_class;
FT_UShort desired_attachment_class; HB_UShort desired_attachment_class;
if ( gitem->gproperties == HB_GLYPH_PROPERTIES_UNKNOWN ) if ( gitem->gproperties == HB_GLYPH_PROPERTIES_UNKNOWN )
{ {

View File

@ -15,7 +15,7 @@
#include "harfbuzz-open.h" #include "harfbuzz-open.h"
FT_BEGIN_HEADER HB_BEGIN_HEADER
#define HB_Err_Invalid_GDEF_SubTable_Format 0x1030 #define HB_Err_Invalid_GDEF_SubTable_Format 0x1030
#define HB_Err_Invalid_GDEF_SubTable 0x1031 #define HB_Err_Invalid_GDEF_SubTable 0x1031
@ -34,10 +34,10 @@ typedef struct HB_AttachPoint_ HB_AttachPoint;
struct HB_AttachList_ struct HB_AttachList_
{ {
FT_Bool loaded; HB_Bool loaded;
HB_Coverage Coverage; /* Coverage table */ HB_Coverage Coverage; /* Coverage table */
FT_UShort GlyphCount; /* number of glyphs with HB_UShort GlyphCount; /* number of glyphs with
attachments */ attachments */
HB_AttachPoint* AttachPoint; /* array of AttachPoint tables */ HB_AttachPoint* AttachPoint; /* array of AttachPoint tables */
}; };
@ -48,10 +48,10 @@ typedef struct HB_LigGlyph_ HB_LigGlyph;
struct HB_LigCaretList_ struct HB_LigCaretList_
{ {
FT_Bool loaded; HB_Bool loaded;
HB_Coverage Coverage; /* Coverage table */ 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 */ HB_LigGlyph* LigGlyph; /* array of LigGlyph tables */
}; };
@ -81,18 +81,18 @@ typedef struct HB_LigCaretList_ HB_LigCaretList;
struct HB_GDEFHeader_ struct HB_GDEFHeader_
{ {
FT_ULong offset; HB_UInt offset;
FT_Fixed Version; FT_Fixed Version;
HB_ClassDefinition GlyphClassDef; HB_ClassDefinition GlyphClassDef;
HB_AttachList AttachList; HB_AttachList AttachList;
HB_LigCaretList LigCaretList; HB_LigCaretList LigCaretList;
FT_ULong MarkAttachClassDef_offset; HB_UInt MarkAttachClassDef_offset;
HB_ClassDefinition MarkAttachClassDef; /* new in OT 1.2 */ HB_ClassDefinition MarkAttachClassDef; /* new in OT 1.2 */
FT_UShort LastGlyph; HB_UShort LastGlyph;
FT_UShort** NewGlyphClasses; HB_UShort** NewGlyphClasses;
}; };
typedef struct HB_GDEFHeader_ HB_GDEFHeader; 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, HB_Error HB_GDEF_Get_Glyph_Property( HB_GDEFHeader* gdef,
FT_UShort glyphID, HB_UShort glyphID,
FT_UShort* property ); HB_UShort* property );
HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef, HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef,
FT_UShort num_glyphs, HB_UShort num_glyphs,
FT_UShort glyph_count, HB_UShort glyph_count,
FT_UShort* glyph_array, HB_UShort* glyph_array,
FT_UShort* class_array ); HB_UShort* class_array );
FT_END_HEADER HB_END_HEADER
#endif /* HARFBUZZ_GDEF_H */ #endif /* HARFBUZZ_GDEF_H */

34
src/harfbuzz-global.h Normal file
View File

@ -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

View File

@ -16,20 +16,20 @@
#include "harfbuzz-impl.h" #include "harfbuzz-impl.h"
#include "harfbuzz-gpos.h" #include "harfbuzz-gpos.h"
FT_BEGIN_HEADER HB_BEGIN_HEADER
/* shared tables */ /* shared tables */
struct HB_ValueRecord_ struct HB_ValueRecord_
{ {
FT_Short XPlacement; /* horizontal adjustment for HB_Short XPlacement; /* horizontal adjustment for
placement */ placement */
FT_Short YPlacement; /* vertical adjustment for HB_Short YPlacement; /* vertical adjustment for
placement */ placement */
FT_Short XAdvance; /* horizontal adjustment for HB_Short XAdvance; /* horizontal adjustment for
advance */ advance */
FT_Short YAdvance; /* vertical adjustment for HB_Short YAdvance; /* vertical adjustment for
advance */ advance */
HB_Device XPlacementDevice; /* device table for horizontal HB_Device XPlacementDevice; /* device table for horizontal
placement */ placement */
@ -39,10 +39,10 @@ struct HB_ValueRecord_
advance */ advance */
HB_Device YAdvanceDevice; /* device table for vertical HB_Device YAdvanceDevice; /* device table for vertical
advance */ advance */
FT_UShort XIdPlacement; /* horizontal placement metric ID */ HB_UShort XIdPlacement; /* horizontal placement metric ID */
FT_UShort YIdPlacement; /* vertical placement metric ID */ HB_UShort YIdPlacement; /* vertical placement metric ID */
FT_UShort XIdAdvance; /* horizontal advance metric ID */ HB_UShort XIdAdvance; /* horizontal advance metric ID */
FT_UShort YIdAdvance; /* vertical advance metric ID */ HB_UShort YIdAdvance; /* vertical advance metric ID */
}; };
typedef struct HB_ValueRecord_ HB_ValueRecord; typedef struct HB_ValueRecord_ HB_ValueRecord;
@ -67,8 +67,8 @@ typedef struct HB_ValueRecord_ HB_ValueRecord;
struct HB_AnchorFormat1_ struct HB_AnchorFormat1_
{ {
FT_Short XCoordinate; /* horizontal value */ HB_Short XCoordinate; /* horizontal value */
FT_Short YCoordinate; /* vertical value */ HB_Short YCoordinate; /* vertical value */
}; };
typedef struct HB_AnchorFormat1_ HB_AnchorFormat1; typedef struct HB_AnchorFormat1_ HB_AnchorFormat1;
@ -76,9 +76,9 @@ typedef struct HB_AnchorFormat1_ HB_AnchorFormat1;
struct HB_AnchorFormat2_ struct HB_AnchorFormat2_
{ {
FT_Short XCoordinate; /* horizontal value */ HB_Short XCoordinate; /* horizontal value */
FT_Short YCoordinate; /* vertical value */ HB_Short YCoordinate; /* vertical value */
FT_UShort AnchorPoint; /* index to glyph contour point */ HB_UShort AnchorPoint; /* index to glyph contour point */
}; };
typedef struct HB_AnchorFormat2_ HB_AnchorFormat2; typedef struct HB_AnchorFormat2_ HB_AnchorFormat2;
@ -86,8 +86,8 @@ typedef struct HB_AnchorFormat2_ HB_AnchorFormat2;
struct HB_AnchorFormat3_ struct HB_AnchorFormat3_
{ {
FT_Short XCoordinate; /* horizontal value */ HB_Short XCoordinate; /* horizontal value */
FT_Short YCoordinate; /* vertical value */ HB_Short YCoordinate; /* vertical value */
HB_Device XDeviceTable; /* device table for X coordinate */ HB_Device XDeviceTable; /* device table for X coordinate */
HB_Device YDeviceTable; /* device table for Y coordinate */ HB_Device YDeviceTable; /* device table for Y coordinate */
}; };
@ -97,8 +97,8 @@ typedef struct HB_AnchorFormat3_ HB_AnchorFormat3;
struct HB_AnchorFormat4_ struct HB_AnchorFormat4_
{ {
FT_UShort XIdAnchor; /* horizontal metric ID */ HB_UShort XIdAnchor; /* horizontal metric ID */
FT_UShort YIdAnchor; /* vertical metric ID */ HB_UShort YIdAnchor; /* vertical metric ID */
}; };
typedef struct HB_AnchorFormat4_ HB_AnchorFormat4; typedef struct HB_AnchorFormat4_ HB_AnchorFormat4;
@ -106,7 +106,7 @@ typedef struct HB_AnchorFormat4_ HB_AnchorFormat4;
struct HB_Anchor_ 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 */ that there is no Anchor table */
union union
@ -123,7 +123,7 @@ typedef struct HB_Anchor_ HB_Anchor;
struct HB_MarkRecord_ struct HB_MarkRecord_
{ {
FT_UShort Class; /* mark class */ HB_UShort Class; /* mark class */
HB_Anchor MarkAnchor; /* anchor table */ HB_Anchor MarkAnchor; /* anchor table */
}; };
@ -132,7 +132,7 @@ typedef struct HB_MarkRecord_ HB_MarkRecord;
struct HB_MarkArray_ struct HB_MarkArray_
{ {
FT_UShort MarkCount; /* number of MarkRecord tables */ HB_UShort MarkCount; /* number of MarkRecord tables */
HB_MarkRecord* MarkRecord; /* array of MarkRecord tables */ HB_MarkRecord* MarkRecord; /* array of MarkRecord tables */
}; };
@ -152,7 +152,7 @@ typedef struct HB_SinglePosFormat1_ HB_SinglePosFormat1;
struct HB_SinglePosFormat2_ struct HB_SinglePosFormat2_
{ {
FT_UShort ValueCount; /* number of ValueRecord tables */ HB_UShort ValueCount; /* number of ValueRecord tables */
HB_ValueRecord* Value; /* array of ValueRecord tables */ HB_ValueRecord* Value; /* array of ValueRecord tables */
}; };
@ -161,10 +161,10 @@ typedef struct HB_SinglePosFormat2_ HB_SinglePosFormat2;
struct HB_SinglePos_ struct HB_SinglePos_
{ {
FT_UShort PosFormat; /* 1 or 2 */ HB_UShort PosFormat; /* 1 or 2 */
HB_Coverage Coverage; /* Coverage table */ HB_Coverage Coverage; /* Coverage table */
FT_UShort ValueFormat; /* format of ValueRecord table */ HB_UShort ValueFormat; /* format of ValueRecord table */
union union
{ {
@ -180,7 +180,7 @@ typedef struct HB_SinglePos_ HB_SinglePos;
struct HB_PairValueRecord_ 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 Value1; /* pos. data for first glyph */
HB_ValueRecord Value2; /* pos. data for second glyph */ HB_ValueRecord Value2; /* pos. data for second glyph */
}; };
@ -190,7 +190,7 @@ typedef struct HB_PairValueRecord_ HB_PairValueRecord;
struct HB_PairSet_ struct HB_PairSet_
{ {
FT_UShort PairValueCount; HB_UShort PairValueCount;
/* number of PairValueRecord tables */ /* number of PairValueRecord tables */
HB_PairValueRecord* PairValueRecord; HB_PairValueRecord* PairValueRecord;
/* array of PairValueRecord tables */ /* array of PairValueRecord tables */
@ -201,7 +201,7 @@ typedef struct HB_PairSet_ HB_PairSet;
struct HB_PairPosFormat1_ struct HB_PairPosFormat1_
{ {
FT_UShort PairSetCount; /* number of PairSet tables */ HB_UShort PairSetCount; /* number of PairSet tables */
HB_PairSet* PairSet; /* array 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 ClassDef1; /* class def. for first glyph */
HB_ClassDefinition ClassDef2; /* class def. for second 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 */ table */
FT_UShort Class2Count; /* number of classes in ClassDef2 HB_UShort Class2Count; /* number of classes in ClassDef2
table */ table */
HB_Class1Record* Class1Record; /* array of Class1Record tables */ HB_Class1Record* Class1Record; /* array of Class1Record tables */
}; };
@ -241,11 +241,11 @@ typedef struct HB_PairPosFormat2_ HB_PairPosFormat2;
struct HB_PairPos_ struct HB_PairPos_
{ {
FT_UShort PosFormat; /* 1 or 2 */ HB_UShort PosFormat; /* 1 or 2 */
HB_Coverage Coverage; /* Coverage table */ HB_Coverage Coverage; /* Coverage table */
FT_UShort ValueFormat1; /* format of ValueRecord table HB_UShort ValueFormat1; /* format of ValueRecord table
for first glyph */ for first glyph */
FT_UShort ValueFormat2; /* format of ValueRecord table HB_UShort ValueFormat2; /* format of ValueRecord table
for second glyph */ for second glyph */
union union
@ -271,9 +271,9 @@ typedef struct HB_EntryExitRecord_ HB_EntryExitRecord;
struct HB_CursivePos_ struct HB_CursivePos_
{ {
FT_UShort PosFormat; /* always 1 */ HB_UShort PosFormat; /* always 1 */
HB_Coverage Coverage; /* Coverage table */ HB_Coverage Coverage; /* Coverage table */
FT_UShort EntryExitCount; HB_UShort EntryExitCount;
/* number of EntryExitRecord tables */ /* number of EntryExitRecord tables */
HB_EntryExitRecord* EntryExitRecord; HB_EntryExitRecord* EntryExitRecord;
/* array of EntryExitRecord tables */ /* array of EntryExitRecord tables */
@ -295,7 +295,7 @@ typedef struct HB_BaseRecord_ HB_BaseRecord;
struct HB_BaseArray_ struct HB_BaseArray_
{ {
FT_UShort BaseCount; /* number of BaseRecord tables */ HB_UShort BaseCount; /* number of BaseRecord tables */
HB_BaseRecord* BaseRecord; /* array of BaseRecord tables */ HB_BaseRecord* BaseRecord; /* array of BaseRecord tables */
}; };
@ -304,10 +304,10 @@ typedef struct HB_BaseArray_ HB_BaseArray;
struct HB_MarkBasePos_ struct HB_MarkBasePos_
{ {
FT_UShort PosFormat; /* always 1 */ HB_UShort PosFormat; /* always 1 */
HB_Coverage MarkCoverage; /* mark glyph coverage table */ HB_Coverage MarkCoverage; /* mark glyph coverage table */
HB_Coverage BaseCoverage; /* base 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_MarkArray MarkArray; /* mark array table */
HB_BaseArray BaseArray; /* base array table */ HB_BaseArray BaseArray; /* base array table */
}; };
@ -328,7 +328,7 @@ typedef struct HB_ComponentRecord_ HB_ComponentRecord;
struct HB_LigatureAttach_ struct HB_LigatureAttach_
{ {
FT_UShort ComponentCount; HB_UShort ComponentCount;
/* number of ComponentRecord tables */ /* number of ComponentRecord tables */
HB_ComponentRecord* ComponentRecord; HB_ComponentRecord* ComponentRecord;
/* array of ComponentRecord tables */ /* array of ComponentRecord tables */
@ -339,7 +339,7 @@ typedef struct HB_LigatureAttach_ HB_LigatureAttach;
struct HB_LigatureArray_ struct HB_LigatureArray_
{ {
FT_UShort LigatureCount; /* number of LigatureAttach tables */ HB_UShort LigatureCount; /* number of LigatureAttach tables */
HB_LigatureAttach* LigatureAttach; HB_LigatureAttach* LigatureAttach;
/* array of LigatureAttach tables */ /* array of LigatureAttach tables */
}; };
@ -349,11 +349,11 @@ typedef struct HB_LigatureArray_ HB_LigatureArray;
struct HB_MarkLigPos_ struct HB_MarkLigPos_
{ {
FT_UShort PosFormat; /* always 1 */ HB_UShort PosFormat; /* always 1 */
HB_Coverage MarkCoverage; /* mark glyph coverage table */ HB_Coverage MarkCoverage; /* mark glyph coverage table */
HB_Coverage LigatureCoverage; HB_Coverage LigatureCoverage;
/* ligature glyph coverage table */ /* 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_MarkArray MarkArray; /* mark array table */
HB_LigatureArray LigatureArray; /* ligature array table */ HB_LigatureArray LigatureArray; /* ligature array table */
}; };
@ -374,7 +374,7 @@ typedef struct HB_Mark2Record_ HB_Mark2Record;
struct HB_Mark2Array_ struct HB_Mark2Array_
{ {
FT_UShort Mark2Count; /* number of Mark2Record tables */ HB_UShort Mark2Count; /* number of Mark2Record tables */
HB_Mark2Record* Mark2Record; /* array of Mark2Record tables */ HB_Mark2Record* Mark2Record; /* array of Mark2Record tables */
}; };
@ -383,10 +383,10 @@ typedef struct HB_Mark2Array_ HB_Mark2Array;
struct HB_MarkMarkPos_ struct HB_MarkMarkPos_
{ {
FT_UShort PosFormat; /* always 1 */ HB_UShort PosFormat; /* always 1 */
HB_Coverage Mark1Coverage; /* first mark glyph coverage table */ HB_Coverage Mark1Coverage; /* first mark glyph coverage table */
HB_Coverage Mark2Coverage; /* second mark glyph coverave 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_MarkArray Mark1Array; /* MarkArray table for first mark */
HB_Mark2Array Mark2Array; /* MarkArray table for second mark */ HB_Mark2Array Mark2Array; /* MarkArray table for second mark */
}; };
@ -398,9 +398,9 @@ typedef struct HB_MarkMarkPos_ HB_MarkMarkPos;
struct HB_PosLookupRecord_ struct HB_PosLookupRecord_
{ {
FT_UShort SequenceIndex; /* index into current HB_UShort SequenceIndex; /* index into current
glyph sequence */ 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; typedef struct HB_PosLookupRecord_ HB_PosLookupRecord;
@ -410,9 +410,9 @@ typedef struct HB_PosLookupRecord_ HB_PosLookupRecord;
struct HB_PosRule_ struct HB_PosRule_
{ {
FT_UShort GlyphCount; /* total number of input glyphs */ HB_UShort GlyphCount; /* total number of input glyphs */
FT_UShort PosCount; /* number of PosLookupRecord tables */ HB_UShort PosCount; /* number of PosLookupRecord tables */
FT_UShort* Input; /* array of input glyph IDs */ HB_UShort* Input; /* array of input glyph IDs */
HB_PosLookupRecord* PosLookupRecord; HB_PosLookupRecord* PosLookupRecord;
/* array of PosLookupRecord tables */ /* array of PosLookupRecord tables */
}; };
@ -422,7 +422,7 @@ typedef struct HB_PosRule_ HB_PosRule;
struct HB_PosRuleSet_ struct HB_PosRuleSet_
{ {
FT_UShort PosRuleCount; /* number of PosRule tables */ HB_UShort PosRuleCount; /* number of PosRule tables */
HB_PosRule* PosRule; /* array of PosRule tables */ HB_PosRule* PosRule; /* array of PosRule tables */
}; };
@ -432,7 +432,7 @@ typedef struct HB_PosRuleSet_ HB_PosRuleSet;
struct HB_ContextPosFormat1_ struct HB_ContextPosFormat1_
{ {
HB_Coverage Coverage; /* Coverage table */ 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 */ HB_PosRuleSet* PosRuleSet; /* array of PosRuleSet tables */
}; };
@ -441,9 +441,9 @@ typedef struct HB_ContextPosFormat1_ HB_ContextPosFormat1;
struct HB_PosClassRule_ struct HB_PosClassRule_
{ {
FT_UShort GlyphCount; /* total number of context classes */ HB_UShort GlyphCount; /* total number of context classes */
FT_UShort PosCount; /* number of PosLookupRecord tables */ HB_UShort PosCount; /* number of PosLookupRecord tables */
FT_UShort* Class; /* array of classes */ HB_UShort* Class; /* array of classes */
HB_PosLookupRecord* PosLookupRecord; HB_PosLookupRecord* PosLookupRecord;
/* array of PosLookupRecord tables */ /* array of PosLookupRecord tables */
}; };
@ -453,7 +453,7 @@ typedef struct HB_PosClassRule_ HB_PosClassRule;
struct HB_PosClassSet_ struct HB_PosClassSet_
{ {
FT_UShort PosClassRuleCount; HB_UShort PosClassRuleCount;
/* number of PosClassRule tables */ /* number of PosClassRule tables */
HB_PosClassRule* PosClassRule; /* array of PosClassRule tables */ HB_PosClassRule* PosClassRule; /* array of PosClassRule tables */
}; };
@ -467,11 +467,11 @@ typedef struct HB_PosClassSet_ HB_PosClassSet;
struct HB_ContextPosFormat2_ struct HB_ContextPosFormat2_
{ {
FT_UShort MaxContextLength; HB_UShort MaxContextLength;
/* maximal context length */ /* maximal context length */
HB_Coverage Coverage; /* Coverage table */ HB_Coverage Coverage; /* Coverage table */
HB_ClassDefinition ClassDef; /* ClassDef table */ HB_ClassDefinition ClassDef; /* ClassDef table */
FT_UShort PosClassSetCount; HB_UShort PosClassSetCount;
/* number of PosClassSet tables */ /* number of PosClassSet tables */
HB_PosClassSet* PosClassSet; /* array of PosClassSet tables */ HB_PosClassSet* PosClassSet; /* array of PosClassSet tables */
}; };
@ -481,8 +481,8 @@ typedef struct HB_ContextPosFormat2_ HB_ContextPosFormat2;
struct HB_ContextPosFormat3_ struct HB_ContextPosFormat3_
{ {
FT_UShort GlyphCount; /* number of input glyphs */ HB_UShort GlyphCount; /* number of input glyphs */
FT_UShort PosCount; /* number of PosLookupRecord tables */ HB_UShort PosCount; /* number of PosLookupRecord tables */
HB_Coverage* Coverage; /* array of Coverage tables */ HB_Coverage* Coverage; /* array of Coverage tables */
HB_PosLookupRecord* PosLookupRecord; HB_PosLookupRecord* PosLookupRecord;
/* array of PosLookupRecord tables */ /* array of PosLookupRecord tables */
@ -493,7 +493,7 @@ typedef struct HB_ContextPosFormat3_ HB_ContextPosFormat3;
struct HB_ContextPos_ struct HB_ContextPos_
{ {
FT_UShort PosFormat; /* 1, 2, or 3 */ HB_UShort PosFormat; /* 1, 2, or 3 */
union union
{ {
@ -510,16 +510,16 @@ typedef struct HB_ContextPos_ HB_ContextPos;
struct HB_ChainPosRule_ struct HB_ChainPosRule_
{ {
FT_UShort BacktrackGlyphCount; HB_UShort BacktrackGlyphCount;
/* total number of backtrack glyphs */ /* total number of backtrack glyphs */
FT_UShort* Backtrack; /* array of backtrack glyph IDs */ HB_UShort* Backtrack; /* array of backtrack glyph IDs */
FT_UShort InputGlyphCount; HB_UShort InputGlyphCount;
/* total number of input glyphs */ /* total number of input glyphs */
FT_UShort* Input; /* array of input glyph IDs */ HB_UShort* Input; /* array of input glyph IDs */
FT_UShort LookaheadGlyphCount; HB_UShort LookaheadGlyphCount;
/* total number of lookahead glyphs */ /* total number of lookahead glyphs */
FT_UShort* Lookahead; /* array of lookahead glyph IDs */ HB_UShort* Lookahead; /* array of lookahead glyph IDs */
FT_UShort PosCount; /* number of PosLookupRecords */ HB_UShort PosCount; /* number of PosLookupRecords */
HB_PosLookupRecord* PosLookupRecord; HB_PosLookupRecord* PosLookupRecord;
/* array of PosLookupRecords */ /* array of PosLookupRecords */
}; };
@ -529,7 +529,7 @@ typedef struct HB_ChainPosRule_ HB_ChainPosRule;
struct HB_ChainPosRuleSet_ struct HB_ChainPosRuleSet_
{ {
FT_UShort ChainPosRuleCount; HB_UShort ChainPosRuleCount;
/* number of ChainPosRule tables */ /* number of ChainPosRule tables */
HB_ChainPosRule* ChainPosRule; /* array of ChainPosRule tables */ HB_ChainPosRule* ChainPosRule; /* array of ChainPosRule tables */
}; };
@ -540,7 +540,7 @@ typedef struct HB_ChainPosRuleSet_ HB_ChainPosRuleSet;
struct HB_ChainContextPosFormat1_ struct HB_ChainContextPosFormat1_
{ {
HB_Coverage Coverage; /* Coverage table */ HB_Coverage Coverage; /* Coverage table */
FT_UShort ChainPosRuleSetCount; HB_UShort ChainPosRuleSetCount;
/* number of ChainPosRuleSet tables */ /* number of ChainPosRuleSet tables */
HB_ChainPosRuleSet* ChainPosRuleSet; HB_ChainPosRuleSet* ChainPosRuleSet;
/* array of ChainPosRuleSet tables */ /* array of ChainPosRuleSet tables */
@ -551,18 +551,18 @@ typedef struct HB_ChainContextPosFormat1_ HB_ChainContextPosFormat1;
struct HB_ChainPosClassRule_ struct HB_ChainPosClassRule_
{ {
FT_UShort BacktrackGlyphCount; HB_UShort BacktrackGlyphCount;
/* total number of backtrack /* total number of backtrack
classes */ classes */
FT_UShort* Backtrack; /* array of backtrack classes */ HB_UShort* Backtrack; /* array of backtrack classes */
FT_UShort InputGlyphCount; HB_UShort InputGlyphCount;
/* total number of context classes */ /* total number of context classes */
FT_UShort* Input; /* array of context classes */ HB_UShort* Input; /* array of context classes */
FT_UShort LookaheadGlyphCount; HB_UShort LookaheadGlyphCount;
/* total number of lookahead /* total number of lookahead
classes */ classes */
FT_UShort* Lookahead; /* array of lookahead classes */ HB_UShort* Lookahead; /* array of lookahead classes */
FT_UShort PosCount; /* number of PosLookupRecords */ HB_UShort PosCount; /* number of PosLookupRecords */
HB_PosLookupRecord* PosLookupRecord; HB_PosLookupRecord* PosLookupRecord;
/* array of substitution lookups */ /* array of substitution lookups */
}; };
@ -572,7 +572,7 @@ typedef struct HB_ChainPosClassRule_ HB_ChainPosClassRule;
struct HB_ChainPosClassSet_ struct HB_ChainPosClassSet_
{ {
FT_UShort ChainPosClassRuleCount; HB_UShort ChainPosClassRuleCount;
/* number of ChainPosClassRule /* number of ChainPosClassRule
tables */ tables */
HB_ChainPosClassRule* ChainPosClassRule; HB_ChainPosClassRule* ChainPosClassRule;
@ -591,20 +591,20 @@ struct HB_ChainContextPosFormat2_
{ {
HB_Coverage Coverage; /* Coverage table */ HB_Coverage Coverage; /* Coverage table */
FT_UShort MaxBacktrackLength; HB_UShort MaxBacktrackLength;
/* maximal backtrack length */ /* maximal backtrack length */
HB_ClassDefinition BacktrackClassDef; HB_ClassDefinition BacktrackClassDef;
/* BacktrackClassDef table */ /* BacktrackClassDef table */
FT_UShort MaxInputLength; HB_UShort MaxInputLength;
/* maximal input length */ /* maximal input length */
HB_ClassDefinition InputClassDef; HB_ClassDefinition InputClassDef;
/* InputClassDef table */ /* InputClassDef table */
FT_UShort MaxLookaheadLength; HB_UShort MaxLookaheadLength;
/* maximal lookahead length */ /* maximal lookahead length */
HB_ClassDefinition LookaheadClassDef; HB_ClassDefinition LookaheadClassDef;
/* LookaheadClassDef table */ /* LookaheadClassDef table */
FT_UShort ChainPosClassSetCount; HB_UShort ChainPosClassSetCount;
/* number of ChainPosClassSet /* number of ChainPosClassSet
tables */ tables */
HB_ChainPosClassSet* ChainPosClassSet; HB_ChainPosClassSet* ChainPosClassSet;
@ -617,22 +617,22 @@ typedef struct HB_ChainContextPosFormat2_ HB_ChainContextPosFormat2;
struct HB_ChainContextPosFormat3_ struct HB_ChainContextPosFormat3_
{ {
FT_UShort BacktrackGlyphCount; HB_UShort BacktrackGlyphCount;
/* number of backtrack glyphs */ /* number of backtrack glyphs */
HB_Coverage* BacktrackCoverage; HB_Coverage* BacktrackCoverage;
/* array of backtrack Coverage /* array of backtrack Coverage
tables */ tables */
FT_UShort InputGlyphCount; HB_UShort InputGlyphCount;
/* number of input glyphs */ /* number of input glyphs */
HB_Coverage* InputCoverage; HB_Coverage* InputCoverage;
/* array of input coverage /* array of input coverage
tables */ tables */
FT_UShort LookaheadGlyphCount; HB_UShort LookaheadGlyphCount;
/* number of lookahead glyphs */ /* number of lookahead glyphs */
HB_Coverage* LookaheadCoverage; HB_Coverage* LookaheadCoverage;
/* array of lookahead coverage /* array of lookahead coverage
tables */ tables */
FT_UShort PosCount; /* number of PosLookupRecords */ HB_UShort PosCount; /* number of PosLookupRecords */
HB_PosLookupRecord* PosLookupRecord; HB_PosLookupRecord* PosLookupRecord;
/* array of substitution lookups */ /* array of substitution lookups */
}; };
@ -642,7 +642,7 @@ typedef struct HB_ChainContextPosFormat3_ HB_ChainContextPosFormat3;
struct HB_ChainContextPos_ struct HB_ChainContextPos_
{ {
FT_UShort PosFormat; /* 1, 2, or 3 */ HB_UShort PosFormat; /* 1, 2, or 3 */
union union
{ {
@ -659,8 +659,8 @@ typedef struct HB_ChainContextPos_ HB_ChainContextPos;
/* LookupType 10 */ /* LookupType 10 */
struct HB_ExtensionPos_ struct HB_ExtensionPos_
{ {
FT_UShort PosFormat; /* always 1 */ HB_UShort PosFormat; /* always 1 */
FT_UShort LookuptType; /* lookup-type of referenced subtable */ HB_UShort LookuptType; /* lookup-type of referenced subtable */
HB_GPOS_SubTable *subtable; /* 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_INTERNAL HB_Error
_HB_GPOS_Load_SubTable( HB_GPOS_SubTable* st, _HB_GPOS_Load_SubTable( HB_GPOS_SubTable* st,
FT_Stream stream, FT_Stream stream,
FT_UShort lookup_type ); HB_UShort lookup_type );
HB_INTERNAL void HB_INTERNAL void
_HB_GPOS_Free_SubTable( HB_GPOS_SubTable* st, _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 */ #endif /* HARFBUZZ_GPOS_PRIVATE_H */

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@
#include "harfbuzz-gdef.h" #include "harfbuzz-gdef.h"
#include "harfbuzz-buffer.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_Format 0x1020
#define HB_Err_Invalid_GPOS_SubTable 0x1021 #define HB_Err_Invalid_GPOS_SubTable 0x1021
@ -49,8 +49,8 @@ FT_BEGIN_HEADER
_glyph = HANDLE_Glyph( glyph ) */ _glyph = HANDLE_Glyph( glyph ) */
typedef HB_Error (*HB_GlyphFunction)(FT_Face face, typedef HB_Error (*HB_GlyphFunction)(FT_Face face,
FT_UInt glyphIndex, HB_UInt glyphIndex,
FT_Int loadFlags ); HB_Int loadFlags );
/* A pointer to a function which accesses the PostScript interpreter. /* A pointer to a function which accesses the PostScript interpreter.
@ -65,7 +65,7 @@ typedef HB_Error (*HB_GlyphFunction)(FT_Face face,
be rounded). */ be rounded). */
typedef HB_Error (*HB_MMFunction)(FT_Face face, typedef HB_Error (*HB_MMFunction)(FT_Face face,
FT_UShort metric_id, HB_UShort metric_id,
FT_Pos* metric_value, FT_Pos* metric_value,
void* data ); void* data );
@ -106,38 +106,38 @@ HB_Error HB_Done_GPOS_Table( HB_GPOSHeader* gpos );
HB_Error HB_GPOS_Select_Script( HB_GPOSHeader* gpos, HB_Error HB_GPOS_Select_Script( HB_GPOSHeader* gpos,
FT_ULong script_tag, HB_UInt script_tag,
FT_UShort* script_index ); HB_UShort* script_index );
HB_Error HB_GPOS_Select_Language( HB_GPOSHeader* gpos, HB_Error HB_GPOS_Select_Language( HB_GPOSHeader* gpos,
FT_ULong language_tag, HB_UInt language_tag,
FT_UShort script_index, HB_UShort script_index,
FT_UShort* language_index, HB_UShort* language_index,
FT_UShort* req_feature_index ); HB_UShort* req_feature_index );
HB_Error HB_GPOS_Select_Feature( HB_GPOSHeader* gpos, HB_Error HB_GPOS_Select_Feature( HB_GPOSHeader* gpos,
FT_ULong feature_tag, HB_UInt feature_tag,
FT_UShort script_index, HB_UShort script_index,
FT_UShort language_index, HB_UShort language_index,
FT_UShort* feature_index ); HB_UShort* feature_index );
HB_Error HB_GPOS_Query_Scripts( HB_GPOSHeader* gpos, 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, HB_Error HB_GPOS_Query_Languages( HB_GPOSHeader* gpos,
FT_UShort script_index, HB_UShort script_index,
FT_ULong** language_tag_list ); HB_UInt** language_tag_list );
HB_Error HB_GPOS_Query_Features( HB_GPOSHeader* gpos, HB_Error HB_GPOS_Query_Features( HB_GPOSHeader* gpos,
FT_UShort script_index, HB_UShort script_index,
FT_UShort language_index, HB_UShort language_index,
FT_ULong** feature_tag_list ); HB_UInt** feature_tag_list );
HB_Error HB_GPOS_Add_Feature( HB_GPOSHeader* gpos, HB_Error HB_GPOS_Add_Feature( HB_GPOSHeader* gpos,
FT_UShort feature_index, HB_UShort feature_index,
FT_UInt property ); HB_UInt property );
HB_Error HB_GPOS_Clear_Features( HB_GPOSHeader* gpos ); 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_Error HB_GPOS_Apply_String( FT_Face face,
HB_GPOSHeader* gpos, HB_GPOSHeader* gpos,
FT_UShort load_flags, HB_UShort load_flags,
HB_Buffer buffer, HB_Buffer buffer,
FT_Bool dvi, HB_Bool dvi,
FT_Bool r2l ); HB_Bool r2l );
FT_END_HEADER HB_END_HEADER
#endif /* HARFBUZZ_GPOS_H */ #endif /* HARFBUZZ_GPOS_H */

View File

@ -16,7 +16,7 @@
#include "harfbuzz-impl.h" #include "harfbuzz-impl.h"
#include "harfbuzz-gsub.h" #include "harfbuzz-gsub.h"
FT_BEGIN_HEADER HB_BEGIN_HEADER
typedef union HB_GSUB_SubTable_ HB_GSUB_SubTable; typedef union HB_GSUB_SubTable_ HB_GSUB_SubTable;
@ -25,7 +25,7 @@ typedef union HB_GSUB_SubTable_ HB_GSUB_SubTable;
struct HB_SingleSubstFormat1_ struct HB_SingleSubstFormat1_
{ {
FT_Short DeltaGlyphID; /* constant added to get HB_Short DeltaGlyphID; /* constant added to get
substitution glyph index */ substitution glyph index */
}; };
@ -34,9 +34,9 @@ typedef struct HB_SingleSubstFormat1_ HB_SingleSubstFormat1;
struct HB_SingleSubstFormat2_ struct HB_SingleSubstFormat2_
{ {
FT_UShort GlyphCount; /* number of glyph IDs in HB_UShort GlyphCount; /* number of glyph IDs in
Substitute array */ Substitute array */
FT_UShort* Substitute; /* array of substitute glyph IDs */ HB_UShort* Substitute; /* array of substitute glyph IDs */
}; };
typedef struct HB_SingleSubstFormat2_ HB_SingleSubstFormat2; typedef struct HB_SingleSubstFormat2_ HB_SingleSubstFormat2;
@ -44,7 +44,7 @@ typedef struct HB_SingleSubstFormat2_ HB_SingleSubstFormat2;
struct HB_SingleSubst_ struct HB_SingleSubst_
{ {
FT_UShort SubstFormat; /* 1 or 2 */ HB_UShort SubstFormat; /* 1 or 2 */
HB_Coverage Coverage; /* Coverage table */ HB_Coverage Coverage; /* Coverage table */
union union
@ -61,9 +61,9 @@ typedef struct HB_SingleSubst_ HB_SingleSubst;
struct HB_Sequence_ struct HB_Sequence_
{ {
FT_UShort GlyphCount; /* number of glyph IDs in the HB_UShort GlyphCount; /* number of glyph IDs in the
Substitute array */ Substitute array */
FT_UShort* Substitute; /* string of glyph IDs to HB_UShort* Substitute; /* string of glyph IDs to
substitute */ substitute */
}; };
@ -72,9 +72,9 @@ typedef struct HB_Sequence_ HB_Sequence;
struct HB_MultipleSubst_ struct HB_MultipleSubst_
{ {
FT_UShort SubstFormat; /* always 1 */ HB_UShort SubstFormat; /* always 1 */
HB_Coverage Coverage; /* Coverage table */ 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 */ HB_Sequence* Sequence; /* array of Sequence tables */
}; };
@ -85,9 +85,9 @@ typedef struct HB_MultipleSubst_ HB_MultipleSubst;
struct HB_AlternateSet_ struct HB_AlternateSet_
{ {
FT_UShort GlyphCount; /* number of glyph IDs in the HB_UShort GlyphCount; /* number of glyph IDs in the
Alternate array */ Alternate array */
FT_UShort* Alternate; /* array of alternate glyph IDs */ HB_UShort* Alternate; /* array of alternate glyph IDs */
}; };
typedef struct HB_AlternateSet_ HB_AlternateSet; typedef struct HB_AlternateSet_ HB_AlternateSet;
@ -95,9 +95,9 @@ typedef struct HB_AlternateSet_ HB_AlternateSet;
struct HB_AlternateSubst_ struct HB_AlternateSubst_
{ {
FT_UShort SubstFormat; /* always 1 */ HB_UShort SubstFormat; /* always 1 */
HB_Coverage Coverage; /* Coverage table */ HB_Coverage Coverage; /* Coverage table */
FT_UShort AlternateSetCount; HB_UShort AlternateSetCount;
/* number of AlternateSet tables */ /* number of AlternateSet tables */
HB_AlternateSet* AlternateSet; /* array of AlternateSet tables */ HB_AlternateSet* AlternateSet; /* array of AlternateSet tables */
}; };
@ -109,10 +109,10 @@ typedef struct HB_AlternateSubst_ HB_AlternateSubst;
struct HB_Ligature_ struct HB_Ligature_
{ {
FT_UShort LigGlyph; /* glyphID of ligature HB_UShort LigGlyph; /* glyphID of ligature
to substitute */ to substitute */
FT_UShort ComponentCount; /* number of components in ligature */ HB_UShort ComponentCount; /* number of components in ligature */
FT_UShort* Component; /* array of component glyph IDs */ HB_UShort* Component; /* array of component glyph IDs */
}; };
typedef struct HB_Ligature_ HB_Ligature; typedef struct HB_Ligature_ HB_Ligature;
@ -120,7 +120,7 @@ typedef struct HB_Ligature_ HB_Ligature;
struct HB_LigatureSet_ struct HB_LigatureSet_
{ {
FT_UShort LigatureCount; /* number of Ligature tables */ HB_UShort LigatureCount; /* number of Ligature tables */
HB_Ligature* Ligature; /* array of Ligature tables */ HB_Ligature* Ligature; /* array of Ligature tables */
}; };
@ -129,9 +129,9 @@ typedef struct HB_LigatureSet_ HB_LigatureSet;
struct HB_LigatureSubst_ struct HB_LigatureSubst_
{ {
FT_UShort SubstFormat; /* always 1 */ HB_UShort SubstFormat; /* always 1 */
HB_Coverage Coverage; /* Coverage table */ 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 */ HB_LigatureSet* LigatureSet; /* array of LigatureSet tables */
}; };
@ -142,9 +142,9 @@ typedef struct HB_LigatureSubst_ HB_LigatureSubst;
struct HB_SubstLookupRecord_ struct HB_SubstLookupRecord_
{ {
FT_UShort SequenceIndex; /* index into current HB_UShort SequenceIndex; /* index into current
glyph sequence */ 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; typedef struct HB_SubstLookupRecord_ HB_SubstLookupRecord;
@ -154,10 +154,10 @@ typedef struct HB_SubstLookupRecord_ HB_SubstLookupRecord;
struct HB_SubRule_ struct HB_SubRule_
{ {
FT_UShort GlyphCount; /* total number of input glyphs */ HB_UShort GlyphCount; /* total number of input glyphs */
FT_UShort SubstCount; /* number of SubstLookupRecord HB_UShort SubstCount; /* number of SubstLookupRecord
tables */ tables */
FT_UShort* Input; /* array of input glyph IDs */ HB_UShort* Input; /* array of input glyph IDs */
HB_SubstLookupRecord* SubstLookupRecord; HB_SubstLookupRecord* SubstLookupRecord;
/* array of SubstLookupRecord /* array of SubstLookupRecord
tables */ tables */
@ -168,7 +168,7 @@ typedef struct HB_SubRule_ HB_SubRule;
struct HB_SubRuleSet_ struct HB_SubRuleSet_
{ {
FT_UShort SubRuleCount; /* number of SubRule tables */ HB_UShort SubRuleCount; /* number of SubRule tables */
HB_SubRule* SubRule; /* array of SubRule tables */ HB_SubRule* SubRule; /* array of SubRule tables */
}; };
@ -178,7 +178,7 @@ typedef struct HB_SubRuleSet_ HB_SubRuleSet;
struct HB_ContextSubstFormat1_ struct HB_ContextSubstFormat1_
{ {
HB_Coverage Coverage; /* Coverage table */ 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 */ HB_SubRuleSet* SubRuleSet; /* array of SubRuleSet tables */
}; };
@ -187,10 +187,10 @@ typedef struct HB_ContextSubstFormat1_ HB_ContextSubstFormat1;
struct HB_SubClassRule_ struct HB_SubClassRule_
{ {
FT_UShort GlyphCount; /* total number of context classes */ HB_UShort GlyphCount; /* total number of context classes */
FT_UShort SubstCount; /* number of SubstLookupRecord HB_UShort SubstCount; /* number of SubstLookupRecord
tables */ tables */
FT_UShort* Class; /* array of classes */ HB_UShort* Class; /* array of classes */
HB_SubstLookupRecord* SubstLookupRecord; HB_SubstLookupRecord* SubstLookupRecord;
/* array of SubstLookupRecord /* array of SubstLookupRecord
tables */ tables */
@ -201,7 +201,7 @@ typedef struct HB_SubClassRule_ HB_SubClassRule;
struct HB_SubClassSet_ struct HB_SubClassSet_
{ {
FT_UShort SubClassRuleCount; HB_UShort SubClassRuleCount;
/* number of SubClassRule tables */ /* number of SubClassRule tables */
HB_SubClassRule* SubClassRule; /* array of SubClassRule tables */ HB_SubClassRule* SubClassRule; /* array of SubClassRule tables */
}; };
@ -215,11 +215,11 @@ typedef struct HB_SubClassSet_ HB_SubClassSet;
struct HB_ContextSubstFormat2_ struct HB_ContextSubstFormat2_
{ {
FT_UShort MaxContextLength; HB_UShort MaxContextLength;
/* maximal context length */ /* maximal context length */
HB_Coverage Coverage; /* Coverage table */ HB_Coverage Coverage; /* Coverage table */
HB_ClassDefinition ClassDef; /* ClassDef table */ HB_ClassDefinition ClassDef; /* ClassDef table */
FT_UShort SubClassSetCount; HB_UShort SubClassSetCount;
/* number of SubClassSet tables */ /* number of SubClassSet tables */
HB_SubClassSet* SubClassSet; /* array of SubClassSet tables */ HB_SubClassSet* SubClassSet; /* array of SubClassSet tables */
}; };
@ -229,8 +229,8 @@ typedef struct HB_ContextSubstFormat2_ HB_ContextSubstFormat2;
struct HB_ContextSubstFormat3_ struct HB_ContextSubstFormat3_
{ {
FT_UShort GlyphCount; /* number of input glyphs */ HB_UShort GlyphCount; /* number of input glyphs */
FT_UShort SubstCount; /* number of SubstLookupRecords */ HB_UShort SubstCount; /* number of SubstLookupRecords */
HB_Coverage* Coverage; /* array of Coverage tables */ HB_Coverage* Coverage; /* array of Coverage tables */
HB_SubstLookupRecord* SubstLookupRecord; HB_SubstLookupRecord* SubstLookupRecord;
/* array of substitution lookups */ /* array of substitution lookups */
@ -241,7 +241,7 @@ typedef struct HB_ContextSubstFormat3_ HB_ContextSubstFormat3;
struct HB_ContextSubst_ struct HB_ContextSubst_
{ {
FT_UShort SubstFormat; /* 1, 2, or 3 */ HB_UShort SubstFormat; /* 1, 2, or 3 */
union union
{ {
@ -258,16 +258,16 @@ typedef struct HB_ContextSubst_ HB_ContextSubst;
struct HB_ChainSubRule_ struct HB_ChainSubRule_
{ {
FT_UShort BacktrackGlyphCount; HB_UShort BacktrackGlyphCount;
/* total number of backtrack glyphs */ /* total number of backtrack glyphs */
FT_UShort* Backtrack; /* array of backtrack glyph IDs */ HB_UShort* Backtrack; /* array of backtrack glyph IDs */
FT_UShort InputGlyphCount; HB_UShort InputGlyphCount;
/* total number of input glyphs */ /* total number of input glyphs */
FT_UShort* Input; /* array of input glyph IDs */ HB_UShort* Input; /* array of input glyph IDs */
FT_UShort LookaheadGlyphCount; HB_UShort LookaheadGlyphCount;
/* total number of lookahead glyphs */ /* total number of lookahead glyphs */
FT_UShort* Lookahead; /* array of lookahead glyph IDs */ HB_UShort* Lookahead; /* array of lookahead glyph IDs */
FT_UShort SubstCount; /* number of SubstLookupRecords */ HB_UShort SubstCount; /* number of SubstLookupRecords */
HB_SubstLookupRecord* SubstLookupRecord; HB_SubstLookupRecord* SubstLookupRecord;
/* array of SubstLookupRecords */ /* array of SubstLookupRecords */
}; };
@ -277,7 +277,7 @@ typedef struct HB_ChainSubRule_ HB_ChainSubRule;
struct HB_ChainSubRuleSet_ struct HB_ChainSubRuleSet_
{ {
FT_UShort ChainSubRuleCount; HB_UShort ChainSubRuleCount;
/* number of ChainSubRule tables */ /* number of ChainSubRule tables */
HB_ChainSubRule* ChainSubRule; /* array of ChainSubRule tables */ HB_ChainSubRule* ChainSubRule; /* array of ChainSubRule tables */
}; };
@ -288,7 +288,7 @@ typedef struct HB_ChainSubRuleSet_ HB_ChainSubRuleSet;
struct HB_ChainContextSubstFormat1_ struct HB_ChainContextSubstFormat1_
{ {
HB_Coverage Coverage; /* Coverage table */ HB_Coverage Coverage; /* Coverage table */
FT_UShort ChainSubRuleSetCount; HB_UShort ChainSubRuleSetCount;
/* number of ChainSubRuleSet tables */ /* number of ChainSubRuleSet tables */
HB_ChainSubRuleSet* ChainSubRuleSet; HB_ChainSubRuleSet* ChainSubRuleSet;
/* array of ChainSubRuleSet tables */ /* array of ChainSubRuleSet tables */
@ -299,18 +299,18 @@ typedef struct HB_ChainContextSubstFormat1_ HB_ChainContextSubstFormat1;
struct HB_ChainSubClassRule_ struct HB_ChainSubClassRule_
{ {
FT_UShort BacktrackGlyphCount; HB_UShort BacktrackGlyphCount;
/* total number of backtrack /* total number of backtrack
classes */ classes */
FT_UShort* Backtrack; /* array of backtrack classes */ HB_UShort* Backtrack; /* array of backtrack classes */
FT_UShort InputGlyphCount; HB_UShort InputGlyphCount;
/* total number of context classes */ /* total number of context classes */
FT_UShort* Input; /* array of context classes */ HB_UShort* Input; /* array of context classes */
FT_UShort LookaheadGlyphCount; HB_UShort LookaheadGlyphCount;
/* total number of lookahead /* total number of lookahead
classes */ classes */
FT_UShort* Lookahead; /* array of lookahead classes */ HB_UShort* Lookahead; /* array of lookahead classes */
FT_UShort SubstCount; /* number of SubstLookupRecords */ HB_UShort SubstCount; /* number of SubstLookupRecords */
HB_SubstLookupRecord* SubstLookupRecord; HB_SubstLookupRecord* SubstLookupRecord;
/* array of substitution lookups */ /* array of substitution lookups */
}; };
@ -320,7 +320,7 @@ typedef struct HB_ChainSubClassRule_ HB_ChainSubClassRule;
struct HB_ChainSubClassSet_ struct HB_ChainSubClassSet_
{ {
FT_UShort ChainSubClassRuleCount; HB_UShort ChainSubClassRuleCount;
/* number of ChainSubClassRule /* number of ChainSubClassRule
tables */ tables */
HB_ChainSubClassRule* ChainSubClassRule; HB_ChainSubClassRule* ChainSubClassRule;
@ -339,20 +339,20 @@ struct HB_ChainContextSubstFormat2_
{ {
HB_Coverage Coverage; /* Coverage table */ HB_Coverage Coverage; /* Coverage table */
FT_UShort MaxBacktrackLength; HB_UShort MaxBacktrackLength;
/* maximal backtrack length */ /* maximal backtrack length */
HB_ClassDefinition BacktrackClassDef; HB_ClassDefinition BacktrackClassDef;
/* BacktrackClassDef table */ /* BacktrackClassDef table */
FT_UShort MaxInputLength; HB_UShort MaxInputLength;
/* maximal input length */ /* maximal input length */
HB_ClassDefinition InputClassDef; HB_ClassDefinition InputClassDef;
/* InputClassDef table */ /* InputClassDef table */
FT_UShort MaxLookaheadLength; HB_UShort MaxLookaheadLength;
/* maximal lookahead length */ /* maximal lookahead length */
HB_ClassDefinition LookaheadClassDef; HB_ClassDefinition LookaheadClassDef;
/* LookaheadClassDef table */ /* LookaheadClassDef table */
FT_UShort ChainSubClassSetCount; HB_UShort ChainSubClassSetCount;
/* number of ChainSubClassSet /* number of ChainSubClassSet
tables */ tables */
HB_ChainSubClassSet* ChainSubClassSet; HB_ChainSubClassSet* ChainSubClassSet;
@ -365,22 +365,22 @@ typedef struct HB_ChainContextSubstFormat2_ HB_ChainContextSubstFormat2;
struct HB_ChainContextSubstFormat3_ struct HB_ChainContextSubstFormat3_
{ {
FT_UShort BacktrackGlyphCount; HB_UShort BacktrackGlyphCount;
/* number of backtrack glyphs */ /* number of backtrack glyphs */
HB_Coverage* BacktrackCoverage; HB_Coverage* BacktrackCoverage;
/* array of backtrack Coverage /* array of backtrack Coverage
tables */ tables */
FT_UShort InputGlyphCount; HB_UShort InputGlyphCount;
/* number of input glyphs */ /* number of input glyphs */
HB_Coverage* InputCoverage; HB_Coverage* InputCoverage;
/* array of input coverage /* array of input coverage
tables */ tables */
FT_UShort LookaheadGlyphCount; HB_UShort LookaheadGlyphCount;
/* number of lookahead glyphs */ /* number of lookahead glyphs */
HB_Coverage* LookaheadCoverage; HB_Coverage* LookaheadCoverage;
/* array of lookahead coverage /* array of lookahead coverage
tables */ tables */
FT_UShort SubstCount; /* number of SubstLookupRecords */ HB_UShort SubstCount; /* number of SubstLookupRecords */
HB_SubstLookupRecord* SubstLookupRecord; HB_SubstLookupRecord* SubstLookupRecord;
/* array of substitution lookups */ /* array of substitution lookups */
}; };
@ -390,7 +390,7 @@ typedef struct HB_ChainContextSubstFormat3_ HB_ChainContextSubstFormat3;
struct HB_ChainContextSubst_ struct HB_ChainContextSubst_
{ {
FT_UShort SubstFormat; /* 1, 2, or 3 */ HB_UShort SubstFormat; /* 1, 2, or 3 */
union union
{ {
@ -407,8 +407,8 @@ typedef struct HB_ChainContextSubst_ HB_ChainContextSubst;
/* LookupType 7 */ /* LookupType 7 */
struct HB_ExtensionSubst_ struct HB_ExtensionSubst_
{ {
FT_UShort SubstFormat; /* always 1 */ HB_UShort SubstFormat; /* always 1 */
FT_UShort LookuptType; /* lookup-type of referenced subtable */ HB_UShort LookuptType; /* lookup-type of referenced subtable */
HB_GSUB_SubTable *subtable; /* referenced subtable */ HB_GSUB_SubTable *subtable; /* referenced subtable */
}; };
@ -419,16 +419,16 @@ typedef struct HB_ExtensionSubst_ HB_ExtensionSubst;
/* LookupType 8 */ /* LookupType 8 */
struct HB_ReverseChainContextSubst_ struct HB_ReverseChainContextSubst_
{ {
FT_UShort SubstFormat; /* always 1 */ HB_UShort SubstFormat; /* always 1 */
HB_Coverage Coverage; /* coverage table for input glyphs */ 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 HB_Coverage* BacktrackCoverage; /* array of backtrack Coverage
tables */ tables */
FT_UShort LookaheadGlyphCount; /* number of lookahead glyphs */ HB_UShort LookaheadGlyphCount; /* number of lookahead glyphs */
HB_Coverage* LookaheadCoverage; /* array of lookahead Coverage HB_Coverage* LookaheadCoverage; /* array of lookahead Coverage
tables */ tables */
FT_UShort GlyphCount; /* number of Glyph IDs */ HB_UShort GlyphCount; /* number of Glyph IDs */
FT_UShort* Substitute; /* array of substitute Glyph ID */ HB_UShort* Substitute; /* array of substitute Glyph ID */
}; };
typedef struct HB_ReverseChainContextSubst_ HB_ReverseChainContextSubst; typedef struct HB_ReverseChainContextSubst_ HB_ReverseChainContextSubst;
@ -451,12 +451,12 @@ union HB_GSUB_SubTable_
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_HB_GSUB_Load_SubTable( HB_GSUB_SubTable* st, _HB_GSUB_Load_SubTable( HB_GSUB_SubTable* st,
FT_Stream stream, FT_Stream stream,
FT_UShort lookup_type ); HB_UShort lookup_type );
HB_INTERNAL void HB_INTERNAL void
_HB_GSUB_Free_SubTable( HB_GSUB_SubTable* st, _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 */ #endif /* HARFBUZZ_GSUB_PRIVATE_H */

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@
#include "harfbuzz-gdef.h" #include "harfbuzz-gdef.h"
#include "harfbuzz-buffer.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_Format 0x1010
#define HB_Err_Invalid_GSUB_SubTable 0x1011 #define HB_Err_Invalid_GSUB_SubTable 0x1011
@ -41,16 +41,16 @@ FT_BEGIN_HEADER
HB_GSUB_Register_Alternate_Function(). The function must return an HB_GSUB_Register_Alternate_Function(). The function must return an
index into the `alternates' array. */ index into the `alternates' array. */
typedef FT_UShort (*HB_AltFunction)(FT_ULong pos, typedef HB_UShort (*HB_AltFunction)(HB_UInt pos,
FT_UShort glyphID, HB_UShort glyphID,
FT_UShort num_alternates, HB_UShort num_alternates,
FT_UShort* alternates, HB_UShort* alternates,
void* data ); void* data );
struct HB_GSUBHeader_ struct HB_GSUBHeader_
{ {
FT_ULong offset; HB_UInt offset;
FT_Fixed Version; 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, HB_Error HB_GSUB_Select_Script( HB_GSUBHeader* gsub,
FT_ULong script_tag, HB_UInt script_tag,
FT_UShort* script_index ); HB_UShort* script_index );
HB_Error HB_GSUB_Select_Language( HB_GSUBHeader* gsub, HB_Error HB_GSUB_Select_Language( HB_GSUBHeader* gsub,
FT_ULong language_tag, HB_UInt language_tag,
FT_UShort script_index, HB_UShort script_index,
FT_UShort* language_index, HB_UShort* language_index,
FT_UShort* req_feature_index ); HB_UShort* req_feature_index );
HB_Error HB_GSUB_Select_Feature( HB_GSUBHeader* gsub, HB_Error HB_GSUB_Select_Feature( HB_GSUBHeader* gsub,
FT_ULong feature_tag, HB_UInt feature_tag,
FT_UShort script_index, HB_UShort script_index,
FT_UShort language_index, HB_UShort language_index,
FT_UShort* feature_index ); HB_UShort* feature_index );
HB_Error HB_GSUB_Query_Scripts( HB_GSUBHeader* gsub, 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, HB_Error HB_GSUB_Query_Languages( HB_GSUBHeader* gsub,
FT_UShort script_index, HB_UShort script_index,
FT_ULong** language_tag_list ); HB_UInt** language_tag_list );
HB_Error HB_GSUB_Query_Features( HB_GSUBHeader* gsub, HB_Error HB_GSUB_Query_Features( HB_GSUBHeader* gsub,
FT_UShort script_index, HB_UShort script_index,
FT_UShort language_index, HB_UShort language_index,
FT_ULong** feature_tag_list ); HB_UInt** feature_tag_list );
HB_Error HB_GSUB_Add_Feature( HB_GSUBHeader* gsub, HB_Error HB_GSUB_Add_Feature( HB_GSUBHeader* gsub,
FT_UShort feature_index, HB_UShort feature_index,
FT_UInt property ); HB_UInt property );
HB_Error HB_GSUB_Clear_Features( HB_GSUBHeader* gsub ); 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 ); HB_Buffer buffer );
FT_END_HEADER HB_END_HEADER
#endif /* HARFBUZZ_GSUB_H */ #endif /* HARFBUZZ_GSUB_H */

View File

@ -17,7 +17,9 @@
#include FT_FREETYPE_H #include FT_FREETYPE_H
#include FT_TRUETYPE_TAGS_H #include FT_TRUETYPE_TAGS_H
FT_BEGIN_HEADER #include "harfbuzz-global.h"
HB_BEGIN_HEADER
#ifndef HB_INTERNAL #ifndef HB_INTERNAL
# define HB_INTERNAL # define HB_INTERNAL
@ -89,6 +91,6 @@ FT_BEGIN_HEADER
#define COPY_Glyph( buffer ) \ #define COPY_Glyph( buffer ) \
( (error = _hb_buffer_copy_output_glyph ( buffer ) ) != HB_Err_Ok ) ( (error = _hb_buffer_copy_output_glyph ( buffer ) ) != HB_Err_Ok )
FT_END_HEADER HB_END_HEADER
#endif /* HARFBUZZ_IMPL_H */ #endif /* HARFBUZZ_IMPL_H */

View File

@ -18,7 +18,7 @@
#include "harfbuzz-gsub-private.h" #include "harfbuzz-gsub-private.h"
#include "harfbuzz-gpos-private.h" #include "harfbuzz-gpos-private.h"
FT_BEGIN_HEADER HB_BEGIN_HEADER
struct HB_SubTable_ struct HB_SubTable_
@ -47,13 +47,13 @@ _HB_OPEN_Load_Coverage( HB_Coverage* c,
FT_Stream input ); FT_Stream input );
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_HB_OPEN_Load_ClassDefinition( HB_ClassDefinition* cd, _HB_OPEN_Load_ClassDefinition( HB_ClassDefinition* cd,
FT_UShort limit, HB_UShort limit,
FT_Stream input ); FT_Stream input );
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_HB_OPEN_Load_EmptyOrClassDefinition( HB_ClassDefinition* cd, _HB_OPEN_Load_EmptyOrClassDefinition( HB_ClassDefinition* cd,
FT_UShort limit, HB_UShort limit,
FT_ULong class_offset, HB_UInt class_offset,
FT_ULong base_offset, HB_UInt base_offset,
FT_Stream stream ); FT_Stream stream );
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_HB_OPEN_Load_Device( HB_Device* d, _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_INTERNAL HB_Error
_HB_OPEN_Coverage_Index( HB_Coverage* c, _HB_OPEN_Coverage_Index( HB_Coverage* c,
FT_UShort glyphID, HB_UShort glyphID,
FT_UShort* index ); HB_UShort* index );
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_HB_OPEN_Get_Class( HB_ClassDefinition* cd, _HB_OPEN_Get_Class( HB_ClassDefinition* cd,
FT_UShort glyphID, HB_UShort glyphID,
FT_UShort* klass, HB_UShort* klass,
FT_UShort* index ); HB_UShort* index );
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_HB_OPEN_Get_Device( HB_Device* d, _HB_OPEN_Get_Device( HB_Device* d,
FT_UShort size, HB_UShort size,
FT_Short* value ); HB_Short* value );
FT_END_HEADER HB_END_HEADER
#endif /* HARFBUZZ_OPEN_PRIVATE_H */ #endif /* HARFBUZZ_OPEN_PRIVATE_H */

View File

@ -25,8 +25,8 @@ static HB_Error Load_LangSys( HB_LangSys* ls,
FT_Stream stream ) FT_Stream stream )
{ {
HB_Error error; HB_Error error;
FT_UShort n, count; HB_UShort n, count;
FT_UShort* fi; HB_UShort* fi;
if ( ACCESS_Frame( 6L ) ) if ( ACCESS_Frame( 6L ) )
@ -40,7 +40,7 @@ static HB_Error Load_LangSys( HB_LangSys* ls,
ls->FeatureIndex = NULL; ls->FeatureIndex = NULL;
if ( ALLOC_ARRAY( ls->FeatureIndex, count, FT_UShort ) ) if ( ALLOC_ARRAY( ls->FeatureIndex, count, HB_UShort ) )
return error; return error;
if ( ACCESS_Frame( count * 2L ) ) if ( ACCESS_Frame( count * 2L ) )
@ -72,8 +72,8 @@ static HB_Error Load_Script( HB_Script* s,
FT_Stream stream ) FT_Stream stream )
{ {
HB_Error error; HB_Error error;
FT_UShort n, m, count; HB_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset; HB_UInt cur_offset, new_offset, base_offset;
HB_LangSysRecord* lsr; HB_LangSysRecord* lsr;
@ -162,7 +162,7 @@ Fail2:
static void Free_Script( HB_Script* s ) static void Free_Script( HB_Script* s )
{ {
FT_UShort n, count; HB_UShort n, count;
HB_LangSysRecord* lsr; HB_LangSysRecord* lsr;
@ -190,8 +190,8 @@ _HB_OPEN_Load_ScriptList( HB_ScriptList* sl,
{ {
HB_Error error; HB_Error error;
FT_UShort n, script_count; HB_UShort n, script_count;
FT_ULong cur_offset, new_offset, base_offset; HB_UInt cur_offset, new_offset, base_offset;
HB_ScriptRecord* sr; HB_ScriptRecord* sr;
@ -262,7 +262,7 @@ Fail:
HB_INTERNAL void HB_INTERNAL void
_HB_OPEN_Free_ScriptList( HB_ScriptList* sl ) _HB_OPEN_Free_ScriptList( HB_ScriptList* sl )
{ {
FT_UShort n, count; HB_UShort n, count;
HB_ScriptRecord* sr; HB_ScriptRecord* sr;
@ -293,9 +293,9 @@ static HB_Error Load_Feature( HB_Feature* f,
{ {
HB_Error error; HB_Error error;
FT_UShort n, count; HB_UShort n, count;
FT_UShort* lli; HB_UShort* lli;
if ( ACCESS_Frame( 4L ) ) if ( ACCESS_Frame( 4L ) )
@ -308,7 +308,7 @@ static HB_Error Load_Feature( HB_Feature* f,
f->LookupListIndex = NULL; f->LookupListIndex = NULL;
if ( ALLOC_ARRAY( f->LookupListIndex, count, FT_UShort ) ) if ( ALLOC_ARRAY( f->LookupListIndex, count, HB_UShort ) )
return error; return error;
lli = f->LookupListIndex; lli = f->LookupListIndex;
@ -342,8 +342,8 @@ _HB_OPEN_Load_FeatureList( HB_FeatureList* fl,
{ {
HB_Error error; HB_Error error;
FT_UShort n, m, count; HB_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset; HB_UInt cur_offset, new_offset, base_offset;
HB_FeatureRecord* fr; HB_FeatureRecord* fr;
@ -361,7 +361,7 @@ _HB_OPEN_Load_FeatureList( HB_FeatureList* fl,
if ( ALLOC_ARRAY( fl->FeatureRecord, count, HB_FeatureRecord ) ) if ( ALLOC_ARRAY( fl->FeatureRecord, count, HB_FeatureRecord ) )
return error; return error;
if ( ALLOC_ARRAY( fl->ApplyOrder, count, FT_UShort ) ) if ( ALLOC_ARRAY( fl->ApplyOrder, count, HB_UShort ) )
goto Fail2; goto Fail2;
fl->ApplyCount = 0; fl->ApplyCount = 0;
@ -403,7 +403,7 @@ Fail2:
HB_INTERNAL void HB_INTERNAL void
_HB_OPEN_Free_FeatureList( HB_FeatureList* fl ) _HB_OPEN_Free_FeatureList( HB_FeatureList* fl )
{ {
FT_UShort n, count; HB_UShort n, count;
HB_FeatureRecord* fr; HB_FeatureRecord* fr;
@ -437,7 +437,7 @@ _HB_OPEN_Free_FeatureList( HB_FeatureList* fl )
static HB_Error Load_SubTable( HB_SubTable* st, static HB_Error Load_SubTable( HB_SubTable* st,
FT_Stream stream, FT_Stream stream,
HB_Type table_type, HB_Type table_type,
FT_UShort lookup_type ) HB_UShort lookup_type )
{ {
if ( table_type == HB_Type_GSUB ) if ( table_type == HB_Type_GSUB )
return _HB_GSUB_Load_SubTable ( &st->st.gsub, stream, lookup_type ); 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, static void Free_SubTable( HB_SubTable* st,
HB_Type table_type, HB_Type table_type,
FT_UShort lookup_type ) HB_UShort lookup_type )
{ {
if ( table_type == HB_Type_GSUB ) if ( table_type == HB_Type_GSUB )
_HB_GSUB_Free_SubTable ( &st->st.gsub, lookup_type ); _HB_GSUB_Free_SubTable ( &st->st.gsub, lookup_type );
@ -465,12 +465,12 @@ static HB_Error Load_Lookup( HB_Lookup* l,
{ {
HB_Error error; HB_Error error;
FT_UShort n, m, count; HB_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset; HB_UInt cur_offset, new_offset, base_offset;
HB_SubTable* st; HB_SubTable* st;
FT_Bool is_extension = FALSE; HB_Bool is_extension = FALSE;
base_offset = FILE_Pos(); base_offset = FILE_Pos();
@ -541,7 +541,7 @@ Fail:
static void Free_Lookup( HB_Lookup* l, static void Free_Lookup( HB_Lookup* l,
HB_Type type ) HB_Type type )
{ {
FT_UShort n, count; HB_UShort n, count;
HB_SubTable* st; HB_SubTable* st;
@ -568,8 +568,8 @@ _HB_OPEN_Load_LookupList( HB_LookupList* ll,
{ {
HB_Error error; HB_Error error;
FT_UShort n, m, count; HB_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset; HB_UInt cur_offset, new_offset, base_offset;
HB_Lookup* l; HB_Lookup* l;
@ -587,7 +587,7 @@ _HB_OPEN_Load_LookupList( HB_LookupList* ll,
if ( ALLOC_ARRAY( ll->Lookup, count, HB_Lookup ) ) if ( ALLOC_ARRAY( ll->Lookup, count, HB_Lookup ) )
return error; return error;
if ( ALLOC_ARRAY( ll->Properties, count, FT_UInt ) ) if ( ALLOC_ARRAY( ll->Properties, count, HB_UInt ) )
goto Fail2; goto Fail2;
l = ll->Lookup; l = ll->Lookup;
@ -626,7 +626,7 @@ HB_INTERNAL void
_HB_OPEN_Free_LookupList( HB_LookupList* ll, _HB_OPEN_Free_LookupList( HB_LookupList* ll,
HB_Type type ) HB_Type type )
{ {
FT_UShort n, count; HB_UShort n, count;
HB_Lookup* l; HB_Lookup* l;
@ -659,9 +659,9 @@ static HB_Error Load_Coverage1( HB_CoverageFormat1* cf1,
{ {
HB_Error error; HB_Error error;
FT_UShort n, count; HB_UShort n, count;
FT_UShort* ga; HB_UShort* ga;
if ( ACCESS_Frame( 2L ) ) if ( ACCESS_Frame( 2L ) )
@ -673,7 +673,7 @@ static HB_Error Load_Coverage1( HB_CoverageFormat1* cf1,
cf1->GlyphArray = NULL; cf1->GlyphArray = NULL;
if ( ALLOC_ARRAY( cf1->GlyphArray, count, FT_UShort ) ) if ( ALLOC_ARRAY( cf1->GlyphArray, count, HB_UShort ) )
return error; return error;
ga = cf1->GlyphArray; ga = cf1->GlyphArray;
@ -706,7 +706,7 @@ static HB_Error Load_Coverage2( HB_CoverageFormat2* cf2,
{ {
HB_Error error; HB_Error error;
FT_UShort n, count; HB_UShort n, count;
HB_RangeRecord* rr; HB_RangeRecord* rr;
@ -797,12 +797,12 @@ _HB_OPEN_Free_Coverage( HB_Coverage* c )
static HB_Error Coverage_Index1( HB_CoverageFormat1* cf1, static HB_Error Coverage_Index1( HB_CoverageFormat1* cf1,
FT_UShort glyphID, HB_UShort glyphID,
FT_UShort* index ) 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 */ /* binary search */
@ -847,10 +847,10 @@ static HB_Error Coverage_Index1( HB_CoverageFormat1* cf1,
static HB_Error Coverage_Index2( HB_CoverageFormat2* cf2, static HB_Error Coverage_Index2( HB_CoverageFormat2* cf2,
FT_UShort glyphID, HB_UShort glyphID,
FT_UShort* index ) 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; HB_RangeRecord* rr = cf2->RangeRecord;
@ -898,8 +898,8 @@ static HB_Error Coverage_Index2( HB_CoverageFormat2* cf2,
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_HB_OPEN_Coverage_Index( HB_Coverage* c, _HB_OPEN_Coverage_Index( HB_Coverage* c,
FT_UShort glyphID, HB_UShort glyphID,
FT_UShort* index ) HB_UShort* index )
{ {
switch ( c->CoverageFormat ) switch ( c->CoverageFormat )
{ {
@ -921,15 +921,15 @@ _HB_OPEN_Coverage_Index( HB_Coverage* c,
/* ClassDefFormat1 */ /* ClassDefFormat1 */
static HB_Error Load_ClassDef1( HB_ClassDefinition* cd, static HB_Error Load_ClassDef1( HB_ClassDefinition* cd,
FT_UShort limit, HB_UShort limit,
FT_Stream stream ) FT_Stream stream )
{ {
HB_Error error; HB_Error error;
FT_UShort n, count; HB_UShort n, count;
FT_UShort* cva; HB_UShort* cva;
FT_Bool* d; HB_Bool* d;
HB_ClassDefFormat1* cdf1; HB_ClassDefFormat1* cdf1;
@ -951,7 +951,7 @@ static HB_Error Load_ClassDef1( HB_ClassDefinition* cd,
cdf1->ClassValueArray = NULL; cdf1->ClassValueArray = NULL;
if ( ALLOC_ARRAY( cdf1->ClassValueArray, count, FT_UShort ) ) if ( ALLOC_ARRAY( cdf1->ClassValueArray, count, HB_UShort ) )
return error; return error;
d = cd->Defined; d = cd->Defined;
@ -991,15 +991,15 @@ static void Free_ClassDef1( HB_ClassDefFormat1* cdf1 )
/* ClassDefFormat2 */ /* ClassDefFormat2 */
static HB_Error Load_ClassDef2( HB_ClassDefinition* cd, static HB_Error Load_ClassDef2( HB_ClassDefinition* cd,
FT_UShort limit, HB_UShort limit,
FT_Stream stream ) FT_Stream stream )
{ {
HB_Error error; HB_Error error;
FT_UShort n, count; HB_UShort n, count;
HB_ClassRangeRecord* crr; HB_ClassRangeRecord* crr;
FT_Bool* d; HB_Bool* d;
HB_ClassDefFormat2* cdf2; HB_ClassDefFormat2* cdf2;
@ -1070,12 +1070,12 @@ static void Free_ClassDef2( HB_ClassDefFormat2* cdf2 )
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_HB_OPEN_Load_ClassDefinition( HB_ClassDefinition* cd, _HB_OPEN_Load_ClassDefinition( HB_ClassDefinition* cd,
FT_UShort limit, HB_UShort limit,
FT_Stream stream ) FT_Stream stream )
{ {
HB_Error error; HB_Error error;
if ( ALLOC_ARRAY( cd->Defined, limit, FT_Bool ) ) if ( ALLOC_ARRAY( cd->Defined, limit, HB_Bool ) )
return error; return error;
if ( ACCESS_Frame( 2L ) ) if ( ACCESS_Frame( 2L ) )
@ -1110,13 +1110,13 @@ _HB_OPEN_Load_EmptyClassDefinition( HB_ClassDefinition* cd )
{ {
HB_Error error; HB_Error error;
if ( ALLOC_ARRAY( cd->Defined, 1, FT_Bool ) ) if ( ALLOC_ARRAY( cd->Defined, 1, HB_Bool ) )
return error; return error;
cd->ClassFormat = 1; /* Meaningless */ cd->ClassFormat = 1; /* Meaningless */
cd->Defined[0] = FALSE; 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; goto Fail;
return HB_Err_Ok; return HB_Err_Ok;
@ -1128,13 +1128,13 @@ Fail:
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_HB_OPEN_Load_EmptyOrClassDefinition( HB_ClassDefinition* cd, _HB_OPEN_Load_EmptyOrClassDefinition( HB_ClassDefinition* cd,
FT_UShort limit, HB_UShort limit,
FT_ULong class_offset, HB_UInt class_offset,
FT_ULong base_offset, HB_UInt base_offset,
FT_Stream stream ) FT_Stream stream )
{ {
HB_Error error; HB_Error error;
FT_ULong cur_offset; HB_UInt cur_offset;
cur_offset = FILE_Pos(); cur_offset = FILE_Pos();
@ -1170,11 +1170,11 @@ _HB_OPEN_Free_ClassDefinition( HB_ClassDefinition* cd )
static HB_Error Get_Class1( HB_ClassDefFormat1* cdf1, static HB_Error Get_Class1( HB_ClassDefFormat1* cdf1,
FT_UShort glyphID, HB_UShort glyphID,
FT_UShort* klass, HB_UShort* klass,
FT_UShort* index ) HB_UShort* index )
{ {
FT_UShort* cva = cdf1->ClassValueArray; HB_UShort* cva = cdf1->ClassValueArray;
if ( index ) if ( index )
@ -1198,12 +1198,12 @@ static HB_Error Get_Class1( HB_ClassDefFormat1* cdf1,
in case of failure for constructed GDEF tables */ in case of failure for constructed GDEF tables */
static HB_Error Get_Class2( HB_ClassDefFormat2* cdf2, static HB_Error Get_Class2( HB_ClassDefFormat2* cdf2,
FT_UShort glyphID, HB_UShort glyphID,
FT_UShort* klass, HB_UShort* klass,
FT_UShort* index ) HB_UShort* index )
{ {
HB_Error error = HB_Err_Ok; 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; HB_ClassRangeRecord* crr = cdf2->ClassRangeRecord;
@ -1269,9 +1269,9 @@ static HB_Error Get_Class2( HB_ClassDefFormat2* cdf2,
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_HB_OPEN_Get_Class( HB_ClassDefinition* cd, _HB_OPEN_Get_Class( HB_ClassDefinition* cd,
FT_UShort glyphID, HB_UShort glyphID,
FT_UShort* klass, HB_UShort* klass,
FT_UShort* index ) HB_UShort* index )
{ {
switch ( cd->ClassFormat ) switch ( cd->ClassFormat )
{ {
@ -1296,9 +1296,9 @@ _HB_OPEN_Load_Device( HB_Device* d,
{ {
HB_Error error; HB_Error error;
FT_UShort n, count; HB_UShort n, count;
FT_UShort* dv; HB_UShort* dv;
if ( ACCESS_Frame( 6L ) ) if ( ACCESS_Frame( 6L ) )
@ -1326,7 +1326,7 @@ _HB_OPEN_Load_Device( HB_Device* d,
count = ( ( d->EndSize - d->StartSize + 1 ) >> count = ( ( d->EndSize - d->StartSize + 1 ) >>
( 4 - d->DeltaFormat ) ) + 1; ( 4 - d->DeltaFormat ) ) + 1;
if ( ALLOC_ARRAY( d->DeltaValue, count, FT_UShort ) ) if ( ALLOC_ARRAY( d->DeltaValue, count, HB_UShort ) )
return error; return error;
if ( ACCESS_Frame( count * 2L ) ) if ( ACCESS_Frame( count * 2L ) )
@ -1390,10 +1390,10 @@ _HB_OPEN_Free_Device( HB_Device* d )
HB_INTERNAL HB_Error HB_INTERNAL HB_Error
_HB_OPEN_Get_Device( HB_Device* d, _HB_OPEN_Get_Device( HB_Device* d,
FT_UShort size, HB_UShort size,
FT_Short* value ) HB_Short* value )
{ {
FT_UShort byte, bits, mask, f, s; HB_UShort byte, bits, mask, f, s;
f = d->DeltaFormat; f = d->DeltaFormat;
@ -1405,7 +1405,7 @@ _HB_OPEN_Get_Device( HB_Device* d,
bits = byte >> ( 16 - ( ( s % ( 1 << ( 4 - f ) ) + 1 ) << f ) ); bits = byte >> ( 16 - ( ( s % ( 1 << ( 4 - f ) ) + 1 ) << f ) );
mask = 0xFFFF >> ( 16 - ( 1 << f ) ); mask = 0xFFFF >> ( 16 - ( 1 << f ) );
*value = (FT_Short)( bits & mask ); *value = (HB_Short)( bits & mask );
/* conversion to a signed value */ /* conversion to a signed value */

View File

@ -16,7 +16,9 @@
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
FT_BEGIN_HEADER #include "harfbuzz-global.h"
HB_BEGIN_HEADER
/* Use this if a feature applies to all glyphs */ /* Use this if a feature applies to all glyphs */
#define HB_ALL_GLYPHS 0xFFFF #define HB_ALL_GLYPHS 0xFFFF
@ -46,10 +48,10 @@ typedef FT_Error HB_Error;
struct HB_LangSys_ struct HB_LangSys_
{ {
FT_UShort LookupOrderOffset; /* always 0 for TT Open 1.0 */ HB_UShort LookupOrderOffset; /* always 0 for TT Open 1.0 */
FT_UShort ReqFeatureIndex; /* required FeatureIndex */ HB_UShort ReqFeatureIndex; /* required FeatureIndex */
FT_UShort FeatureCount; /* number of Feature indices */ HB_UShort FeatureCount; /* number of Feature indices */
FT_UShort* FeatureIndex; /* array of Feature indices */ HB_UShort* FeatureIndex; /* array of Feature indices */
}; };
typedef struct HB_LangSys_ HB_LangSys; typedef struct HB_LangSys_ HB_LangSys;
@ -57,7 +59,7 @@ typedef struct HB_LangSys_ HB_LangSys;
struct HB_LangSysRecord_ struct HB_LangSysRecord_
{ {
FT_ULong LangSysTag; /* LangSysTag identifier */ HB_UInt LangSysTag; /* LangSysTag identifier */
HB_LangSys LangSys; /* LangSys table */ HB_LangSys LangSys; /* LangSys table */
}; };
@ -67,7 +69,7 @@ typedef struct HB_LangSysRecord_ HB_LangSysRecord;
struct HB_Script_ struct HB_Script_
{ {
HB_LangSys DefaultLangSys; /* DefaultLangSys table */ HB_LangSys DefaultLangSys; /* DefaultLangSys table */
FT_UShort LangSysCount; /* number of LangSysRecords */ HB_UShort LangSysCount; /* number of LangSysRecords */
HB_LangSysRecord* LangSysRecord; /* array of LangSysRecords */ HB_LangSysRecord* LangSysRecord; /* array of LangSysRecords */
}; };
@ -76,7 +78,7 @@ typedef struct HB_Script_ HB_Script;
struct HB_ScriptRecord_ struct HB_ScriptRecord_
{ {
FT_ULong ScriptTag; /* ScriptTag identifier */ HB_UInt ScriptTag; /* ScriptTag identifier */
HB_Script Script; /* Script table */ HB_Script Script; /* Script table */
}; };
@ -85,7 +87,7 @@ typedef struct HB_ScriptRecord_ HB_ScriptRecord;
struct HB_ScriptList_ struct HB_ScriptList_
{ {
FT_UShort ScriptCount; /* number of ScriptRecords */ HB_UShort ScriptCount; /* number of ScriptRecords */
HB_ScriptRecord* ScriptRecord; /* array of ScriptRecords */ HB_ScriptRecord* ScriptRecord; /* array of ScriptRecords */
}; };
@ -96,9 +98,9 @@ typedef struct HB_ScriptList_ HB_ScriptList;
struct HB_Feature_ struct HB_Feature_
{ {
FT_UShort FeatureParams; /* always 0 for TT Open 1.0 */ HB_UShort FeatureParams; /* always 0 for TT Open 1.0 */
FT_UShort LookupListCount; /* number of LookupList indices */ HB_UShort LookupListCount; /* number of LookupList indices */
FT_UShort* LookupListIndex; /* array of LookupList indices */ HB_UShort* LookupListIndex; /* array of LookupList indices */
}; };
typedef struct HB_Feature_ HB_Feature; typedef struct HB_Feature_ HB_Feature;
@ -106,7 +108,7 @@ typedef struct HB_Feature_ HB_Feature;
struct HB_FeatureRecord_ struct HB_FeatureRecord_
{ {
FT_ULong FeatureTag; /* FeatureTag identifier */ HB_UInt FeatureTag; /* FeatureTag identifier */
HB_Feature Feature; /* Feature table */ HB_Feature Feature; /* Feature table */
}; };
@ -115,10 +117,10 @@ typedef struct HB_FeatureRecord_ HB_FeatureRecord;
struct HB_FeatureList_ struct HB_FeatureList_
{ {
FT_UShort FeatureCount; /* number of FeatureRecords */ HB_UShort FeatureCount; /* number of FeatureRecords */
HB_FeatureRecord* FeatureRecord; /* array of FeatureRecords */ HB_FeatureRecord* FeatureRecord; /* array of FeatureRecords */
FT_UShort* ApplyOrder; /* order to apply features */ HB_UShort* ApplyOrder; /* order to apply features */
FT_UShort ApplyCount; /* number of elements in ApplyOrder */ HB_UShort ApplyCount; /* number of elements in ApplyOrder */
}; };
typedef struct HB_FeatureList_ HB_FeatureList; typedef struct HB_FeatureList_ HB_FeatureList;
@ -131,9 +133,9 @@ typedef struct HB_SubTable_ HB_SubTable;
struct HB_Lookup_ struct HB_Lookup_
{ {
FT_UShort LookupType; /* Lookup type */ HB_UShort LookupType; /* Lookup type */
FT_UShort LookupFlag; /* Lookup qualifiers */ HB_UShort LookupFlag; /* Lookup qualifiers */
FT_UShort SubTableCount; /* number of SubTables */ HB_UShort SubTableCount; /* number of SubTables */
HB_SubTable* SubTable; /* array of SubTables */ HB_SubTable* SubTable; /* array of SubTables */
}; };
@ -148,9 +150,9 @@ typedef struct HB_Lookup_ HB_Lookup;
struct HB_LookupList_ struct HB_LookupList_
{ {
FT_UShort LookupCount; /* number of Lookups */ HB_UShort LookupCount; /* number of Lookups */
HB_Lookup* Lookup; /* array of Lookup records */ 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; typedef struct HB_LookupList_ HB_LookupList;
@ -171,8 +173,8 @@ typedef struct HB_LookupList_ HB_LookupList;
struct HB_CoverageFormat1_ struct HB_CoverageFormat1_
{ {
FT_UShort GlyphCount; /* number of glyphs in GlyphArray */ HB_UShort GlyphCount; /* number of glyphs in GlyphArray */
FT_UShort* GlyphArray; /* array of glyph IDs */ HB_UShort* GlyphArray; /* array of glyph IDs */
}; };
typedef struct HB_CoverageFormat1_ HB_CoverageFormat1; typedef struct HB_CoverageFormat1_ HB_CoverageFormat1;
@ -180,9 +182,9 @@ typedef struct HB_CoverageFormat1_ HB_CoverageFormat1;
struct HB_RangeRecord_ struct HB_RangeRecord_
{ {
FT_UShort Start; /* first glyph ID in the range */ HB_UShort Start; /* first glyph ID in the range */
FT_UShort End; /* last glyph ID in the range */ HB_UShort End; /* last glyph ID in the range */
FT_UShort StartCoverageIndex; /* coverage index of first HB_UShort StartCoverageIndex; /* coverage index of first
glyph ID in the range */ glyph ID in the range */
}; };
@ -191,7 +193,7 @@ typedef struct HB_RangeRecord_ HB_RangeRecord;
struct HB_CoverageFormat2_ struct HB_CoverageFormat2_
{ {
FT_UShort RangeCount; /* number of RangeRecords */ HB_UShort RangeCount; /* number of RangeRecords */
HB_RangeRecord* RangeRecord; /* array of RangeRecords */ HB_RangeRecord* RangeRecord; /* array of RangeRecords */
}; };
@ -200,7 +202,7 @@ typedef struct HB_CoverageFormat2_ HB_CoverageFormat2;
struct HB_Coverage_ struct HB_Coverage_
{ {
FT_UShort CoverageFormat; /* 1 or 2 */ HB_UShort CoverageFormat; /* 1 or 2 */
union union
{ {
@ -214,10 +216,10 @@ typedef struct HB_Coverage_ HB_Coverage;
struct HB_ClassDefFormat1_ struct HB_ClassDefFormat1_
{ {
FT_UShort StartGlyph; /* first glyph ID of the HB_UShort StartGlyph; /* first glyph ID of the
ClassValueArray */ ClassValueArray */
FT_UShort GlyphCount; /* size of the ClassValueArray */ HB_UShort GlyphCount; /* size of the ClassValueArray */
FT_UShort* ClassValueArray; /* array of class values */ HB_UShort* ClassValueArray; /* array of class values */
}; };
typedef struct HB_ClassDefFormat1_ HB_ClassDefFormat1; typedef struct HB_ClassDefFormat1_ HB_ClassDefFormat1;
@ -225,9 +227,9 @@ typedef struct HB_ClassDefFormat1_ HB_ClassDefFormat1;
struct HB_ClassRangeRecord_ struct HB_ClassRangeRecord_
{ {
FT_UShort Start; /* first glyph ID in the range */ HB_UShort Start; /* first glyph ID in the range */
FT_UShort End; /* last glyph ID in the range */ HB_UShort End; /* last glyph ID in the range */
FT_UShort Class; /* applied to all glyphs in range */ HB_UShort Class; /* applied to all glyphs in range */
}; };
typedef struct HB_ClassRangeRecord_ HB_ClassRangeRecord; typedef struct HB_ClassRangeRecord_ HB_ClassRangeRecord;
@ -235,7 +237,7 @@ typedef struct HB_ClassRangeRecord_ HB_ClassRangeRecord;
struct HB_ClassDefFormat2_ struct HB_ClassDefFormat2_
{ {
FT_UShort ClassRangeCount; HB_UShort ClassRangeCount;
/* number of ClassRangeRecords */ /* number of ClassRangeRecords */
HB_ClassRangeRecord* ClassRangeRecord; HB_ClassRangeRecord* ClassRangeRecord;
/* array of ClassRangeRecords */ /* array of ClassRangeRecords */
@ -251,12 +253,12 @@ typedef struct HB_ClassDefFormat2_ HB_ClassDefFormat2;
struct HB_ClassDefinition_ 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, If Defined[n] is FALSE,
class n contains no glyphs. */ class n contains no glyphs. */
FT_UShort ClassFormat; /* 1 or 2 */ HB_UShort ClassFormat; /* 1 or 2 */
union union
{ {
@ -270,11 +272,11 @@ typedef struct HB_ClassDefinition_ HB_ClassDefinition;
struct HB_Device_ struct HB_Device_
{ {
FT_UShort StartSize; /* smallest size to correct */ HB_UShort StartSize; /* smallest size to correct */
FT_UShort EndSize; /* largest size to correct */ HB_UShort EndSize; /* largest size to correct */
FT_UShort DeltaFormat; /* DeltaValue array data format: HB_UShort DeltaFormat; /* DeltaValue array data format:
1, 2, or 3 */ 1, 2, or 3 */
FT_UShort* DeltaValue; /* array of compressed data */ HB_UShort* DeltaValue; /* array of compressed data */
}; };
typedef struct HB_Device_ HB_Device; typedef struct HB_Device_ HB_Device;
@ -289,6 +291,6 @@ enum HB_Type_
typedef enum HB_Type_ HB_Type; typedef enum HB_Type_ HB_Type;
FT_END_HEADER HB_END_HEADER
#endif /* HARFBUZZ_OPEN_H */ #endif /* HARFBUZZ_OPEN_H */

View File

@ -13,6 +13,7 @@
#ifndef HARFBUZZ_H #ifndef HARFBUZZ_H
#define HARFBUZZ_H #define HARFBUZZ_H
#include "harfbuzz-global.h"
#include "harfbuzz-open.h" #include "harfbuzz-open.h"
#include "harfbuzz-buffer.h" #include "harfbuzz-buffer.h"
#include "harfbuzz-gdef.h" #include "harfbuzz-gdef.h"