PUBLICHEADERS = \
harfbuzz.h \
+ harfbuzz-global.h \
harfbuzz-buffer.h \
harfbuzz-gdef.h \
harfbuzz-gpos.h \
/* only used internally */
static FT_Pointer
-_hb_ftglue_qalloc( FT_ULong size,
+_hb_ftglue_qalloc( HB_UInt size,
HB_Error *perror )
{
HB_Error error = 0;
HB_INTERNAL FT_Pointer
-_hb_ftglue_alloc( FT_ULong size,
+_hb_ftglue_alloc( HB_UInt size,
HB_Error *perror )
{
HB_Error error = 0;
HB_INTERNAL FT_Pointer
_hb_ftglue_realloc( FT_Pointer block,
- FT_ULong new_size,
+ HB_UInt new_size,
HB_Error *perror )
{
FT_Pointer block2 = NULL;
}
-HB_INTERNAL FT_Long
+HB_INTERNAL HB_Int
_hb_ftglue_stream_pos( FT_Stream stream )
{
LOG(( "ftglue:stream:pos() -> %ld\n", stream->pos ));
HB_INTERNAL HB_Error
_hb_ftglue_stream_seek( FT_Stream stream,
- FT_Long pos )
+ HB_Int pos )
{
HB_Error error = 0;
if ( stream->read( stream, pos, NULL, 0 ) )
error = HB_Err_Invalid_Stream_Operation;
}
- else if ( pos > (FT_Long)stream->size )
+ else if ( pos > (HB_Int)stream->size )
error = HB_Err_Invalid_Stream_Operation;
LOG(( "ftglue:stream:seek(%ld) -> %d\n", pos, error ));
HB_INTERNAL HB_Error
_hb_ftglue_stream_frame_enter( FT_Stream stream,
- FT_ULong count )
+ HB_UInt count )
{
HB_Error error = HB_Err_Ok;
- FT_ULong read_bytes;
+ HB_UInt read_bytes;
if ( stream->read )
{
HB_INTERNAL HB_Error
_hb_ftglue_face_goto_table( FT_Face face,
- FT_ULong the_tag,
+ HB_UInt the_tag,
FT_Stream stream )
{
HB_Error error;
/* parse the directory table directly, without using
* FreeType's built-in data structures
*/
- FT_ULong offset = 0;
- FT_UInt count, nn;
+ HB_UInt offset = 0;
+ HB_UInt count, nn;
if ( face->num_faces > 1 )
{
for ( nn = 0; nn < count; nn++ )
{
- FT_ULong tag = GET_ULong();
- FT_ULong checksum = GET_ULong();
- FT_ULong start = GET_ULong();
- FT_ULong size = GET_ULong();
+ HB_UInt tag = GET_ULong();
+ HB_UInt checksum = GET_ULong();
+ HB_UInt start = GET_ULong();
+ HB_UInt size = GET_ULong();
FT_UNUSED(checksum);
FT_UNUSED(size);
#include <ft2build.h>
#include FT_FREETYPE_H
-#include "harfbuzz-impl.h"
#include "harfbuzz-open.h"
+#include "harfbuzz-impl.h"
-FT_BEGIN_HEADER
+HB_BEGIN_HEADER
/* utility macros */
#define FORGET_Frame() _hb_ftglue_stream_frame_exit( stream )
#define GET_Byte() (*stream->cursor++)
-#define GET_Short() (stream->cursor += 2, (FT_Short)( \
+#define GET_Short() (stream->cursor += 2, (HB_Short)( \
(*(((FT_Byte*)stream->cursor)-2) << 8) | \
*(((FT_Byte*)stream->cursor)-1) \
))
-#define GET_Long() (stream->cursor += 4, (FT_Long)( \
+#define GET_Long() (stream->cursor += 4, (HB_Int)( \
(*(((FT_Byte*)stream->cursor)-4) << 24) | \
(*(((FT_Byte*)stream->cursor)-3) << 16) | \
(*(((FT_Byte*)stream->cursor)-2) << 8) | \
#define GET_Char() ((FT_Char)GET_Byte())
-#define GET_UShort() ((FT_UShort)GET_Short())
-#define GET_ULong() ((FT_ULong)GET_Long())
+#define GET_UShort() ((HB_UShort)GET_Short())
+#define GET_ULong() ((HB_UInt)GET_Long())
#define GET_Tag4() GET_ULong()
-HB_INTERNAL FT_Long
+HB_INTERNAL HB_Int
_hb_ftglue_stream_pos( FT_Stream stream );
HB_INTERNAL HB_Error
_hb_ftglue_stream_seek( FT_Stream stream,
- FT_Long pos );
+ HB_Int pos );
HB_INTERNAL HB_Error
_hb_ftglue_stream_frame_enter( FT_Stream stream,
- FT_ULong size );
+ HB_UInt size );
HB_INTERNAL void
_hb_ftglue_stream_frame_exit( FT_Stream stream );
HB_INTERNAL HB_Error
_hb_ftglue_face_goto_table( FT_Face face,
- FT_ULong tag,
+ HB_UInt tag,
FT_Stream stream );
/* memory macros used by the OpenType parser */
HB_INTERNAL FT_Pointer
-_hb_ftglue_alloc( FT_ULong size,
+_hb_ftglue_alloc( HB_UInt size,
HB_Error *perror_ );
HB_INTERNAL FT_Pointer
_hb_ftglue_realloc( FT_Pointer block,
- FT_ULong new_size,
+ HB_UInt new_size,
HB_Error *perror_ );
HB_INTERNAL void
HB_INTERNAL HB_Error
_hb_err (HB_Error code);
-FT_END_HEADER
+HB_END_HEADER
#endif /* FTGLUE_H */
#include "harfbuzz-impl.h"
#include "harfbuzz-buffer.h"
-FT_BEGIN_HEADER
+HB_BEGIN_HEADER
#define HB_GLYPH_PROPERTIES_UNKNOWN 0xFFFF
HB_INTERNAL HB_Error
_hb_buffer_add_output_glyphs( HB_Buffer buffer,
- FT_UShort num_in,
- FT_UShort num_out,
- FT_UShort *glyph_data,
- FT_UShort component,
- FT_UShort ligID );
+ HB_UShort num_in,
+ HB_UShort num_out,
+ HB_UShort *glyph_data,
+ HB_UShort component,
+ HB_UShort ligID );
HB_INTERNAL HB_Error
_hb_buffer_add_output_glyph ( HB_Buffer buffer,
- FT_UInt glyph_index,
- FT_UShort component,
- FT_UShort ligID );
+ HB_UInt glyph_index,
+ HB_UShort component,
+ HB_UShort ligID );
HB_INTERNAL HB_Error
_hb_buffer_copy_output_glyph ( HB_Buffer buffer );
HB_INTERNAL HB_Error
_hb_buffer_replace_output_glyph ( HB_Buffer buffer,
- FT_UInt glyph_index,
- FT_Bool inplace );
+ HB_UInt glyph_index,
+ HB_Bool inplace );
-HB_INTERNAL FT_UShort
+HB_INTERNAL HB_UShort
_hb_buffer_allocate_ligid( HB_Buffer buffer );
-FT_END_HEADER
+HB_END_HEADER
#endif /* HARFBUZZ_BUFFER_PRIVATE_H */
static HB_Error
hb_buffer_ensure( HB_Buffer buffer,
- FT_ULong size )
+ HB_UInt size )
{
- FT_ULong new_allocated = buffer->allocated;
+ HB_UInt new_allocated = buffer->allocated;
if (size > new_allocated)
{
HB_Error
hb_buffer_add_glyph( HB_Buffer buffer,
- FT_UInt glyph_index,
- FT_UInt properties,
- FT_UInt cluster )
+ HB_UInt glyph_index,
+ HB_UInt properties,
+ HB_UInt cluster )
{
HB_Error error;
HB_GlyphItem glyph;
for all replacement glyphs */
HB_INTERNAL HB_Error
_hb_buffer_add_output_glyphs( HB_Buffer buffer,
- FT_UShort num_in,
- FT_UShort num_out,
- FT_UShort *glyph_data,
- FT_UShort component,
- FT_UShort ligID )
+ HB_UShort num_in,
+ HB_UShort num_out,
+ HB_UShort *glyph_data,
+ HB_UShort component,
+ HB_UShort ligID )
{
HB_Error error;
- FT_UShort i;
- FT_UInt properties;
- FT_UInt cluster;
+ HB_UShort i;
+ HB_UInt properties;
+ HB_UInt cluster;
error = hb_buffer_ensure( buffer, buffer->out_pos + num_out );
if ( error )
HB_INTERNAL HB_Error
_hb_buffer_add_output_glyph( HB_Buffer buffer,
- FT_UInt glyph_index,
- FT_UShort component,
- FT_UShort ligID )
+ HB_UInt glyph_index,
+ HB_UShort component,
+ HB_UShort ligID )
{
- FT_UShort glyph_data = glyph_index;
+ HB_UShort glyph_data = glyph_index;
return _hb_buffer_add_output_glyphs ( buffer, 1, 1,
&glyph_data, component, ligID );
HB_INTERNAL HB_Error
_hb_buffer_replace_output_glyph( HB_Buffer buffer,
- FT_UInt glyph_index,
- FT_Bool inplace )
+ HB_UInt glyph_index,
+ HB_Bool inplace )
{
HB_Error error;
return HB_Err_Ok;
}
-HB_INTERNAL FT_UShort
+HB_INTERNAL HB_UShort
_hb_buffer_allocate_ligid( HB_Buffer buffer )
{
buffer->max_ligID++;
#include <ft2build.h>
#include FT_FREETYPE_H
-FT_BEGIN_HEADER
+HB_BEGIN_HEADER
typedef struct HB_GlyphItemRec_ {
- FT_UInt gindex;
- FT_UInt properties;
- FT_UInt cluster;
- FT_UShort component;
- FT_UShort ligID;
- FT_UShort gproperties;
+ HB_UInt gindex;
+ HB_UInt properties;
+ HB_UInt cluster;
+ HB_UShort component;
+ HB_UShort ligID;
+ HB_UShort gproperties;
} HB_GlyphItemRec, *HB_GlyphItem;
typedef struct HB_PositionRec_ {
FT_Pos y_pos;
FT_Pos x_advance;
FT_Pos y_advance;
- FT_UShort back; /* number of glyphs to go back
+ HB_UShort back; /* number of glyphs to go back
for drawing current glyph */
- FT_Bool new_advance; /* if set, the advance width values are
+ HB_Bool new_advance; /* if set, the advance width values are
absolute, i.e., they won't be
added to the original glyph's value
but rather replace them. */
- FT_Short cursive_chain; /* character to which this connects,
+ HB_Short cursive_chain; /* character to which this connects,
may be positive or negative; used
only internally */
} HB_PositionRec, *HB_Position;
typedef struct HB_BufferRec_{
- FT_ULong allocated;
+ HB_UInt allocated;
- FT_ULong in_length;
- FT_ULong out_length;
- FT_ULong in_pos;
- FT_ULong out_pos;
+ HB_UInt in_length;
+ HB_UInt out_length;
+ HB_UInt in_pos;
+ HB_UInt out_pos;
- FT_Bool separate_out;
+ HB_Bool separate_out;
HB_GlyphItem in_string;
HB_GlyphItem out_string;
HB_GlyphItem alt_string;
HB_Position positions;
- FT_UShort max_ligID;
+ HB_UShort max_ligID;
} HB_BufferRec, *HB_Buffer;
HB_Error
HB_Error
hb_buffer_add_glyph( HB_Buffer buffer,
- FT_UInt glyph_index,
- FT_UInt properties,
- FT_UInt cluster );
+ HB_UInt glyph_index,
+ HB_UInt properties,
+ HB_UInt cluster );
-FT_END_HEADER
+HB_END_HEADER
#endif /* HARFBUZZ_BUFFER_H */
};
static void
-print_tag (FT_ULong tag)
+print_tag (HB_UInt tag)
{
fprintf (stderr, "%c%c%c%c",
(unsigned char)(tag >> 24),
static void
maybe_add_feature (HB_GSUB gsub,
- FT_UShort script_index,
- FT_ULong tag,
- FT_UShort property)
+ HB_UShort script_index,
+ HB_UInt tag,
+ HB_UShort property)
{
HB_Error error;
- FT_UShort feature_index;
+ HB_UShort feature_index;
/* 0xffff == default language system */
error = HB_GSUB_Select_Feature (gsub, tag, script_index, 0xffff, &feature_index);
static void
select_cmap (FT_Face face)
{
- FT_UShort i;
+ HB_UShort i;
FT_CharMap cmap = NULL;
for (i = 0; i < face->num_charmaps; i++)
add_features (HB_GSUB gsub)
{
HB_Error error;
- FT_ULong tag = FT_MAKE_TAG ('a', 'r', 'a', 'b');
- FT_UShort script_index;
+ HB_UInt tag = FT_MAKE_TAG ('a', 'r', 'a', 'b');
+ HB_UShort script_index;
error = HB_GSUB_Select_Script (gsub, tag, &script_index);
void
dump_string (HB_GSUB_String *str)
{
- FT_ULong i;
+ HB_UInt i;
fprintf (stderr, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
for (i = 0; i < str->length; i++)
fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
}
-FT_UShort arabic_str[] = { 0x645, 0x643, 0x64a, 0x644, 0x639, 0x20, 0x645, 0x627, 0x644, 0x633, 0x644, 0x627 };
-FT_UShort arabic_props[] = { I|L, M|L, M|L, M|L, M|L, F|L, I|L, M|L, M|L, M|L, M|L, F|L };
+HB_UShort arabic_str[] = { 0x645, 0x643, 0x64a, 0x644, 0x639, 0x20, 0x645, 0x627, 0x644, 0x633, 0x644, 0x627 };
+HB_UShort arabic_props[] = { I|L, M|L, M|L, M|L, M|L, F|L, I|L, M|L, M|L, M|L, M|L, F|L };
void
try_string (FT_Library library,
HB_Error error;
HB_GSUB_String *in_str;
HB_GSUB_String *out_str;
- FT_ULong i;
+ HB_UInt i;
if ((error = HB_GSUB_String_New (face->memory, &in_str)))
croak ("HB_GSUB_String_New", error);
}
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;
}
static void
-Print_Tag (FT_ULong tag, FILE *stream)
+Print_Tag (HB_UInt tag, FILE *stream)
{
fprintf (stream, "%c%c%c%c",
(unsigned char)(tag >> 24),
for (i = Device->StartSize; i <= Device->EndSize ; i++)
{
- FT_UShort val = Device->DeltaValue[i / n_per];
- FT_Short signed_val = ((val << ((i % n_per) * bits)) & mask);
+ HB_UShort val = Device->DeltaValue[i / n_per];
+ HB_Short signed_val = ((val << ((i % n_per) * bits)) & mask);
dump (stream, indent, "%d", signed_val >> (16 - bits));
if (i != Device->EndSize)
DUMP (", ");
}
static void
-Dump_ValueRecord (HB_ValueRecord *ValueRecord, FILE *stream, int indent, HB_Type hb_type, FT_UShort value_format)
+Dump_ValueRecord (HB_ValueRecord *ValueRecord, FILE *stream, int indent, HB_Type hb_type, HB_UShort value_format)
{
if (value_format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT)
DUMP_FINT (ValueRecord, XPlacement);
}
static void
-Dump_PairValueRecord (HB_PairValueRecord *PairValueRecord, FILE *stream, int indent, HB_Type hb_type, FT_UShort ValueFormat1, FT_UShort ValueFormat2)
+Dump_PairValueRecord (HB_PairValueRecord *PairValueRecord, FILE *stream, int indent, HB_Type hb_type, HB_UShort ValueFormat1, HB_UShort ValueFormat2)
{
DUMP_FUINT (PairValueRecord, SecondGlyph);
DUMP_VALUE_RECORD (&PairValueRecord->Value1, ValueFormat1);
}
static void
-Dump_PairSet (HB_PairSet *PairSet, FILE *stream, int indent, HB_Type hb_type, FT_UShort ValueFormat1, FT_UShort ValueFormat2)
+Dump_PairSet (HB_PairSet *PairSet, FILE *stream, int indent, HB_Type hb_type, HB_UShort ValueFormat1, HB_UShort ValueFormat2)
{
int i;
DUMP_FUINT (PairSet, PairValueCount);
#include "harfbuzz-gsub.h"
#include "harfbuzz-gpos.h"
-FT_BEGIN_HEADER
+HB_BEGIN_HEADER
void HB_Dump_GSUB_Table (HB_GSUB gsub, FILE *stream);
void HB_Dump_GPOS_Table (HB_GPOS gpos, FILE *stream);
-FT_END_HEADER
+HB_END_HEADER
#endif /* HARFBUZZ_DUMP_H */
#include "harfbuzz-gdef.h"
#include "harfbuzz-buffer.h"
-FT_BEGIN_HEADER
+HB_BEGIN_HEADER
/* Attachment related structures */
struct HB_AttachPoint_
{
- FT_UShort PointCount; /* size of the PointIndex array */
- FT_UShort* PointIndex; /* array of contour points */
+ HB_UShort PointCount; /* size of the PointIndex array */
+ HB_UShort* PointIndex; /* array of contour points */
};
/* Ligature Caret related structures */
struct HB_CaretValueFormat1_
{
- FT_Short Coordinate; /* x or y value (in design units) */
+ HB_Short Coordinate; /* x or y value (in design units) */
};
typedef struct HB_CaretValueFormat1_ HB_CaretValueFormat1;
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;
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 */
};
struct HB_CaretValueFormat4_
{
- FT_UShort IdCaretValue; /* metric ID */
+ HB_UShort IdCaretValue; /* metric ID */
};
typedef struct HB_CaretValueFormat4_ HB_CaretValueFormat4;
struct HB_CaretValue_
{
- FT_UShort CaretValueFormat; /* 1, 2, 3, or 4 */
+ HB_UShort CaretValueFormat; /* 1, 2, 3, or 4 */
union
{
struct HB_LigGlyph_
{
- FT_Bool loaded;
+ HB_Bool loaded;
- FT_UShort CaretCount; /* number of caret values */
+ HB_UShort CaretCount; /* number of caret values */
HB_CaretValue* CaretValue; /* array of caret values */
};
HB_INTERNAL HB_Error
_HB_GDEF_Add_Glyph_Property( HB_GDEFHeader* gdef,
- FT_UShort glyphID,
- FT_UShort property );
+ HB_UShort glyphID,
+ HB_UShort property );
HB_INTERNAL HB_Error
_HB_GDEF_Check_Property( HB_GDEFHeader* gdef,
HB_GlyphItem item,
- FT_UShort flags,
- FT_UShort* property );
+ HB_UShort flags,
+ HB_UShort* property );
-FT_END_HEADER
+HB_END_HEADER
#endif /* HARFBUZZ_GDEF_PRIVATE_H */
{
HB_Error error;
FT_Stream stream = face->stream;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_GDEFHeader* gdef;
{
HB_Error error;
- FT_UShort n, count;
- FT_UShort* pi;
+ HB_UShort n, count;
+ HB_UShort* pi;
if ( ACCESS_Frame( 2L ) )
if ( count )
{
- if ( ALLOC_ARRAY( ap->PointIndex, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( ap->PointIndex, count, HB_UShort ) )
return error;
pi = ap->PointIndex;
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_AttachPoint* ap;
static void Free_AttachList( HB_AttachList* al )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_AttachPoint* ap;
{
HB_Error error;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UInt cur_offset, new_offset, base_offset;
base_offset = FILE_Pos();
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_CaretValue* cv;
static void Free_LigGlyph( HB_LigGlyph* lg )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_CaretValue* cv;
{
HB_Error error;
- FT_UShort m, n, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort m, n, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_LigGlyph* lg;
static void Free_LigCaretList( HB_LigCaretList* lcl )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_LigGlyph* lg;
***********/
-static FT_UShort Get_New_Class( HB_GDEFHeader* gdef,
- FT_UShort glyphID,
- FT_UShort index )
+static HB_UShort Get_New_Class( HB_GDEFHeader* gdef,
+ HB_UShort glyphID,
+ HB_UShort index )
{
- FT_UShort glyph_index, array_index, count;
- FT_UShort byte, bits;
+ HB_UShort glyph_index, array_index, count;
+ HB_UShort byte, bits;
HB_ClassRangeRecord* gcrr;
- FT_UShort** ngc;
+ HB_UShort** ngc;
if ( glyphID >= gdef->LastGlyph )
HB_Error HB_GDEF_Get_Glyph_Property( HB_GDEFHeader* gdef,
- FT_UShort glyphID,
- FT_UShort* property )
+ HB_UShort glyphID,
+ HB_UShort* property )
{
- FT_UShort class = 0, index = 0; /* shut compiler up */
+ HB_UShort class = 0, index = 0; /* shut compiler up */
HB_Error error;
static HB_Error Make_ClassRange( HB_ClassDefinition* cd,
- FT_UShort start,
- FT_UShort end,
- FT_UShort class )
+ HB_UShort start,
+ HB_UShort end,
+ HB_UShort class )
{
HB_Error error;
- FT_UShort index;
+ HB_UShort index;
HB_ClassDefFormat2* cdf2;
HB_ClassRangeRecord* crr;
HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef,
- FT_UShort num_glyphs,
- FT_UShort glyph_count,
- FT_UShort* glyph_array,
- FT_UShort* class_array )
+ HB_UShort num_glyphs,
+ HB_UShort glyph_count,
+ HB_UShort* glyph_array,
+ HB_UShort* class_array )
{
- FT_UShort start, curr_glyph, curr_class;
- FT_UShort n, m, count;
+ HB_UShort start, curr_glyph, curr_class;
+ HB_UShort n, m, count;
HB_Error error;
HB_ClassDefinition* gcd;
HB_ClassRangeRecord* gcrr;
- FT_UShort** ngc;
+ HB_UShort** ngc;
if ( !gdef || !glyph_array || !class_array )
/* A GlyphClassDef table contains at most 5 different class values */
- if ( ALLOC_ARRAY( gcd->Defined, 5, FT_Bool ) )
+ if ( ALLOC_ARRAY( gcd->Defined, 5, HB_Bool ) )
return error;
gcd->cd.cd2.ClassRangeCount = 0;
process */
if ( ALLOC_ARRAY( gdef->NewGlyphClasses,
- gcd->cd.cd2.ClassRangeCount + 1, FT_UShort* ) )
+ gcd->cd.cd2.ClassRangeCount + 1, HB_UShort* ) )
goto Fail3;
count = gcd->cd.cd2.ClassRangeCount;
{
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;
}
if ( gcrr[n].Start - gcrr[n - 1].End > 1 )
if ( ALLOC_ARRAY( ngc[n],
( gcrr[n].Start - gcrr[n - 1].End + 2 ) / 4,
- FT_UShort ) )
+ HB_UShort ) )
goto Fail1;
}
{
if ( ALLOC_ARRAY( ngc[count],
( num_glyphs - gcrr[count - 1].End + 2 ) / 4,
- FT_UShort ) )
+ HB_UShort ) )
goto Fail1;
}
}
{
if ( ALLOC_ARRAY( ngc[count],
( num_glyphs + 3 ) / 4,
- FT_UShort ) )
+ HB_UShort ) )
goto Fail2;
}
static void Free_NewGlyphClasses( HB_GDEFHeader* gdef )
{
- FT_UShort** ngc;
- FT_UShort n, count;
+ HB_UShort** ngc;
+ HB_UShort n, count;
if ( gdef->NewGlyphClasses )
HB_INTERNAL HB_Error
_HB_GDEF_Add_Glyph_Property( HB_GDEFHeader* gdef,
- FT_UShort glyphID,
- FT_UShort property )
+ HB_UShort glyphID,
+ HB_UShort property )
{
HB_Error error;
- FT_UShort class, new_class, index = 0; /* shut compiler up */
- FT_UShort byte, bits, mask;
- FT_UShort array_index, glyph_index, count;
+ HB_UShort class, new_class, index = 0; /* shut compiler up */
+ HB_UShort byte, bits, mask;
+ HB_UShort array_index, glyph_index, count;
HB_ClassRangeRecord* gcrr;
- FT_UShort** ngc;
+ HB_UShort** ngc;
error = _HB_OPEN_Get_Class( &gdef->GlyphClassDef, glyphID, &class, &index );
HB_INTERNAL HB_Error
_HB_GDEF_Check_Property( HB_GDEFHeader* gdef,
HB_GlyphItem gitem,
- FT_UShort flags,
- FT_UShort* property )
+ HB_UShort flags,
+ HB_UShort* property )
{
HB_Error error;
if ( gdef )
{
- FT_UShort basic_glyph_class;
- FT_UShort desired_attachment_class;
+ HB_UShort basic_glyph_class;
+ HB_UShort desired_attachment_class;
if ( gitem->gproperties == HB_GLYPH_PROPERTIES_UNKNOWN )
{
#include "harfbuzz-open.h"
-FT_BEGIN_HEADER
+HB_BEGIN_HEADER
#define HB_Err_Invalid_GDEF_SubTable_Format 0x1030
#define HB_Err_Invalid_GDEF_SubTable 0x1031
struct HB_AttachList_
{
- FT_Bool loaded;
+ HB_Bool loaded;
HB_Coverage Coverage; /* Coverage table */
- FT_UShort GlyphCount; /* number of glyphs with
+ HB_UShort GlyphCount; /* number of glyphs with
attachments */
HB_AttachPoint* AttachPoint; /* array of AttachPoint tables */
};
struct HB_LigCaretList_
{
- FT_Bool loaded;
+ HB_Bool loaded;
HB_Coverage Coverage; /* Coverage table */
- FT_UShort LigGlyphCount; /* number of ligature glyphs */
+ HB_UShort LigGlyphCount; /* number of ligature glyphs */
HB_LigGlyph* LigGlyph; /* array of LigGlyph tables */
};
struct HB_GDEFHeader_
{
- FT_ULong offset;
+ HB_UInt offset;
FT_Fixed Version;
HB_ClassDefinition GlyphClassDef;
HB_AttachList AttachList;
HB_LigCaretList LigCaretList;
- FT_ULong MarkAttachClassDef_offset;
+ HB_UInt MarkAttachClassDef_offset;
HB_ClassDefinition MarkAttachClassDef; /* new in OT 1.2 */
- FT_UShort LastGlyph;
- FT_UShort** NewGlyphClasses;
+ HB_UShort LastGlyph;
+ HB_UShort** NewGlyphClasses;
};
typedef struct HB_GDEFHeader_ HB_GDEFHeader;
HB_Error HB_GDEF_Get_Glyph_Property( HB_GDEFHeader* gdef,
- FT_UShort glyphID,
- FT_UShort* property );
+ HB_UShort glyphID,
+ HB_UShort* property );
HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef,
- FT_UShort num_glyphs,
- FT_UShort glyph_count,
- FT_UShort* glyph_array,
- FT_UShort* class_array );
+ HB_UShort num_glyphs,
+ HB_UShort glyph_count,
+ HB_UShort* glyph_array,
+ HB_UShort* class_array );
-FT_END_HEADER
+HB_END_HEADER
#endif /* HARFBUZZ_GDEF_H */
--- /dev/null
+/*******************************************************************
+ *
+ * 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
#include "harfbuzz-impl.h"
#include "harfbuzz-gpos.h"
-FT_BEGIN_HEADER
+HB_BEGIN_HEADER
/* shared tables */
struct HB_ValueRecord_
{
- FT_Short XPlacement; /* horizontal adjustment for
+ HB_Short XPlacement; /* horizontal adjustment for
placement */
- FT_Short YPlacement; /* vertical adjustment for
+ HB_Short YPlacement; /* vertical adjustment for
placement */
- FT_Short XAdvance; /* horizontal adjustment for
+ HB_Short XAdvance; /* horizontal adjustment for
advance */
- FT_Short YAdvance; /* vertical adjustment for
+ HB_Short YAdvance; /* vertical adjustment for
advance */
HB_Device XPlacementDevice; /* device table for horizontal
placement */
advance */
HB_Device YAdvanceDevice; /* device table for vertical
advance */
- FT_UShort XIdPlacement; /* horizontal placement metric ID */
- FT_UShort YIdPlacement; /* vertical placement metric ID */
- FT_UShort XIdAdvance; /* horizontal advance metric ID */
- FT_UShort YIdAdvance; /* vertical advance metric ID */
+ HB_UShort XIdPlacement; /* horizontal placement metric ID */
+ HB_UShort YIdPlacement; /* vertical placement metric ID */
+ HB_UShort XIdAdvance; /* horizontal advance metric ID */
+ HB_UShort YIdAdvance; /* vertical advance metric ID */
};
typedef struct HB_ValueRecord_ HB_ValueRecord;
struct HB_AnchorFormat1_
{
- FT_Short XCoordinate; /* horizontal value */
- FT_Short YCoordinate; /* vertical value */
+ HB_Short XCoordinate; /* horizontal value */
+ HB_Short YCoordinate; /* vertical value */
};
typedef struct HB_AnchorFormat1_ HB_AnchorFormat1;
struct HB_AnchorFormat2_
{
- FT_Short XCoordinate; /* horizontal value */
- FT_Short YCoordinate; /* vertical value */
- FT_UShort AnchorPoint; /* index to glyph contour point */
+ HB_Short XCoordinate; /* horizontal value */
+ HB_Short YCoordinate; /* vertical value */
+ HB_UShort AnchorPoint; /* index to glyph contour point */
};
typedef struct HB_AnchorFormat2_ HB_AnchorFormat2;
struct HB_AnchorFormat3_
{
- FT_Short XCoordinate; /* horizontal value */
- FT_Short YCoordinate; /* vertical value */
+ HB_Short XCoordinate; /* horizontal value */
+ HB_Short YCoordinate; /* vertical value */
HB_Device XDeviceTable; /* device table for X coordinate */
HB_Device YDeviceTable; /* device table for Y coordinate */
};
struct HB_AnchorFormat4_
{
- FT_UShort XIdAnchor; /* horizontal metric ID */
- FT_UShort YIdAnchor; /* vertical metric ID */
+ HB_UShort XIdAnchor; /* horizontal metric ID */
+ HB_UShort YIdAnchor; /* vertical metric ID */
};
typedef struct HB_AnchorFormat4_ HB_AnchorFormat4;
struct HB_Anchor_
{
- FT_UShort PosFormat; /* 1, 2, 3, or 4 -- 0 indicates
+ HB_UShort PosFormat; /* 1, 2, 3, or 4 -- 0 indicates
that there is no Anchor table */
union
struct HB_MarkRecord_
{
- FT_UShort Class; /* mark class */
+ HB_UShort Class; /* mark class */
HB_Anchor MarkAnchor; /* anchor table */
};
struct HB_MarkArray_
{
- FT_UShort MarkCount; /* number of MarkRecord tables */
+ HB_UShort MarkCount; /* number of MarkRecord tables */
HB_MarkRecord* MarkRecord; /* array of MarkRecord tables */
};
struct HB_SinglePosFormat2_
{
- FT_UShort ValueCount; /* number of ValueRecord tables */
+ HB_UShort ValueCount; /* number of ValueRecord tables */
HB_ValueRecord* Value; /* array of ValueRecord tables */
};
struct HB_SinglePos_
{
- FT_UShort PosFormat; /* 1 or 2 */
+ HB_UShort PosFormat; /* 1 or 2 */
HB_Coverage Coverage; /* Coverage table */
- FT_UShort ValueFormat; /* format of ValueRecord table */
+ HB_UShort ValueFormat; /* format of ValueRecord table */
union
{
struct HB_PairValueRecord_
{
- FT_UShort SecondGlyph; /* glyph ID for second glyph */
+ HB_UShort SecondGlyph; /* glyph ID for second glyph */
HB_ValueRecord Value1; /* pos. data for first glyph */
HB_ValueRecord Value2; /* pos. data for second glyph */
};
struct HB_PairSet_
{
- FT_UShort PairValueCount;
+ HB_UShort PairValueCount;
/* number of PairValueRecord tables */
HB_PairValueRecord* PairValueRecord;
/* array of PairValueRecord tables */
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_ClassDefinition ClassDef1; /* class def. for first glyph */
HB_ClassDefinition ClassDef2; /* class def. for second glyph */
- FT_UShort Class1Count; /* number of classes in ClassDef1
+ HB_UShort Class1Count; /* number of classes in ClassDef1
table */
- FT_UShort Class2Count; /* number of classes in ClassDef2
+ HB_UShort Class2Count; /* number of classes in ClassDef2
table */
HB_Class1Record* Class1Record; /* array of Class1Record tables */
};
struct HB_PairPos_
{
- FT_UShort PosFormat; /* 1 or 2 */
+ HB_UShort PosFormat; /* 1 or 2 */
HB_Coverage Coverage; /* Coverage table */
- FT_UShort ValueFormat1; /* format of ValueRecord table
+ HB_UShort ValueFormat1; /* format of ValueRecord table
for first glyph */
- FT_UShort ValueFormat2; /* format of ValueRecord table
+ HB_UShort ValueFormat2; /* format of ValueRecord table
for second glyph */
union
struct HB_CursivePos_
{
- FT_UShort PosFormat; /* always 1 */
+ HB_UShort PosFormat; /* always 1 */
HB_Coverage Coverage; /* Coverage table */
- FT_UShort EntryExitCount;
+ HB_UShort EntryExitCount;
/* number of EntryExitRecord tables */
HB_EntryExitRecord* EntryExitRecord;
/* array of EntryExitRecord tables */
struct HB_BaseArray_
{
- FT_UShort BaseCount; /* number of BaseRecord tables */
+ HB_UShort BaseCount; /* number of BaseRecord tables */
HB_BaseRecord* BaseRecord; /* array of BaseRecord tables */
};
struct HB_MarkBasePos_
{
- FT_UShort PosFormat; /* always 1 */
+ HB_UShort PosFormat; /* always 1 */
HB_Coverage MarkCoverage; /* mark glyph coverage table */
HB_Coverage BaseCoverage; /* base glyph coverage table */
- FT_UShort ClassCount; /* number of mark classes */
+ HB_UShort ClassCount; /* number of mark classes */
HB_MarkArray MarkArray; /* mark array table */
HB_BaseArray BaseArray; /* base array table */
};
struct HB_LigatureAttach_
{
- FT_UShort ComponentCount;
+ HB_UShort ComponentCount;
/* number of ComponentRecord tables */
HB_ComponentRecord* ComponentRecord;
/* array of ComponentRecord tables */
struct HB_LigatureArray_
{
- FT_UShort LigatureCount; /* number of LigatureAttach tables */
+ HB_UShort LigatureCount; /* number of LigatureAttach tables */
HB_LigatureAttach* LigatureAttach;
/* array of LigatureAttach tables */
};
struct HB_MarkLigPos_
{
- FT_UShort PosFormat; /* always 1 */
+ HB_UShort PosFormat; /* always 1 */
HB_Coverage MarkCoverage; /* mark glyph coverage table */
HB_Coverage LigatureCoverage;
/* ligature glyph coverage table */
- FT_UShort ClassCount; /* number of mark classes */
+ HB_UShort ClassCount; /* number of mark classes */
HB_MarkArray MarkArray; /* mark array table */
HB_LigatureArray LigatureArray; /* ligature array table */
};
struct HB_Mark2Array_
{
- FT_UShort Mark2Count; /* number of Mark2Record tables */
+ HB_UShort Mark2Count; /* number of Mark2Record tables */
HB_Mark2Record* Mark2Record; /* array of Mark2Record tables */
};
struct HB_MarkMarkPos_
{
- FT_UShort PosFormat; /* always 1 */
+ HB_UShort PosFormat; /* always 1 */
HB_Coverage Mark1Coverage; /* first mark glyph coverage table */
HB_Coverage Mark2Coverage; /* second mark glyph coverave table */
- FT_UShort ClassCount; /* number of combining mark classes */
+ HB_UShort ClassCount; /* number of combining mark classes */
HB_MarkArray Mark1Array; /* MarkArray table for first mark */
HB_Mark2Array Mark2Array; /* MarkArray table for second mark */
};
struct HB_PosLookupRecord_
{
- FT_UShort SequenceIndex; /* index into current
+ HB_UShort SequenceIndex; /* index into current
glyph sequence */
- FT_UShort LookupListIndex; /* Lookup to apply to that pos. */
+ HB_UShort LookupListIndex; /* Lookup to apply to that pos. */
};
typedef struct HB_PosLookupRecord_ HB_PosLookupRecord;
struct HB_PosRule_
{
- FT_UShort GlyphCount; /* total number of input glyphs */
- FT_UShort PosCount; /* number of PosLookupRecord tables */
- FT_UShort* Input; /* array of input glyph IDs */
+ HB_UShort GlyphCount; /* total number of input glyphs */
+ HB_UShort PosCount; /* number of PosLookupRecord tables */
+ HB_UShort* Input; /* array of input glyph IDs */
HB_PosLookupRecord* PosLookupRecord;
/* array of PosLookupRecord tables */
};
struct HB_PosRuleSet_
{
- FT_UShort PosRuleCount; /* number of PosRule tables */
+ HB_UShort PosRuleCount; /* number of PosRule tables */
HB_PosRule* PosRule; /* array of PosRule tables */
};
struct HB_ContextPosFormat1_
{
HB_Coverage Coverage; /* Coverage table */
- FT_UShort PosRuleSetCount; /* number of PosRuleSet tables */
+ HB_UShort PosRuleSetCount; /* number of PosRuleSet tables */
HB_PosRuleSet* PosRuleSet; /* array of PosRuleSet tables */
};
struct HB_PosClassRule_
{
- FT_UShort GlyphCount; /* total number of context classes */
- FT_UShort PosCount; /* number of PosLookupRecord tables */
- FT_UShort* Class; /* array of classes */
+ HB_UShort GlyphCount; /* total number of context classes */
+ HB_UShort PosCount; /* number of PosLookupRecord tables */
+ HB_UShort* Class; /* array of classes */
HB_PosLookupRecord* PosLookupRecord;
/* array of PosLookupRecord tables */
};
struct HB_PosClassSet_
{
- FT_UShort PosClassRuleCount;
+ HB_UShort PosClassRuleCount;
/* number of PosClassRule tables */
HB_PosClassRule* PosClassRule; /* array of PosClassRule tables */
};
struct HB_ContextPosFormat2_
{
- FT_UShort MaxContextLength;
+ HB_UShort MaxContextLength;
/* maximal context length */
HB_Coverage Coverage; /* Coverage table */
HB_ClassDefinition ClassDef; /* ClassDef table */
- FT_UShort PosClassSetCount;
+ HB_UShort PosClassSetCount;
/* number of PosClassSet tables */
HB_PosClassSet* PosClassSet; /* array of PosClassSet tables */
};
struct HB_ContextPosFormat3_
{
- FT_UShort GlyphCount; /* number of input glyphs */
- FT_UShort PosCount; /* number of PosLookupRecord tables */
+ HB_UShort GlyphCount; /* number of input glyphs */
+ HB_UShort PosCount; /* number of PosLookupRecord tables */
HB_Coverage* Coverage; /* array of Coverage tables */
HB_PosLookupRecord* PosLookupRecord;
/* array of PosLookupRecord tables */
struct HB_ContextPos_
{
- FT_UShort PosFormat; /* 1, 2, or 3 */
+ HB_UShort PosFormat; /* 1, 2, or 3 */
union
{
struct HB_ChainPosRule_
{
- FT_UShort BacktrackGlyphCount;
+ HB_UShort BacktrackGlyphCount;
/* total number of backtrack glyphs */
- FT_UShort* Backtrack; /* array of backtrack glyph IDs */
- FT_UShort InputGlyphCount;
+ HB_UShort* Backtrack; /* array of backtrack glyph IDs */
+ HB_UShort InputGlyphCount;
/* total number of input glyphs */
- FT_UShort* Input; /* array of input glyph IDs */
- FT_UShort LookaheadGlyphCount;
+ HB_UShort* Input; /* array of input glyph IDs */
+ HB_UShort LookaheadGlyphCount;
/* total number of lookahead glyphs */
- FT_UShort* Lookahead; /* array of lookahead glyph IDs */
- FT_UShort PosCount; /* number of PosLookupRecords */
+ HB_UShort* Lookahead; /* array of lookahead glyph IDs */
+ HB_UShort PosCount; /* number of PosLookupRecords */
HB_PosLookupRecord* PosLookupRecord;
/* array of PosLookupRecords */
};
struct HB_ChainPosRuleSet_
{
- FT_UShort ChainPosRuleCount;
+ HB_UShort ChainPosRuleCount;
/* number of ChainPosRule tables */
HB_ChainPosRule* ChainPosRule; /* array of ChainPosRule tables */
};
struct HB_ChainContextPosFormat1_
{
HB_Coverage Coverage; /* Coverage table */
- FT_UShort ChainPosRuleSetCount;
+ HB_UShort ChainPosRuleSetCount;
/* number of ChainPosRuleSet tables */
HB_ChainPosRuleSet* ChainPosRuleSet;
/* array of ChainPosRuleSet tables */
struct HB_ChainPosClassRule_
{
- FT_UShort BacktrackGlyphCount;
+ HB_UShort BacktrackGlyphCount;
/* total number of backtrack
classes */
- FT_UShort* Backtrack; /* array of backtrack classes */
- FT_UShort InputGlyphCount;
+ HB_UShort* Backtrack; /* array of backtrack classes */
+ HB_UShort InputGlyphCount;
/* total number of context classes */
- FT_UShort* Input; /* array of context classes */
- FT_UShort LookaheadGlyphCount;
+ HB_UShort* Input; /* array of context classes */
+ HB_UShort LookaheadGlyphCount;
/* total number of lookahead
classes */
- FT_UShort* Lookahead; /* array of lookahead classes */
- FT_UShort PosCount; /* number of PosLookupRecords */
+ HB_UShort* Lookahead; /* array of lookahead classes */
+ HB_UShort PosCount; /* number of PosLookupRecords */
HB_PosLookupRecord* PosLookupRecord;
/* array of substitution lookups */
};
struct HB_ChainPosClassSet_
{
- FT_UShort ChainPosClassRuleCount;
+ HB_UShort ChainPosClassRuleCount;
/* number of ChainPosClassRule
tables */
HB_ChainPosClassRule* ChainPosClassRule;
{
HB_Coverage Coverage; /* Coverage table */
- FT_UShort MaxBacktrackLength;
+ HB_UShort MaxBacktrackLength;
/* maximal backtrack length */
HB_ClassDefinition BacktrackClassDef;
/* BacktrackClassDef table */
- FT_UShort MaxInputLength;
+ HB_UShort MaxInputLength;
/* maximal input length */
HB_ClassDefinition InputClassDef;
/* InputClassDef table */
- FT_UShort MaxLookaheadLength;
+ HB_UShort MaxLookaheadLength;
/* maximal lookahead length */
HB_ClassDefinition LookaheadClassDef;
/* LookaheadClassDef table */
- FT_UShort ChainPosClassSetCount;
+ HB_UShort ChainPosClassSetCount;
/* number of ChainPosClassSet
tables */
HB_ChainPosClassSet* ChainPosClassSet;
struct HB_ChainContextPosFormat3_
{
- FT_UShort BacktrackGlyphCount;
+ HB_UShort BacktrackGlyphCount;
/* number of backtrack glyphs */
HB_Coverage* BacktrackCoverage;
/* array of backtrack Coverage
tables */
- FT_UShort InputGlyphCount;
+ HB_UShort InputGlyphCount;
/* number of input glyphs */
HB_Coverage* InputCoverage;
/* array of input coverage
tables */
- FT_UShort LookaheadGlyphCount;
+ HB_UShort LookaheadGlyphCount;
/* number of lookahead glyphs */
HB_Coverage* LookaheadCoverage;
/* array of lookahead coverage
tables */
- FT_UShort PosCount; /* number of PosLookupRecords */
+ HB_UShort PosCount; /* number of PosLookupRecords */
HB_PosLookupRecord* PosLookupRecord;
/* array of substitution lookups */
};
struct HB_ChainContextPos_
{
- FT_UShort PosFormat; /* 1, 2, or 3 */
+ HB_UShort PosFormat; /* 1, 2, or 3 */
union
{
/* LookupType 10 */
struct HB_ExtensionPos_
{
- FT_UShort PosFormat; /* always 1 */
- FT_UShort LookuptType; /* lookup-type of referenced subtable */
+ HB_UShort PosFormat; /* always 1 */
+ HB_UShort LookuptType; /* lookup-type of referenced subtable */
HB_GPOS_SubTable *subtable; /* referenced subtable */
};
HB_INTERNAL HB_Error
_HB_GPOS_Load_SubTable( HB_GPOS_SubTable* st,
FT_Stream stream,
- FT_UShort lookup_type );
+ HB_UShort lookup_type );
HB_INTERNAL void
_HB_GPOS_Free_SubTable( HB_GPOS_SubTable* st,
- FT_UShort lookup_type );
+ HB_UShort lookup_type );
-FT_END_HEADER
+HB_END_HEADER
#endif /* HARFBUZZ_GPOS_PRIVATE_H */
{
HB_GPOSHeader* gpos;
FT_Face face;
- FT_Bool dvi;
- FT_UShort load_flags; /* how the glyph should be loaded */
- FT_Bool r2l;
+ HB_Bool dvi;
+ HB_UShort load_flags; /* how the glyph should be loaded */
+ HB_Bool r2l;
- FT_UShort last; /* the last valid glyph -- used
+ HB_UShort last; /* the last valid glyph -- used
with cursive positioning */
FT_Pos anchor_x; /* the coordinates of the anchor point */
FT_Pos anchor_y; /* of the last valid glyph */
static HB_Error GPOS_Do_Glyph_Lookup( GPOS_Instance* gpi,
- FT_UShort lookup_index,
+ HB_UShort lookup_index,
HB_Buffer buffer,
- FT_UShort context_length,
+ HB_UShort context_length,
int nesting_level );
meaningful if multiple master fonts are to be supported. */
static HB_Error default_mmfunc( FT_Face face,
- FT_UShort metric_id,
+ HB_UShort metric_id,
FT_Pos* metric_value,
void* data )
{
HB_GPOSHeader** retptr,
HB_GDEFHeader* gdef )
{
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UInt cur_offset, new_offset, base_offset;
- FT_UShort i, num_lookups;
+ HB_UShort i, num_lookups;
HB_GPOSHeader* gpos;
HB_Lookup* lo;
the parent table and not the parent record. */
static HB_Error Load_ValueRecord( HB_ValueRecord* vr,
- FT_UShort format,
- FT_ULong base_offset,
+ HB_UShort format,
+ HB_UInt base_offset,
FT_Stream stream )
{
HB_Error error;
- FT_ULong cur_offset, new_offset;
+ HB_UInt cur_offset, new_offset;
if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT )
static void Free_ValueRecord( HB_ValueRecord* vr,
- FT_UShort format )
+ HB_UShort format )
{
if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE )
_HB_OPEN_Free_Device( &vr->YAdvanceDevice );
static HB_Error Get_ValueRecord( GPOS_Instance* gpi,
HB_ValueRecord* vr,
- FT_UShort format,
+ HB_UShort format,
HB_Position gd )
{
FT_Pos value;
- FT_Short pixel_value;
+ HB_Short pixel_value;
HB_Error error = HB_Err_Ok;
HB_GPOSHeader* gpos = gpi->gpos;
- FT_UShort x_ppem, y_ppem;
+ HB_UShort x_ppem, y_ppem;
FT_Fixed x_scale, y_scale;
{
HB_Error error;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UInt cur_offset, new_offset, base_offset;
base_offset = FILE_Pos();
static HB_Error Get_Anchor( GPOS_Instance* gpi,
HB_Anchor* an,
- FT_UShort glyph_index,
+ HB_UShort glyph_index,
FT_Pos* x_value,
FT_Pos* y_value )
{
FT_Outline outline;
HB_GPOSHeader* gpos = gpi->gpos;
- FT_UShort ap;
+ HB_UShort ap;
- FT_Short pixel_value;
- FT_UShort load_flags;
+ HB_Short pixel_value;
+ HB_UShort load_flags;
- FT_UShort x_ppem, y_ppem;
+ HB_UShort x_ppem, y_ppem;
FT_Fixed x_scale, y_scale;
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_MarkRecord* mr;
static void Free_MarkArray( HB_MarkArray* ma )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_MarkRecord* mr;
HB_Error error;
HB_SinglePos* sp = &st->single;
- FT_UShort n, m, count, format;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count, format;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_ValueRecord* vr;
static void Free_SinglePos( HB_GPOS_SubTable* st )
{
- FT_UShort n, count, format;
+ HB_UShort n, count, format;
HB_SinglePos* sp = &st->single;
HB_ValueRecord* v;
static HB_Error Lookup_SinglePos( GPOS_Instance* gpi,
HB_GPOS_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, property;
+ HB_UShort index, property;
HB_Error error;
HB_GPOSHeader* gpos = gpi->gpos;
HB_SinglePos* sp = &st->single;
/* PairSet */
static HB_Error Load_PairSet ( HB_PairSet* ps,
- FT_UShort format1,
- FT_UShort format2,
+ HB_UShort format1,
+ HB_UShort format2,
FT_Stream stream )
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong base_offset;
+ HB_UShort n, m, count;
+ HB_UInt base_offset;
HB_PairValueRecord* pvr;
static void Free_PairSet( HB_PairSet* ps,
- FT_UShort format1,
- FT_UShort format2 )
+ HB_UShort format1,
+ HB_UShort format2 )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_PairValueRecord* pvr;
/* PairPosFormat1 */
static HB_Error Load_PairPos1( HB_PairPosFormat1* ppf1,
- FT_UShort format1,
- FT_UShort format2,
+ HB_UShort format1,
+ HB_UShort format2,
FT_Stream stream )
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_PairSet* ps;
static void Free_PairPos1( HB_PairPosFormat1* ppf1,
- FT_UShort format1,
- FT_UShort format2 )
+ HB_UShort format1,
+ HB_UShort format2 )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_PairSet* ps;
/* PairPosFormat2 */
static HB_Error Load_PairPos2( HB_PairPosFormat2* ppf2,
- FT_UShort format1,
- FT_UShort format2,
+ HB_UShort format1,
+ HB_UShort format2,
FT_Stream stream )
{
HB_Error error;
- FT_UShort m, n, k, count1, count2;
- FT_ULong cur_offset, new_offset1, new_offset2, base_offset;
+ HB_UShort m, n, k, count1, count2;
+ HB_UInt cur_offset, new_offset1, new_offset2, base_offset;
HB_Class1Record* c1r;
HB_Class2Record* c2r;
static void Free_PairPos2( HB_PairPosFormat2* ppf2,
- FT_UShort format1,
- FT_UShort format2 )
+ HB_UShort format1,
+ HB_UShort format2 )
{
- FT_UShort m, n, count1, count2;
+ HB_UShort m, n, count1, count2;
HB_Class1Record* c1r;
HB_Class2Record* c2r;
HB_Error error;
HB_PairPos* pp = &st->pair;
- FT_UShort format1, format2;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort format1, format2;
+ HB_UInt cur_offset, new_offset, base_offset;
base_offset = FILE_Pos();
static void Free_PairPos( HB_GPOS_SubTable* st )
{
- FT_UShort format1, format2;
+ HB_UShort format1, format2;
HB_PairPos* pp = &st->pair;
static HB_Error Lookup_PairPos1( GPOS_Instance* gpi,
HB_PairPosFormat1* ppf1,
HB_Buffer buffer,
- FT_ULong first_pos,
- FT_UShort index,
- FT_UShort format1,
- FT_UShort format2 )
+ HB_UInt first_pos,
+ HB_UShort index,
+ HB_UShort format1,
+ HB_UShort format2 )
{
HB_Error error;
- FT_UShort numpvr, glyph2;
+ HB_UShort numpvr, glyph2;
HB_PairValueRecord* pvr;
static HB_Error Lookup_PairPos2( GPOS_Instance* gpi,
HB_PairPosFormat2* ppf2,
HB_Buffer buffer,
- FT_ULong first_pos,
- FT_UShort format1,
- FT_UShort format2 )
+ HB_UInt first_pos,
+ HB_UShort format1,
+ HB_UShort format2 )
{
HB_Error error;
- FT_UShort cl1 = 0, cl2 = 0; /* shut compiler up */
+ HB_UShort cl1 = 0, cl2 = 0; /* shut compiler up */
HB_Class1Record* c1r;
HB_Class2Record* c2r;
static HB_Error Lookup_PairPos( GPOS_Instance* gpi,
HB_GPOS_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
HB_Error error;
- FT_UShort index, property;
- FT_ULong first_pos;
+ HB_UShort index, property;
+ HB_UInt first_pos;
HB_GPOSHeader* gpos = gpi->gpos;
HB_PairPos* pp = &st->pair;
HB_Error error;
HB_CursivePos* cp = &st->cursive;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_EntryExitRecord* eer;
for ( n = 0; n < count; n++ )
{
- FT_ULong entry_offset;
+ HB_UInt entry_offset;
if ( ACCESS_Frame( 2L ) )
return error;
static void Free_CursivePos( HB_GPOS_SubTable* st )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_CursivePos* cp = &st->cursive;
HB_EntryExitRecord* eer;
static HB_Error Lookup_CursivePos( GPOS_Instance* gpi,
HB_GPOS_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, property;
+ HB_UShort index, property;
HB_Error error;
HB_GPOSHeader* gpos = gpi->gpos;
HB_CursivePos* cp = &st->cursive;
/* BaseArray */
static HB_Error Load_BaseArray( HB_BaseArray* ba,
- FT_UShort num_classes,
+ HB_UShort num_classes,
FT_Stream stream )
{
HB_Error error;
- FT_UShort m, n, k, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort m, n, k, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_BaseRecord* br;
HB_Anchor* ban;
static void Free_BaseArray( HB_BaseArray* ba,
- FT_UShort num_classes )
+ HB_UShort num_classes )
{
- FT_UShort m, n, count;
+ HB_UShort m, n, count;
HB_BaseRecord* br;
HB_Anchor* ban;
HB_Error error;
HB_MarkBasePos* mbp = &st->markbase;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UInt cur_offset, new_offset, base_offset;
base_offset = FILE_Pos();
static HB_Error Lookup_MarkBasePos( GPOS_Instance* gpi,
HB_GPOS_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort i, j, mark_index, base_index, property, class;
+ HB_UShort i, j, mark_index, base_index, property, class;
FT_Pos x_mark_value, y_mark_value, x_base_value, y_base_value;
HB_Error error;
HB_GPOSHeader* gpos = gpi->gpos;
/* LigatureAttach */
static HB_Error Load_LigatureAttach( HB_LigatureAttach* lat,
- FT_UShort num_classes,
+ HB_UShort num_classes,
FT_Stream stream )
{
HB_Error error;
- FT_UShort m, n, k, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort m, n, k, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_ComponentRecord* cr;
HB_Anchor* lan;
static void Free_LigatureAttach( HB_LigatureAttach* lat,
- FT_UShort num_classes )
+ HB_UShort num_classes )
{
- FT_UShort m, n, count;
+ HB_UShort m, n, count;
HB_ComponentRecord* cr;
HB_Anchor* lan;
/* LigatureArray */
static HB_Error Load_LigatureArray( HB_LigatureArray* la,
- FT_UShort num_classes,
+ HB_UShort num_classes,
FT_Stream stream )
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_LigatureAttach* lat;
static void Free_LigatureArray( HB_LigatureArray* la,
- FT_UShort num_classes )
+ HB_UShort num_classes )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_LigatureAttach* lat;
HB_Error error;
HB_MarkLigPos* mlp = &st->marklig;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UInt cur_offset, new_offset, base_offset;
base_offset = FILE_Pos();
static HB_Error Lookup_MarkLigPos( GPOS_Instance* gpi,
HB_GPOS_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort i, j, mark_index, lig_index, property, class;
- FT_UShort mark_glyph;
+ HB_UShort i, j, mark_index, lig_index, property, class;
+ HB_UShort mark_glyph;
FT_Pos x_mark_value, y_mark_value, x_lig_value, y_lig_value;
HB_Error error;
HB_GPOSHeader* gpos = gpi->gpos;
HB_LigatureArray* la;
HB_LigatureAttach* lat;
HB_ComponentRecord* cr;
- FT_UShort comp_index;
+ HB_UShort comp_index;
HB_Anchor* mark_anchor;
HB_Anchor* lig_anchor;
/* Mark2Array */
static HB_Error Load_Mark2Array( HB_Mark2Array* m2a,
- FT_UShort num_classes,
+ HB_UShort num_classes,
FT_Stream stream )
{
HB_Error error;
- FT_UShort k, m, n, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort k, m, n, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_Mark2Record* m2r;
HB_Anchor* m2an;
static void Free_Mark2Array( HB_Mark2Array* m2a,
- FT_UShort num_classes )
+ HB_UShort num_classes )
{
- FT_UShort m, n, count;
+ HB_UShort m, n, count;
HB_Mark2Record* m2r;
HB_Anchor* m2an;
HB_Error error;
HB_MarkMarkPos* mmp = &st->markmark;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UInt cur_offset, new_offset, base_offset;
base_offset = FILE_Pos();
static HB_Error Lookup_MarkMarkPos( GPOS_Instance* gpi,
HB_GPOS_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort i, j, mark1_index, mark2_index, property, class;
+ HB_UShort i, j, mark1_index, mark2_index, property, class;
FT_Pos x_mark1_value, y_mark1_value,
x_mark2_value, y_mark2_value;
HB_Error error;
matches the subrule. */
static HB_Error Do_ContextPos( GPOS_Instance* gpi,
- FT_UShort GlyphCount,
- FT_UShort PosCount,
+ HB_UShort GlyphCount,
+ HB_UShort PosCount,
HB_PosLookupRecord* pos,
HB_Buffer buffer,
int nesting_level )
{
HB_Error error;
- FT_ULong i, old_pos;
+ HB_UInt i, old_pos;
i = 0;
{
HB_Error error;
- FT_UShort n, count;
- FT_UShort* i;
+ HB_UShort n, count;
+ HB_UShort* i;
HB_PosLookupRecord* plr;
count = pr->GlyphCount - 1; /* only GlyphCount - 1 elements */
- if ( ALLOC_ARRAY( pr->Input, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( pr->Input, count, HB_UShort ) )
return error;
i = pr->Input;
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_PosRule* pr;
static void Free_PosRuleSet( HB_PosRuleSet* prs )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_PosRule* pr;
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_PosRuleSet* prs;
static void Free_ContextPos1( HB_ContextPosFormat1* cpf1 )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_PosRuleSet* prs;
{
HB_Error error;
- FT_UShort n, count;
+ HB_UShort n, count;
- FT_UShort* c;
+ HB_UShort* c;
HB_PosLookupRecord* plr;
- FT_Bool* d;
+ HB_Bool* d;
if ( ACCESS_Frame( 4L ) )
count = pcr->GlyphCount - 1; /* only GlyphCount - 1 elements */
- if ( ALLOC_ARRAY( pcr->Class, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( pcr->Class, count, HB_UShort ) )
return error;
c = pcr->Class;
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_PosClassRule* pcr;
static void Free_PosClassSet( HB_PosClassSet* pcs )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_PosClassRule* pcr;
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_PosClassSet* pcs;
static void Free_ContextPos2( HB_ContextPosFormat2* cpf2 )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_PosClassSet* pcs;
{
HB_Error error;
- FT_UShort n, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_Coverage* c;
HB_PosLookupRecord* plr;
static void Free_ContextPos3( HB_ContextPosFormat3* cpf3 )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_Coverage* c;
static HB_Error Lookup_ContextPos1( GPOS_Instance* gpi,
HB_ContextPosFormat1* cpf1,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, property;
- FT_UShort i, j, k, numpr;
+ HB_UShort index, property;
+ HB_UShort i, j, k, numpr;
HB_Error error;
HB_GPOSHeader* gpos = gpi->gpos;
if ( error && error != HB_Err_Not_Covered )
return error;
- if ( j + pr[k].GlyphCount - i == (FT_Long)buffer->in_length )
+ if ( j + pr[k].GlyphCount - i == (HB_Int)buffer->in_length )
goto next_posrule;
j++;
}
static HB_Error Lookup_ContextPos2( GPOS_Instance* gpi,
HB_ContextPosFormat2* cpf2,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, property;
+ HB_UShort index, property;
HB_Error error;
- FT_UShort i, j, k, known_classes;
+ HB_UShort i, j, k, known_classes;
- FT_UShort* classes;
- FT_UShort* cl;
+ HB_UShort* classes;
+ HB_UShort* cl;
HB_GPOSHeader* gpos = gpi->gpos;
HB_PosClassSet* pcs;
if ( error )
return error;
- if ( ALLOC_ARRAY( classes, cpf2->MaxContextLength, FT_UShort ) )
+ if ( ALLOC_ARRAY( classes, cpf2->MaxContextLength, HB_UShort ) )
return error;
error = _HB_OPEN_Get_Class( &cpf2->ClassDef, IN_CURGLYPH(),
if ( error && error != HB_Err_Not_Covered )
goto End;
- if ( j + pr->GlyphCount - i == (FT_Long)buffer->in_length )
+ if ( j + pr->GlyphCount - i == (HB_Int)buffer->in_length )
goto next_posclassrule;
j++;
}
static HB_Error Lookup_ContextPos3( GPOS_Instance* gpi,
HB_ContextPosFormat3* cpf3,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
HB_Error error;
- FT_UShort index, i, j, property;
+ HB_UShort index, i, j, property;
HB_GPOSHeader* gpos = gpi->gpos;
HB_Coverage* c;
if ( error && error != HB_Err_Not_Covered )
return error;
- if ( j + cpf3->GlyphCount - i == (FT_Long)buffer->in_length )
+ if ( j + cpf3->GlyphCount - i == (HB_Int)buffer->in_length )
return HB_Err_Not_Covered;
j++;
}
static HB_Error Lookup_ContextPos( GPOS_Instance* gpi,
HB_GPOS_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
HB_ContextPos* cp = &st->context;
{
HB_Error error;
- FT_UShort n, count;
- FT_UShort* b;
- FT_UShort* i;
- FT_UShort* l;
+ HB_UShort n, count;
+ HB_UShort* b;
+ HB_UShort* i;
+ HB_UShort* l;
HB_PosLookupRecord* plr;
count = cpr->BacktrackGlyphCount;
- if ( ALLOC_ARRAY( cpr->Backtrack, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( cpr->Backtrack, count, HB_UShort ) )
return error;
b = cpr->Backtrack;
count = cpr->InputGlyphCount - 1; /* only InputGlyphCount - 1 elements */
- if ( ALLOC_ARRAY( cpr->Input, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( cpr->Input, count, HB_UShort ) )
goto Fail4;
i = cpr->Input;
count = cpr->LookaheadGlyphCount;
- if ( ALLOC_ARRAY( cpr->Lookahead, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( cpr->Lookahead, count, HB_UShort ) )
goto Fail3;
l = cpr->Lookahead;
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_ChainPosRule* cpr;
static void Free_ChainPosRuleSet( HB_ChainPosRuleSet* cprs )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_ChainPosRule* cpr;
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_ChainPosRuleSet* cprs;
static void Free_ChainContextPos1( HB_ChainContextPosFormat1* ccpf1 )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_ChainPosRuleSet* cprs;
{
HB_Error error;
- FT_UShort n, count;
+ HB_UShort n, count;
- FT_UShort* b;
- FT_UShort* i;
- FT_UShort* l;
+ HB_UShort* b;
+ HB_UShort* i;
+ HB_UShort* l;
HB_PosLookupRecord* plr;
- FT_Bool* d;
+ HB_Bool* d;
if ( ACCESS_Frame( 2L ) )
count = cpcr->BacktrackGlyphCount;
- if ( ALLOC_ARRAY( cpcr->Backtrack, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( cpcr->Backtrack, count, HB_UShort ) )
return error;
b = cpcr->Backtrack;
count = cpcr->InputGlyphCount - 1; /* only InputGlyphCount - 1 elements */
- if ( ALLOC_ARRAY( cpcr->Input, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( cpcr->Input, count, HB_UShort ) )
goto Fail4;
i = cpcr->Input;
count = cpcr->LookaheadGlyphCount;
- if ( ALLOC_ARRAY( cpcr->Lookahead, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( cpcr->Lookahead, count, HB_UShort ) )
goto Fail3;
l = cpcr->Lookahead;
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_ChainPosClassRule* cpcr;
static void Free_ChainPosClassSet( HB_ChainPosClassSet* cpcs )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_ChainPosClassRule* cpcr;
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
- FT_ULong backtrack_offset, input_offset, lookahead_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
+ HB_UInt backtrack_offset, input_offset, lookahead_offset;
HB_ChainPosClassSet* cpcs;
static void Free_ChainContextPos2( HB_ChainContextPosFormat2* ccpf2 )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_ChainPosClassSet* cpcs;
{
HB_Error error;
- FT_UShort n, nb, ni, nl, m, count;
- FT_UShort backtrack_count, input_count, lookahead_count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, nb, ni, nl, m, count;
+ HB_UShort backtrack_count, input_count, lookahead_count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_Coverage* b;
HB_Coverage* i;
static void Free_ChainContextPos3( HB_ChainContextPosFormat3* ccpf3 )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_Coverage* c;
GPOS_Instance* gpi,
HB_ChainContextPosFormat1* ccpf1,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, property;
- FT_UShort i, j, k, num_cpr;
- FT_UShort bgc, igc, lgc;
+ HB_UShort index, property;
+ HB_UShort i, j, k, num_cpr;
+ HB_UShort bgc, igc, lgc;
HB_Error error;
HB_GPOSHeader* gpos = gpi->gpos;
if ( error && error != HB_Err_Not_Covered )
return error;
- if ( j + igc - i + lgc == (FT_Long)buffer->in_length )
+ if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
goto next_chainposrule;
j++;
}
if ( error && error != HB_Err_Not_Covered )
return error;
- if ( j + lgc - i == (FT_Long)buffer->in_length )
+ if ( j + lgc - i == (HB_Int)buffer->in_length )
goto next_chainposrule;
j++;
}
GPOS_Instance* gpi,
HB_ChainContextPosFormat2* ccpf2,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, property;
+ HB_UShort index, property;
HB_Error error;
- FT_UShort i, j, k;
- FT_UShort bgc, igc, lgc;
- FT_UShort known_backtrack_classes,
+ HB_UShort i, j, k;
+ HB_UShort bgc, igc, lgc;
+ HB_UShort known_backtrack_classes,
known_input_classes,
known_lookahead_classes;
- FT_UShort* backtrack_classes;
- FT_UShort* input_classes;
- FT_UShort* lookahead_classes;
+ HB_UShort* backtrack_classes;
+ HB_UShort* input_classes;
+ HB_UShort* lookahead_classes;
- FT_UShort* bc;
- FT_UShort* ic;
- FT_UShort* lc;
+ HB_UShort* bc;
+ HB_UShort* ic;
+ HB_UShort* lc;
HB_GPOSHeader* gpos = gpi->gpos;
HB_ChainPosClassSet* cpcs;
if ( error )
return error;
- if ( ALLOC_ARRAY( backtrack_classes, ccpf2->MaxBacktrackLength, FT_UShort ) )
+ if ( ALLOC_ARRAY( backtrack_classes, ccpf2->MaxBacktrackLength, HB_UShort ) )
return error;
known_backtrack_classes = 0;
- if ( ALLOC_ARRAY( input_classes, ccpf2->MaxInputLength, FT_UShort ) )
+ if ( ALLOC_ARRAY( input_classes, ccpf2->MaxInputLength, HB_UShort ) )
goto End3;
known_input_classes = 1;
- if ( ALLOC_ARRAY( lookahead_classes, ccpf2->MaxLookaheadLength, FT_UShort ) )
+ if ( ALLOC_ARRAY( lookahead_classes, ccpf2->MaxLookaheadLength, HB_UShort ) )
goto End2;
known_lookahead_classes = 0;
if ( error && error != HB_Err_Not_Covered )
goto End1;
- if ( j + igc - i + lgc == (FT_Long)buffer->in_length )
+ if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
goto next_chainposclassrule;
j++;
}
if ( error && error != HB_Err_Not_Covered )
goto End1;
- if ( j + lgc - i == (FT_Long)buffer->in_length )
+ if ( j + lgc - i == (HB_Int)buffer->in_length )
goto next_chainposclassrule;
j++;
}
GPOS_Instance* gpi,
HB_ChainContextPosFormat3* ccpf3,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, i, j, property;
- FT_UShort bgc, igc, lgc;
+ HB_UShort index, i, j, property;
+ HB_UShort bgc, igc, lgc;
HB_Error error;
HB_GPOSHeader* gpos = gpi->gpos;
if ( error && error != HB_Err_Not_Covered )
return error;
- if ( j + igc - i + lgc == (FT_Long)buffer->in_length )
+ if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
return HB_Err_Not_Covered;
j++;
}
if ( error && error != HB_Err_Not_Covered )
return error;
- if ( j + lgc - i == (FT_Long)buffer->in_length )
+ if ( j + lgc - i == (HB_Int)buffer->in_length )
return HB_Err_Not_Covered;
j++;
}
GPOS_Instance* gpi,
HB_GPOS_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
HB_ChainContextPos* ccp = &st->chain;
HB_Error HB_GPOS_Select_Script( HB_GPOSHeader* gpos,
- FT_ULong script_tag,
- FT_UShort* script_index )
+ HB_UInt script_tag,
+ HB_UShort* script_index )
{
- FT_UShort n;
+ HB_UShort n;
HB_ScriptList* sl;
HB_ScriptRecord* sr;
HB_Error HB_GPOS_Select_Language( HB_GPOSHeader* gpos,
- FT_ULong language_tag,
- FT_UShort script_index,
- FT_UShort* language_index,
- FT_UShort* req_feature_index )
+ HB_UInt language_tag,
+ HB_UShort script_index,
+ HB_UShort* language_index,
+ HB_UShort* req_feature_index )
{
- FT_UShort n;
+ HB_UShort n;
HB_ScriptList* sl;
HB_ScriptRecord* sr;
HB_Error HB_GPOS_Select_Feature( HB_GPOSHeader* gpos,
- FT_ULong feature_tag,
- FT_UShort script_index,
- FT_UShort language_index,
- FT_UShort* feature_index )
+ HB_UInt feature_tag,
+ HB_UShort script_index,
+ HB_UShort language_index,
+ HB_UShort* feature_index )
{
- FT_UShort n;
+ HB_UShort n;
HB_ScriptList* sl;
HB_ScriptRecord* sr;
HB_Script* s;
HB_LangSysRecord* lsr;
HB_LangSys* ls;
- FT_UShort* fi;
+ HB_UShort* fi;
HB_FeatureList* fl;
HB_FeatureRecord* fr;
HB_Error HB_GPOS_Query_Scripts( HB_GPOSHeader* gpos,
- FT_ULong** script_tag_list )
+ HB_UInt** script_tag_list )
{
HB_Error error;
- FT_UShort n;
- FT_ULong* stl;
+ HB_UShort n;
+ HB_UInt* stl;
HB_ScriptList* sl;
HB_ScriptRecord* sr;
sl = &gpos->ScriptList;
sr = sl->ScriptRecord;
- if ( ALLOC_ARRAY( stl, sl->ScriptCount + 1, FT_ULong ) )
+ if ( ALLOC_ARRAY( stl, sl->ScriptCount + 1, HB_UInt ) )
return error;
for ( n = 0; n < sl->ScriptCount; n++ )
HB_Error HB_GPOS_Query_Languages( HB_GPOSHeader* gpos,
- FT_UShort script_index,
- FT_ULong** language_tag_list )
+ HB_UShort script_index,
+ HB_UInt** language_tag_list )
{
HB_Error error;
- FT_UShort n;
- FT_ULong* ltl;
+ HB_UShort n;
+ HB_UInt* ltl;
HB_ScriptList* sl;
HB_ScriptRecord* sr;
s = &sr[script_index].Script;
lsr = s->LangSysRecord;
- if ( ALLOC_ARRAY( ltl, s->LangSysCount + 1, FT_ULong ) )
+ if ( ALLOC_ARRAY( ltl, s->LangSysCount + 1, HB_UInt ) )
return error;
for ( n = 0; n < s->LangSysCount; n++ )
HB_Error HB_GPOS_Query_Features( HB_GPOSHeader* gpos,
- FT_UShort script_index,
- FT_UShort language_index,
- FT_ULong** feature_tag_list )
+ HB_UShort script_index,
+ HB_UShort language_index,
+ HB_UInt** feature_tag_list )
{
- FT_UShort n;
+ HB_UShort n;
HB_Error error;
- FT_ULong* ftl;
+ HB_UInt* ftl;
HB_ScriptList* sl;
HB_ScriptRecord* sr;
HB_Script* s;
HB_LangSysRecord* lsr;
HB_LangSys* ls;
- FT_UShort* fi;
+ HB_UShort* fi;
HB_FeatureList* fl;
HB_FeatureRecord* fr;
fi = ls->FeatureIndex;
- if ( ALLOC_ARRAY( ftl, ls->FeatureCount + 1, FT_ULong ) )
+ if ( ALLOC_ARRAY( ftl, ls->FeatureCount + 1, HB_UInt ) )
return error;
for ( n = 0; n < ls->FeatureCount; n++ )
/* Do an individual subtable lookup. Returns HB_Err_Ok if positioning
has been done, or HB_Err_Not_Covered if not. */
static HB_Error GPOS_Do_Glyph_Lookup( GPOS_Instance* gpi,
- FT_UShort lookup_index,
+ HB_UShort lookup_index,
HB_Buffer buffer,
- FT_UShort context_length,
+ HB_UShort context_length,
int nesting_level )
{
HB_Error error = HB_Err_Not_Covered;
- FT_UShort i, flags, lookup_count;
+ HB_UShort i, flags, lookup_count;
HB_GPOSHeader* gpos = gpi->gpos;
HB_Lookup* lo;
int lookup_type;
HB_INTERNAL HB_Error
_HB_GPOS_Load_SubTable( HB_GPOS_SubTable* st,
FT_Stream stream,
- FT_UShort lookup_type )
+ HB_UShort lookup_type )
{
switch ( lookup_type ) {
case HB_GPOS_LOOKUP_SINGLE: return Load_SinglePos ( st, stream );
HB_INTERNAL void
_HB_GPOS_Free_SubTable( HB_GPOS_SubTable* st,
- FT_UShort lookup_type )
+ HB_UShort lookup_type )
{
switch ( lookup_type ) {
case HB_GPOS_LOOKUP_SINGLE: Free_SinglePos ( st ); return;
/* apply one lookup to the input string object */
static HB_Error GPOS_Do_String_Lookup( GPOS_Instance* gpi,
- FT_UShort lookup_index,
+ HB_UShort lookup_index,
HB_Buffer buffer )
{
HB_Error error, retError = HB_Err_Not_Covered;
HB_GPOSHeader* gpos = gpi->gpos;
- FT_UInt* properties = gpos->LookupList.Properties;
+ HB_UInt* properties = gpos->LookupList.Properties;
const int nesting_level = 0;
/* 0xFFFF indicates that we don't have a context length yet */
- const FT_UShort context_length = 0xFFFF;
+ const HB_UShort context_length = 0xFFFF;
gpi->last = 0xFFFF; /* no last valid glyph for cursive pos. */
static HB_Error Position_CursiveChain ( HB_Buffer buffer )
{
- FT_ULong i, j;
+ HB_UInt i, j;
HB_Position positions = buffer->positions;
/* First handle all left-to-right connections */
HB_Error HB_GPOS_Add_Feature( HB_GPOSHeader* gpos,
- FT_UShort feature_index,
- FT_UInt property )
+ HB_UShort feature_index,
+ HB_UInt property )
{
- FT_UShort i;
+ HB_UShort i;
HB_Feature feature;
- FT_UInt* properties;
- FT_UShort* index;
- FT_UShort lookup_count;
+ HB_UInt* properties;
+ HB_UShort* index;
+ HB_UShort lookup_count;
/* Each feature can only be added once */
for ( i = 0; i < feature.LookupListCount; i++ )
{
- FT_UShort lookup_index = index[i];
+ HB_UShort lookup_index = index[i];
if (lookup_index < lookup_count)
properties[lookup_index] |= property;
}
HB_Error HB_GPOS_Clear_Features( HB_GPOSHeader* gpos )
{
- FT_UShort i;
+ HB_UShort i;
- FT_UInt* properties;
+ HB_UInt* properties;
if ( !gpos )
HB_Error HB_GPOS_Apply_String( FT_Face face,
HB_GPOSHeader* gpos,
- FT_UShort load_flags,
+ HB_UShort load_flags,
HB_Buffer buffer,
- FT_Bool dvi,
- FT_Bool r2l )
+ HB_Bool dvi,
+ HB_Bool r2l )
{
HB_Error error, retError = HB_Err_Not_Covered;
GPOS_Instance gpi;
for ( i = 0; i < num_features; i++ )
{
- FT_UShort feature_index = gpos->FeatureList.ApplyOrder[i];
+ HB_UShort feature_index = gpos->FeatureList.ApplyOrder[i];
HB_Feature feature = gpos->FeatureList.FeatureRecord[feature_index].Feature;
for ( j = 0; j < feature.LookupListCount; j++ )
{
- FT_UShort lookup_index = feature.LookupListIndex[j];
+ HB_UShort lookup_index = feature.LookupListIndex[j];
/* Skip nonexistant lookups */
if (lookup_index >= lookup_count)
#include "harfbuzz-gdef.h"
#include "harfbuzz-buffer.h"
-FT_BEGIN_HEADER
+HB_BEGIN_HEADER
#define HB_Err_Invalid_GPOS_SubTable_Format 0x1020
#define HB_Err_Invalid_GPOS_SubTable 0x1021
_glyph = HANDLE_Glyph( glyph ) */
typedef HB_Error (*HB_GlyphFunction)(FT_Face face,
- FT_UInt glyphIndex,
- FT_Int loadFlags );
+ HB_UInt glyphIndex,
+ HB_Int loadFlags );
/* A pointer to a function which accesses the PostScript interpreter.
be rounded). */
typedef HB_Error (*HB_MMFunction)(FT_Face face,
- FT_UShort metric_id,
+ HB_UShort metric_id,
FT_Pos* metric_value,
void* data );
HB_Error HB_GPOS_Select_Script( HB_GPOSHeader* gpos,
- FT_ULong script_tag,
- FT_UShort* script_index );
+ HB_UInt script_tag,
+ HB_UShort* script_index );
HB_Error HB_GPOS_Select_Language( HB_GPOSHeader* gpos,
- FT_ULong language_tag,
- FT_UShort script_index,
- FT_UShort* language_index,
- FT_UShort* req_feature_index );
+ HB_UInt language_tag,
+ HB_UShort script_index,
+ HB_UShort* language_index,
+ HB_UShort* req_feature_index );
HB_Error HB_GPOS_Select_Feature( HB_GPOSHeader* gpos,
- FT_ULong feature_tag,
- FT_UShort script_index,
- FT_UShort language_index,
- FT_UShort* feature_index );
+ HB_UInt feature_tag,
+ HB_UShort script_index,
+ HB_UShort language_index,
+ HB_UShort* feature_index );
HB_Error HB_GPOS_Query_Scripts( HB_GPOSHeader* gpos,
- FT_ULong** script_tag_list );
+ HB_UInt** script_tag_list );
HB_Error HB_GPOS_Query_Languages( HB_GPOSHeader* gpos,
- FT_UShort script_index,
- FT_ULong** language_tag_list );
+ HB_UShort script_index,
+ HB_UInt** language_tag_list );
HB_Error HB_GPOS_Query_Features( HB_GPOSHeader* gpos,
- FT_UShort script_index,
- FT_UShort language_index,
- FT_ULong** feature_tag_list );
+ HB_UShort script_index,
+ HB_UShort language_index,
+ HB_UInt** feature_tag_list );
HB_Error HB_GPOS_Add_Feature( HB_GPOSHeader* gpos,
- FT_UShort feature_index,
- FT_UInt property );
+ HB_UShort feature_index,
+ HB_UInt property );
HB_Error HB_GPOS_Clear_Features( HB_GPOSHeader* gpos );
HB_Error HB_GPOS_Apply_String( FT_Face face,
HB_GPOSHeader* gpos,
- FT_UShort load_flags,
+ HB_UShort load_flags,
HB_Buffer buffer,
- FT_Bool dvi,
- FT_Bool r2l );
+ HB_Bool dvi,
+ HB_Bool r2l );
-FT_END_HEADER
+HB_END_HEADER
#endif /* HARFBUZZ_GPOS_H */
#include "harfbuzz-impl.h"
#include "harfbuzz-gsub.h"
-FT_BEGIN_HEADER
+HB_BEGIN_HEADER
typedef union HB_GSUB_SubTable_ HB_GSUB_SubTable;
struct HB_SingleSubstFormat1_
{
- FT_Short DeltaGlyphID; /* constant added to get
+ HB_Short DeltaGlyphID; /* constant added to get
substitution glyph index */
};
struct HB_SingleSubstFormat2_
{
- FT_UShort GlyphCount; /* number of glyph IDs in
+ HB_UShort GlyphCount; /* number of glyph IDs in
Substitute array */
- FT_UShort* Substitute; /* array of substitute glyph IDs */
+ HB_UShort* Substitute; /* array of substitute glyph IDs */
};
typedef struct HB_SingleSubstFormat2_ HB_SingleSubstFormat2;
struct HB_SingleSubst_
{
- FT_UShort SubstFormat; /* 1 or 2 */
+ HB_UShort SubstFormat; /* 1 or 2 */
HB_Coverage Coverage; /* Coverage table */
union
struct HB_Sequence_
{
- FT_UShort GlyphCount; /* number of glyph IDs in the
+ HB_UShort GlyphCount; /* number of glyph IDs in the
Substitute array */
- FT_UShort* Substitute; /* string of glyph IDs to
+ HB_UShort* Substitute; /* string of glyph IDs to
substitute */
};
struct HB_MultipleSubst_
{
- FT_UShort SubstFormat; /* always 1 */
+ HB_UShort SubstFormat; /* always 1 */
HB_Coverage Coverage; /* Coverage table */
- FT_UShort SequenceCount; /* number of Sequence tables */
+ HB_UShort SequenceCount; /* number of Sequence tables */
HB_Sequence* Sequence; /* array of Sequence tables */
};
struct HB_AlternateSet_
{
- FT_UShort GlyphCount; /* number of glyph IDs in the
+ HB_UShort GlyphCount; /* number of glyph IDs in the
Alternate array */
- FT_UShort* Alternate; /* array of alternate glyph IDs */
+ HB_UShort* Alternate; /* array of alternate glyph IDs */
};
typedef struct HB_AlternateSet_ HB_AlternateSet;
struct HB_AlternateSubst_
{
- FT_UShort SubstFormat; /* always 1 */
+ HB_UShort SubstFormat; /* always 1 */
HB_Coverage Coverage; /* Coverage table */
- FT_UShort AlternateSetCount;
+ HB_UShort AlternateSetCount;
/* number of AlternateSet tables */
HB_AlternateSet* AlternateSet; /* array of AlternateSet tables */
};
struct HB_Ligature_
{
- FT_UShort LigGlyph; /* glyphID of ligature
+ HB_UShort LigGlyph; /* glyphID of ligature
to substitute */
- FT_UShort ComponentCount; /* number of components in ligature */
- FT_UShort* Component; /* array of component glyph IDs */
+ HB_UShort ComponentCount; /* number of components in ligature */
+ HB_UShort* Component; /* array of component glyph IDs */
};
typedef struct HB_Ligature_ HB_Ligature;
struct HB_LigatureSet_
{
- FT_UShort LigatureCount; /* number of Ligature tables */
+ HB_UShort LigatureCount; /* number of Ligature tables */
HB_Ligature* Ligature; /* array of Ligature tables */
};
struct HB_LigatureSubst_
{
- FT_UShort SubstFormat; /* always 1 */
+ HB_UShort SubstFormat; /* always 1 */
HB_Coverage Coverage; /* Coverage table */
- FT_UShort LigatureSetCount; /* number of LigatureSet tables */
+ HB_UShort LigatureSetCount; /* number of LigatureSet tables */
HB_LigatureSet* LigatureSet; /* array of LigatureSet tables */
};
struct HB_SubstLookupRecord_
{
- FT_UShort SequenceIndex; /* index into current
+ HB_UShort SequenceIndex; /* index into current
glyph sequence */
- FT_UShort LookupListIndex; /* Lookup to apply to that pos. */
+ HB_UShort LookupListIndex; /* Lookup to apply to that pos. */
};
typedef struct HB_SubstLookupRecord_ HB_SubstLookupRecord;
struct HB_SubRule_
{
- FT_UShort GlyphCount; /* total number of input glyphs */
- FT_UShort SubstCount; /* number of SubstLookupRecord
+ HB_UShort GlyphCount; /* total number of input glyphs */
+ HB_UShort SubstCount; /* number of SubstLookupRecord
tables */
- FT_UShort* Input; /* array of input glyph IDs */
+ HB_UShort* Input; /* array of input glyph IDs */
HB_SubstLookupRecord* SubstLookupRecord;
/* array of SubstLookupRecord
tables */
struct HB_SubRuleSet_
{
- FT_UShort SubRuleCount; /* number of SubRule tables */
+ HB_UShort SubRuleCount; /* number of SubRule tables */
HB_SubRule* SubRule; /* array of SubRule tables */
};
struct HB_ContextSubstFormat1_
{
HB_Coverage Coverage; /* Coverage table */
- FT_UShort SubRuleSetCount; /* number of SubRuleSet tables */
+ HB_UShort SubRuleSetCount; /* number of SubRuleSet tables */
HB_SubRuleSet* SubRuleSet; /* array of SubRuleSet tables */
};
struct HB_SubClassRule_
{
- FT_UShort GlyphCount; /* total number of context classes */
- FT_UShort SubstCount; /* number of SubstLookupRecord
+ HB_UShort GlyphCount; /* total number of context classes */
+ HB_UShort SubstCount; /* number of SubstLookupRecord
tables */
- FT_UShort* Class; /* array of classes */
+ HB_UShort* Class; /* array of classes */
HB_SubstLookupRecord* SubstLookupRecord;
/* array of SubstLookupRecord
tables */
struct HB_SubClassSet_
{
- FT_UShort SubClassRuleCount;
+ HB_UShort SubClassRuleCount;
/* number of SubClassRule tables */
HB_SubClassRule* SubClassRule; /* array of SubClassRule tables */
};
struct HB_ContextSubstFormat2_
{
- FT_UShort MaxContextLength;
+ HB_UShort MaxContextLength;
/* maximal context length */
HB_Coverage Coverage; /* Coverage table */
HB_ClassDefinition ClassDef; /* ClassDef table */
- FT_UShort SubClassSetCount;
+ HB_UShort SubClassSetCount;
/* number of SubClassSet tables */
HB_SubClassSet* SubClassSet; /* array of SubClassSet tables */
};
struct HB_ContextSubstFormat3_
{
- FT_UShort GlyphCount; /* number of input glyphs */
- FT_UShort SubstCount; /* number of SubstLookupRecords */
+ HB_UShort GlyphCount; /* number of input glyphs */
+ HB_UShort SubstCount; /* number of SubstLookupRecords */
HB_Coverage* Coverage; /* array of Coverage tables */
HB_SubstLookupRecord* SubstLookupRecord;
/* array of substitution lookups */
struct HB_ContextSubst_
{
- FT_UShort SubstFormat; /* 1, 2, or 3 */
+ HB_UShort SubstFormat; /* 1, 2, or 3 */
union
{
struct HB_ChainSubRule_
{
- FT_UShort BacktrackGlyphCount;
+ HB_UShort BacktrackGlyphCount;
/* total number of backtrack glyphs */
- FT_UShort* Backtrack; /* array of backtrack glyph IDs */
- FT_UShort InputGlyphCount;
+ HB_UShort* Backtrack; /* array of backtrack glyph IDs */
+ HB_UShort InputGlyphCount;
/* total number of input glyphs */
- FT_UShort* Input; /* array of input glyph IDs */
- FT_UShort LookaheadGlyphCount;
+ HB_UShort* Input; /* array of input glyph IDs */
+ HB_UShort LookaheadGlyphCount;
/* total number of lookahead glyphs */
- FT_UShort* Lookahead; /* array of lookahead glyph IDs */
- FT_UShort SubstCount; /* number of SubstLookupRecords */
+ HB_UShort* Lookahead; /* array of lookahead glyph IDs */
+ HB_UShort SubstCount; /* number of SubstLookupRecords */
HB_SubstLookupRecord* SubstLookupRecord;
/* array of SubstLookupRecords */
};
struct HB_ChainSubRuleSet_
{
- FT_UShort ChainSubRuleCount;
+ HB_UShort ChainSubRuleCount;
/* number of ChainSubRule tables */
HB_ChainSubRule* ChainSubRule; /* array of ChainSubRule tables */
};
struct HB_ChainContextSubstFormat1_
{
HB_Coverage Coverage; /* Coverage table */
- FT_UShort ChainSubRuleSetCount;
+ HB_UShort ChainSubRuleSetCount;
/* number of ChainSubRuleSet tables */
HB_ChainSubRuleSet* ChainSubRuleSet;
/* array of ChainSubRuleSet tables */
struct HB_ChainSubClassRule_
{
- FT_UShort BacktrackGlyphCount;
+ HB_UShort BacktrackGlyphCount;
/* total number of backtrack
classes */
- FT_UShort* Backtrack; /* array of backtrack classes */
- FT_UShort InputGlyphCount;
+ HB_UShort* Backtrack; /* array of backtrack classes */
+ HB_UShort InputGlyphCount;
/* total number of context classes */
- FT_UShort* Input; /* array of context classes */
- FT_UShort LookaheadGlyphCount;
+ HB_UShort* Input; /* array of context classes */
+ HB_UShort LookaheadGlyphCount;
/* total number of lookahead
classes */
- FT_UShort* Lookahead; /* array of lookahead classes */
- FT_UShort SubstCount; /* number of SubstLookupRecords */
+ HB_UShort* Lookahead; /* array of lookahead classes */
+ HB_UShort SubstCount; /* number of SubstLookupRecords */
HB_SubstLookupRecord* SubstLookupRecord;
/* array of substitution lookups */
};
struct HB_ChainSubClassSet_
{
- FT_UShort ChainSubClassRuleCount;
+ HB_UShort ChainSubClassRuleCount;
/* number of ChainSubClassRule
tables */
HB_ChainSubClassRule* ChainSubClassRule;
{
HB_Coverage Coverage; /* Coverage table */
- FT_UShort MaxBacktrackLength;
+ HB_UShort MaxBacktrackLength;
/* maximal backtrack length */
HB_ClassDefinition BacktrackClassDef;
/* BacktrackClassDef table */
- FT_UShort MaxInputLength;
+ HB_UShort MaxInputLength;
/* maximal input length */
HB_ClassDefinition InputClassDef;
/* InputClassDef table */
- FT_UShort MaxLookaheadLength;
+ HB_UShort MaxLookaheadLength;
/* maximal lookahead length */
HB_ClassDefinition LookaheadClassDef;
/* LookaheadClassDef table */
- FT_UShort ChainSubClassSetCount;
+ HB_UShort ChainSubClassSetCount;
/* number of ChainSubClassSet
tables */
HB_ChainSubClassSet* ChainSubClassSet;
struct HB_ChainContextSubstFormat3_
{
- FT_UShort BacktrackGlyphCount;
+ HB_UShort BacktrackGlyphCount;
/* number of backtrack glyphs */
HB_Coverage* BacktrackCoverage;
/* array of backtrack Coverage
tables */
- FT_UShort InputGlyphCount;
+ HB_UShort InputGlyphCount;
/* number of input glyphs */
HB_Coverage* InputCoverage;
/* array of input coverage
tables */
- FT_UShort LookaheadGlyphCount;
+ HB_UShort LookaheadGlyphCount;
/* number of lookahead glyphs */
HB_Coverage* LookaheadCoverage;
/* array of lookahead coverage
tables */
- FT_UShort SubstCount; /* number of SubstLookupRecords */
+ HB_UShort SubstCount; /* number of SubstLookupRecords */
HB_SubstLookupRecord* SubstLookupRecord;
/* array of substitution lookups */
};
struct HB_ChainContextSubst_
{
- FT_UShort SubstFormat; /* 1, 2, or 3 */
+ HB_UShort SubstFormat; /* 1, 2, or 3 */
union
{
/* LookupType 7 */
struct HB_ExtensionSubst_
{
- FT_UShort SubstFormat; /* always 1 */
- FT_UShort LookuptType; /* lookup-type of referenced subtable */
+ HB_UShort SubstFormat; /* always 1 */
+ HB_UShort LookuptType; /* lookup-type of referenced subtable */
HB_GSUB_SubTable *subtable; /* referenced subtable */
};
/* LookupType 8 */
struct HB_ReverseChainContextSubst_
{
- FT_UShort SubstFormat; /* always 1 */
+ HB_UShort SubstFormat; /* always 1 */
HB_Coverage Coverage; /* coverage table for input glyphs */
- FT_UShort BacktrackGlyphCount; /* number of backtrack glyphs */
+ HB_UShort BacktrackGlyphCount; /* number of backtrack glyphs */
HB_Coverage* BacktrackCoverage; /* array of backtrack Coverage
tables */
- FT_UShort LookaheadGlyphCount; /* number of lookahead glyphs */
+ HB_UShort LookaheadGlyphCount; /* number of lookahead glyphs */
HB_Coverage* LookaheadCoverage; /* array of lookahead Coverage
tables */
- FT_UShort GlyphCount; /* number of Glyph IDs */
- FT_UShort* Substitute; /* array of substitute Glyph ID */
+ HB_UShort GlyphCount; /* number of Glyph IDs */
+ HB_UShort* Substitute; /* array of substitute Glyph ID */
};
typedef struct HB_ReverseChainContextSubst_ HB_ReverseChainContextSubst;
HB_INTERNAL HB_Error
_HB_GSUB_Load_SubTable( HB_GSUB_SubTable* st,
FT_Stream stream,
- FT_UShort lookup_type );
+ HB_UShort lookup_type );
HB_INTERNAL void
_HB_GSUB_Free_SubTable( HB_GSUB_SubTable* st,
- FT_UShort lookup_type );
+ HB_UShort lookup_type );
-FT_END_HEADER
+HB_END_HEADER
#endif /* HARFBUZZ_GSUB_PRIVATE_H */
#include "harfbuzz-gdef-private.h"
static HB_Error GSUB_Do_Glyph_Lookup( HB_GSUBHeader* gsub,
- FT_UShort lookup_index,
+ HB_UShort lookup_index,
HB_Buffer buffer,
- FT_UShort context_length,
+ HB_UShort context_length,
int nesting_level );
{
FT_Stream stream = face->stream;
HB_Error error;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UInt cur_offset, new_offset, base_offset;
- FT_UShort i, num_lookups;
+ HB_UShort i, num_lookups;
HB_GSUBHeader* gsub;
HB_Lookup* lo;
HB_Error error;
HB_SingleSubst* ss = &st->single;
- FT_UShort n, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, count;
+ HB_UInt cur_offset, new_offset, base_offset;
- FT_UShort* s;
+ HB_UShort* s;
base_offset = FILE_Pos();
ss->ssf.ssf2.Substitute = NULL;
- if ( ALLOC_ARRAY( ss->ssf.ssf2.Substitute, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( ss->ssf.ssf2.Substitute, count, HB_UShort ) )
goto Fail2;
s = ss->ssf.ssf2.Substitute;
static HB_Error Lookup_SingleSubst( HB_GSUBHeader* gsub,
HB_GSUB_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, value, property;
+ HB_UShort index, value, property;
HB_Error error;
HB_SingleSubst* ss = &st->single;
HB_GDEFHeader* gdef = gsub->gdef;
{
HB_Error error;
- FT_UShort n, count;
- FT_UShort* sub;
+ HB_UShort n, count;
+ HB_UShort* sub;
if ( ACCESS_Frame( 2L ) )
if ( count )
{
- if ( ALLOC_ARRAY( s->Substitute, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( s->Substitute, count, HB_UShort ) )
return error;
sub = s->Substitute;
HB_Error error;
HB_MultipleSubst* ms = &st->multiple;
- FT_UShort n = 0, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n = 0, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_Sequence* s;
static void Free_MultipleSubst( HB_GSUB_SubTable* st )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_MultipleSubst* ms = &st->multiple;
HB_Sequence* s;
static HB_Error Lookup_MultipleSubst( HB_GSUBHeader* gsub,
HB_GSUB_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
HB_Error error;
- FT_UShort index, property, n, count;
- FT_UShort*s;
+ HB_UShort index, property, n, count;
+ HB_UShort*s;
HB_MultipleSubst* ms = &st->multiple;
HB_GDEFHeader* gdef = gsub->gdef;
{
HB_Error error;
- FT_UShort n, count;
- FT_UShort* a;
+ HB_UShort n, count;
+ HB_UShort* a;
if ( ACCESS_Frame( 2L ) )
as->Alternate = NULL;
- if ( ALLOC_ARRAY( as->Alternate, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( as->Alternate, count, HB_UShort ) )
return error;
a = as->Alternate;
HB_Error error;
HB_AlternateSubst* as = &st->alternate;
- FT_UShort n = 0, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n = 0, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_AlternateSet* aset;
static void Free_AlternateSubst( HB_GSUB_SubTable* st )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_AlternateSubst* as = &st->alternate;
HB_AlternateSet* aset;
static HB_Error Lookup_AlternateSubst( HB_GSUBHeader* gsub,
HB_GSUB_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
HB_Error error;
- FT_UShort index, value, alt_index, property;
+ HB_UShort index, value, alt_index, property;
HB_AlternateSubst* as = &st->alternate;
HB_GDEFHeader* gdef = gsub->gdef;
HB_AlternateSet aset;
{
HB_Error error;
- FT_UShort n, count;
- FT_UShort* c;
+ HB_UShort n, count;
+ HB_UShort* c;
if ( ACCESS_Frame( 4L ) )
count = l->ComponentCount - 1; /* only ComponentCount - 1 elements */
- if ( ALLOC_ARRAY( l->Component, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( l->Component, count, HB_UShort ) )
return error;
c = l->Component;
{
HB_Error error;
- FT_UShort n = 0, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n = 0, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_Ligature* l;
static void Free_LigatureSet( HB_LigatureSet* ls )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_Ligature* l;
HB_Error error;
HB_LigatureSubst* ls = &st->ligature;
- FT_UShort n = 0, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n = 0, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_LigatureSet* lset;
static void Free_LigatureSubst( HB_GSUB_SubTable* st )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_LigatureSubst* ls = &st->ligature;
HB_LigatureSet* lset;
static HB_Error Lookup_LigatureSubst( HB_GSUBHeader* gsub,
HB_GSUB_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, property;
+ HB_UShort index, property;
HB_Error error;
- FT_UShort numlig, i, j, is_mark, first_is_mark = FALSE;
- FT_UShort* c;
+ HB_UShort numlig, i, j, is_mark, first_is_mark = FALSE;
+ HB_UShort* c;
HB_LigatureSubst* ls = &st->ligature;
HB_GDEFHeader* gdef = gsub->gdef;
if ( error && error != HB_Err_Not_Covered )
return error;
- if ( j + lig->ComponentCount - i == (FT_Long)buffer->in_length )
+ if ( j + lig->ComponentCount - i == (HB_Int)buffer->in_length )
goto next_ligature;
j++;
}
}
else
{
- FT_UShort ligID = _hb_buffer_allocate_ligid( buffer );
+ HB_UShort ligID = _hb_buffer_allocate_ligid( buffer );
if ( ADD_String( buffer, i, 1, &lig->LigGlyph,
0xFFFF, ligID ) )
return error;
}
else
{
- FT_UShort ligID = _hb_buffer_allocate_ligid( buffer );
+ HB_UShort ligID = _hb_buffer_allocate_ligid( buffer );
if ( ADD_Glyph( buffer, lig->LigGlyph, 0xFFFF, ligID ) )
return error;
matches the subrule. */
static HB_Error Do_ContextSubst( HB_GSUBHeader* gsub,
- FT_UShort GlyphCount,
- FT_UShort SubstCount,
+ HB_UShort GlyphCount,
+ HB_UShort SubstCount,
HB_SubstLookupRecord* subst,
HB_Buffer buffer,
int nesting_level )
{
HB_Error error;
- FT_ULong i, old_pos;
+ HB_UInt i, old_pos;
i = 0;
{
HB_Error error;
- FT_UShort n, count;
- FT_UShort* i;
+ HB_UShort n, count;
+ HB_UShort* i;
HB_SubstLookupRecord* slr;
count = sr->GlyphCount - 1; /* only GlyphCount - 1 elements */
- if ( ALLOC_ARRAY( sr->Input, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( sr->Input, count, HB_UShort ) )
return error;
i = sr->Input;
{
HB_Error error;
- FT_UShort n = 0, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n = 0, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_SubRule* sr;
static void Free_SubRuleSet( HB_SubRuleSet* srs )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_SubRule* sr;
{
HB_Error error;
- FT_UShort n = 0, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n = 0, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_SubRuleSet* srs;
static void Free_ContextSubst1( HB_ContextSubstFormat1* csf1 )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_SubRuleSet* srs;
{
HB_Error error;
- FT_UShort n, count;
+ HB_UShort n, count;
- FT_UShort* c;
+ HB_UShort* c;
HB_SubstLookupRecord* slr;
- FT_Bool* d;
+ HB_Bool* d;
if ( ACCESS_Frame( 4L ) )
count = scr->GlyphCount - 1; /* only GlyphCount - 1 elements */
- if ( ALLOC_ARRAY( scr->Class, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( scr->Class, count, HB_UShort ) )
return error;
c = scr->Class;
{
HB_Error error;
- FT_UShort n = 0, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n = 0, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_SubClassRule* scr;
static void Free_SubClassSet( HB_SubClassSet* scs )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_SubClassRule* scr;
{
HB_Error error;
- FT_UShort n = 0, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n = 0, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_SubClassSet* scs;
static void Free_ContextSubst2( HB_ContextSubstFormat2* csf2 )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_SubClassSet* scs;
{
HB_Error error;
- FT_UShort n = 0, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n = 0, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_Coverage* c;
HB_SubstLookupRecord* slr;
static void Free_ContextSubst3( HB_ContextSubstFormat3* csf3 )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_Coverage* c;
static HB_Error Lookup_ContextSubst1( HB_GSUBHeader* gsub,
HB_ContextSubstFormat1* csf1,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, property;
- FT_UShort i, j, k, numsr;
+ HB_UShort index, property;
+ HB_UShort i, j, k, numsr;
HB_Error error;
HB_SubRule* sr;
if ( error && error != HB_Err_Not_Covered )
return error;
- if ( j + sr[k].GlyphCount - i == (FT_Long)buffer->in_length )
+ if ( j + sr[k].GlyphCount - i == (HB_Int)buffer->in_length )
goto next_subrule;
j++;
}
static HB_Error Lookup_ContextSubst2( HB_GSUBHeader* gsub,
HB_ContextSubstFormat2* csf2,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, property;
+ HB_UShort index, property;
HB_Error error;
- FT_UShort i, j, k, known_classes;
+ HB_UShort i, j, k, known_classes;
- FT_UShort* classes;
- FT_UShort* cl;
+ HB_UShort* classes;
+ HB_UShort* cl;
HB_SubClassSet* scs;
HB_SubClassRule* sr;
if ( error )
return error;
- if ( ALLOC_ARRAY( classes, csf2->MaxContextLength, FT_UShort ) )
+ if ( ALLOC_ARRAY( classes, csf2->MaxContextLength, HB_UShort ) )
return error;
error = _HB_OPEN_Get_Class( &csf2->ClassDef, IN_CURGLYPH(),
if ( error && error != HB_Err_Not_Covered )
goto End;
- if ( j + sr->GlyphCount - i < (FT_Long)buffer->in_length )
+ if ( j + sr->GlyphCount - i < (HB_Int)buffer->in_length )
goto next_subclassrule;
j++;
}
static HB_Error Lookup_ContextSubst3( HB_GSUBHeader* gsub,
HB_ContextSubstFormat3* csf3,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
HB_Error error;
- FT_UShort index, i, j, property;
+ HB_UShort index, i, j, property;
HB_Coverage* c;
HB_GDEFHeader* gdef;
if ( error && error != HB_Err_Not_Covered )
return error;
- if ( j + csf3->GlyphCount - i == (FT_Long)buffer->in_length )
+ if ( j + csf3->GlyphCount - i == (HB_Int)buffer->in_length )
return HB_Err_Not_Covered;
j++;
}
static HB_Error Lookup_ContextSubst( HB_GSUBHeader* gsub,
HB_GSUB_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
HB_ContextSubst* cs = &st->context;
{
HB_Error error;
- FT_UShort n, count;
- FT_UShort* b;
- FT_UShort* i;
- FT_UShort* l;
+ HB_UShort n, count;
+ HB_UShort* b;
+ HB_UShort* i;
+ HB_UShort* l;
HB_SubstLookupRecord* slr;
count = csr->BacktrackGlyphCount;
- if ( ALLOC_ARRAY( csr->Backtrack, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( csr->Backtrack, count, HB_UShort ) )
return error;
b = csr->Backtrack;
count = csr->InputGlyphCount - 1; /* only InputGlyphCount - 1 elements */
- if ( ALLOC_ARRAY( csr->Input, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( csr->Input, count, HB_UShort ) )
goto Fail4;
i = csr->Input;
count = csr->LookaheadGlyphCount;
- if ( ALLOC_ARRAY( csr->Lookahead, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( csr->Lookahead, count, HB_UShort ) )
goto Fail3;
l = csr->Lookahead;
{
HB_Error error;
- FT_UShort n = 0, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n = 0, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_ChainSubRule* csr;
static void Free_ChainSubRuleSet( HB_ChainSubRuleSet* csrs )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_ChainSubRule* csr;
{
HB_Error error;
- FT_UShort n = 0, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n = 0, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_ChainSubRuleSet* csrs;
static void Free_ChainContextSubst1( HB_ChainContextSubstFormat1* ccsf1 )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_ChainSubRuleSet* csrs;
{
HB_Error error;
- FT_UShort n, count;
+ HB_UShort n, count;
- FT_UShort* b;
- FT_UShort* i;
- FT_UShort* l;
+ HB_UShort* b;
+ HB_UShort* i;
+ HB_UShort* l;
HB_SubstLookupRecord* slr;
- FT_Bool* d;
+ HB_Bool* d;
if ( ACCESS_Frame( 2L ) )
count = cscr->BacktrackGlyphCount;
- if ( ALLOC_ARRAY( cscr->Backtrack, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( cscr->Backtrack, count, HB_UShort ) )
return error;
b = cscr->Backtrack;
count = cscr->InputGlyphCount - 1; /* only InputGlyphCount - 1 elements */
- if ( ALLOC_ARRAY( cscr->Input, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( cscr->Input, count, HB_UShort ) )
goto Fail4;
i = cscr->Input;
count = cscr->LookaheadGlyphCount;
- if ( ALLOC_ARRAY( cscr->Lookahead, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( cscr->Lookahead, count, HB_UShort ) )
goto Fail3;
l = cscr->Lookahead;
{
HB_Error error;
- FT_UShort n = 0, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n = 0, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_ChainSubClassRule* cscr;
static void Free_ChainSubClassSet( HB_ChainSubClassSet* cscs )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_ChainSubClassRule* cscr;
{
HB_Error error;
- FT_UShort n = 0, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
- FT_ULong backtrack_offset, input_offset, lookahead_offset;
+ HB_UShort n = 0, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
+ HB_UInt backtrack_offset, input_offset, lookahead_offset;
HB_ChainSubClassSet* cscs;
static void Free_ChainContextSubst2( HB_ChainContextSubstFormat2* ccsf2 )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_ChainSubClassSet* cscs;
{
HB_Error error;
- FT_UShort n, nb = 0, ni =0, nl = 0, m, count;
- FT_UShort backtrack_count, input_count, lookahead_count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, nb = 0, ni =0, nl = 0, m, count;
+ HB_UShort backtrack_count, input_count, lookahead_count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_Coverage* b;
HB_Coverage* i;
static void Free_ChainContextSubst3( HB_ChainContextSubstFormat3* ccsf3 )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_Coverage* c;
static HB_Error Lookup_ChainContextSubst1( HB_GSUBHeader* gsub,
HB_ChainContextSubstFormat1* ccsf1,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, property;
- FT_UShort i, j, k, num_csr;
- FT_UShort bgc, igc, lgc;
+ HB_UShort index, property;
+ HB_UShort i, j, k, num_csr;
+ HB_UShort bgc, igc, lgc;
HB_Error error;
HB_ChainSubRule* csr;
if ( error && error != HB_Err_Not_Covered )
return error;
- if ( j + igc - i + lgc == (FT_Long)buffer->in_length )
+ if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
goto next_chainsubrule;
j++;
}
if ( error && error != HB_Err_Not_Covered )
return error;
- if ( j + lgc - i == (FT_Long)buffer->in_length )
+ if ( j + lgc - i == (HB_Int)buffer->in_length )
goto next_chainsubrule;
j++;
}
static HB_Error Lookup_ChainContextSubst2( HB_GSUBHeader* gsub,
HB_ChainContextSubstFormat2* ccsf2,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, property;
+ HB_UShort index, property;
HB_Error error;
- FT_UShort i, j, k;
- FT_UShort bgc, igc, lgc;
- FT_UShort known_backtrack_classes,
+ HB_UShort i, j, k;
+ HB_UShort bgc, igc, lgc;
+ HB_UShort known_backtrack_classes,
known_input_classes,
known_lookahead_classes;
- FT_UShort* backtrack_classes;
- FT_UShort* input_classes;
- FT_UShort* lookahead_classes;
+ HB_UShort* backtrack_classes;
+ HB_UShort* input_classes;
+ HB_UShort* lookahead_classes;
- FT_UShort* bc;
- FT_UShort* ic;
- FT_UShort* lc;
+ HB_UShort* bc;
+ HB_UShort* ic;
+ HB_UShort* lc;
HB_ChainSubClassSet* cscs;
HB_ChainSubClassRule ccsr;
if ( error )
return error;
- if ( ALLOC_ARRAY( backtrack_classes, ccsf2->MaxBacktrackLength, FT_UShort ) )
+ if ( ALLOC_ARRAY( backtrack_classes, ccsf2->MaxBacktrackLength, HB_UShort ) )
return error;
known_backtrack_classes = 0;
- if ( ALLOC_ARRAY( input_classes, ccsf2->MaxInputLength, FT_UShort ) )
+ if ( ALLOC_ARRAY( input_classes, ccsf2->MaxInputLength, HB_UShort ) )
goto End3;
known_input_classes = 1;
- if ( ALLOC_ARRAY( lookahead_classes, ccsf2->MaxLookaheadLength, FT_UShort ) )
+ if ( ALLOC_ARRAY( lookahead_classes, ccsf2->MaxLookaheadLength, HB_UShort ) )
goto End2;
known_lookahead_classes = 0;
if ( error && error != HB_Err_Not_Covered )
goto End1;
- if ( j + igc - i + lgc == (FT_Long)buffer->in_length )
+ if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
goto next_chainsubclassrule;
j++;
}
if ( error && error != HB_Err_Not_Covered )
goto End1;
- if ( j + lgc - i == (FT_Long)buffer->in_length )
+ if ( j + lgc - i == (HB_Int)buffer->in_length )
goto next_chainsubclassrule;
j++;
}
static HB_Error Lookup_ChainContextSubst3( HB_GSUBHeader* gsub,
HB_ChainContextSubstFormat3* ccsf3,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, i, j, property;
- FT_UShort bgc, igc, lgc;
+ HB_UShort index, i, j, property;
+ HB_UShort bgc, igc, lgc;
HB_Error error;
HB_Coverage* bc;
if ( error && error != HB_Err_Not_Covered )
return error;
- if ( j + igc - i + lgc == (FT_Long)buffer->in_length )
+ if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
return HB_Err_Not_Covered;
j++;
}
if ( error && error != HB_Err_Not_Covered )
return error;
- if ( j + lgc - i == (FT_Long)buffer->in_length )
+ if ( j + lgc - i == (HB_Int)buffer->in_length )
return HB_Err_Not_Covered;
j++;
}
static HB_Error Lookup_ChainContextSubst( HB_GSUBHeader* gsub,
HB_GSUB_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
HB_ChainContextSubst* ccs = &st->chain;
HB_Error error;
HB_ReverseChainContextSubst* rccs = &st->reverse;
- FT_UShort m, count;
+ HB_UShort m, count;
- FT_UShort nb = 0, nl = 0, n;
- FT_UShort backtrack_count, lookahead_count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort nb = 0, nl = 0, n;
+ HB_UShort backtrack_count, lookahead_count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_Coverage* b;
HB_Coverage* l;
- FT_UShort* sub;
+ HB_UShort* sub;
base_offset = FILE_Pos();
count = rccs->GlyphCount;
if ( ALLOC_ARRAY( rccs->Substitute, count,
- FT_UShort ) )
+ HB_UShort ) )
goto Fail2;
sub = rccs->Substitute;
static void Free_ReverseChainContextSubst( HB_GSUB_SubTable* st )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_ReverseChainContextSubst* rccs = &st->reverse;
HB_Coverage* c;
static HB_Error Lookup_ReverseChainContextSubst( HB_GSUBHeader* gsub,
HB_GSUB_SubTable* st,
HB_Buffer buffer,
- FT_UShort flags,
- FT_UShort context_length,
+ HB_UShort flags,
+ HB_UShort context_length,
int nesting_level )
{
- FT_UShort index, input_index, i, j, property;
- FT_UShort bgc, lgc;
+ HB_UShort index, input_index, i, j, property;
+ HB_UShort bgc, lgc;
HB_Error error;
HB_ReverseChainContextSubst* rccs = &st->reverse;
if ( error && error != HB_Err_Not_Covered )
return error;
- if ( j + lgc - i == (FT_Long)buffer->in_length )
+ if ( j + lgc - i == (HB_Int)buffer->in_length )
return HB_Err_Not_Covered;
j++;
}
HB_Error HB_GSUB_Select_Script( HB_GSUBHeader* gsub,
- FT_ULong script_tag,
- FT_UShort* script_index )
+ HB_UInt script_tag,
+ HB_UShort* script_index )
{
- FT_UShort n;
+ HB_UShort n;
HB_ScriptList* sl;
HB_ScriptRecord* sr;
HB_Error HB_GSUB_Select_Language( HB_GSUBHeader* gsub,
- FT_ULong language_tag,
- FT_UShort script_index,
- FT_UShort* language_index,
- FT_UShort* req_feature_index )
+ HB_UInt language_tag,
+ HB_UShort script_index,
+ HB_UShort* language_index,
+ HB_UShort* req_feature_index )
{
- FT_UShort n;
+ HB_UShort n;
HB_ScriptList* sl;
HB_ScriptRecord* sr;
HB_Error HB_GSUB_Select_Feature( HB_GSUBHeader* gsub,
- FT_ULong feature_tag,
- FT_UShort script_index,
- FT_UShort language_index,
- FT_UShort* feature_index )
+ HB_UInt feature_tag,
+ HB_UShort script_index,
+ HB_UShort language_index,
+ HB_UShort* feature_index )
{
- FT_UShort n;
+ HB_UShort n;
HB_ScriptList* sl;
HB_ScriptRecord* sr;
HB_Script* s;
HB_LangSysRecord* lsr;
HB_LangSys* ls;
- FT_UShort* fi;
+ HB_UShort* fi;
HB_FeatureList* fl;
HB_FeatureRecord* fr;
HB_Error HB_GSUB_Query_Scripts( HB_GSUBHeader* gsub,
- FT_ULong** script_tag_list )
+ HB_UInt** script_tag_list )
{
- FT_UShort n;
+ HB_UShort n;
HB_Error error;
- FT_ULong* stl;
+ HB_UInt* stl;
HB_ScriptList* sl;
HB_ScriptRecord* sr;
sl = &gsub->ScriptList;
sr = sl->ScriptRecord;
- if ( ALLOC_ARRAY( stl, sl->ScriptCount + 1, FT_ULong ) )
+ if ( ALLOC_ARRAY( stl, sl->ScriptCount + 1, HB_UInt ) )
return error;
for ( n = 0; n < sl->ScriptCount; n++ )
HB_Error HB_GSUB_Query_Languages( HB_GSUBHeader* gsub,
- FT_UShort script_index,
- FT_ULong** language_tag_list )
+ HB_UShort script_index,
+ HB_UInt** language_tag_list )
{
- FT_UShort n;
+ HB_UShort n;
HB_Error error;
- FT_ULong* ltl;
+ HB_UInt* ltl;
HB_ScriptList* sl;
HB_ScriptRecord* sr;
s = &sr[script_index].Script;
lsr = s->LangSysRecord;
- if ( ALLOC_ARRAY( ltl, s->LangSysCount + 1, FT_ULong ) )
+ if ( ALLOC_ARRAY( ltl, s->LangSysCount + 1, HB_UInt ) )
return error;
for ( n = 0; n < s->LangSysCount; n++ )
HB_Error HB_GSUB_Query_Features( HB_GSUBHeader* gsub,
- FT_UShort script_index,
- FT_UShort language_index,
- FT_ULong** feature_tag_list )
+ HB_UShort script_index,
+ HB_UShort language_index,
+ HB_UInt** feature_tag_list )
{
- FT_UShort n;
+ HB_UShort n;
HB_Error error;
- FT_ULong* ftl;
+ HB_UInt* ftl;
HB_ScriptList* sl;
HB_ScriptRecord* sr;
HB_Script* s;
HB_LangSysRecord* lsr;
HB_LangSys* ls;
- FT_UShort* fi;
+ HB_UShort* fi;
HB_FeatureList* fl;
HB_FeatureRecord* fr;
fi = ls->FeatureIndex;
- if ( ALLOC_ARRAY( ftl, ls->FeatureCount + 1, FT_ULong ) )
+ if ( ALLOC_ARRAY( ftl, ls->FeatureCount + 1, HB_UInt ) )
return error;
for ( n = 0; n < ls->FeatureCount; n++ )
/* Do an individual subtable lookup. Returns HB_Err_Ok if substitution
has been done, or HB_Err_Not_Covered if not. */
static HB_Error GSUB_Do_Glyph_Lookup( HB_GSUBHeader* gsub,
- FT_UShort lookup_index,
+ HB_UShort lookup_index,
HB_Buffer buffer,
- FT_UShort context_length,
+ HB_UShort context_length,
int nesting_level )
{
HB_Error error = HB_Err_Not_Covered;
- FT_UShort i, flags, lookup_count;
+ HB_UShort i, flags, lookup_count;
HB_Lookup* lo;
int lookup_type;
HB_INTERNAL HB_Error
_HB_GSUB_Load_SubTable( HB_GSUB_SubTable* st,
FT_Stream stream,
- FT_UShort lookup_type )
+ HB_UShort lookup_type )
{
switch (lookup_type) {
case HB_GSUB_LOOKUP_SINGLE: return Load_SingleSubst ( st, stream );
HB_INTERNAL void
_HB_GSUB_Free_SubTable( HB_GSUB_SubTable* st,
- FT_UShort lookup_type )
+ HB_UShort lookup_type )
{
switch ( lookup_type ) {
case HB_GSUB_LOOKUP_SINGLE: Free_SingleSubst ( st ); return;
/* apply one lookup to the input string object */
static HB_Error GSUB_Do_String_Lookup( HB_GSUBHeader* gsub,
- FT_UShort lookup_index,
+ HB_UShort lookup_index,
HB_Buffer buffer )
{
HB_Error error, retError = HB_Err_Not_Covered;
- FT_UInt* properties = gsub->LookupList.Properties;
+ HB_UInt* properties = gsub->LookupList.Properties;
int lookup_type = gsub->LookupList.Lookup[lookup_index].LookupType;
const int nesting_level = 0;
/* 0xFFFF indicates that we don't have a context length yet */
- const FT_UShort context_length = 0xFFFF;
+ const HB_UShort context_length = 0xFFFF;
switch (lookup_type) {
HB_Error HB_GSUB_Add_Feature( HB_GSUBHeader* gsub,
- FT_UShort feature_index,
- FT_UInt property )
+ HB_UShort feature_index,
+ HB_UInt property )
{
- FT_UShort i;
+ HB_UShort i;
HB_Feature feature;
- FT_UInt* properties;
- FT_UShort* index;
- FT_UShort lookup_count;
+ HB_UInt* properties;
+ HB_UShort* index;
+ HB_UShort lookup_count;
/* Each feature can only be added once */
for ( i = 0; i < feature.LookupListCount; i++ )
{
- FT_UShort lookup_index = index[i];
+ HB_UShort lookup_index = index[i];
if (lookup_index < lookup_count)
properties[lookup_index] |= property;
}
HB_Error HB_GSUB_Clear_Features( HB_GSUBHeader* gsub )
{
- FT_UShort i;
+ HB_UShort i;
- FT_UInt* properties;
+ HB_UInt* properties;
if ( !gsub )
for ( i = 0; i < num_features; i++)
{
- FT_UShort feature_index = gsub->FeatureList.ApplyOrder[i];
+ HB_UShort feature_index = gsub->FeatureList.ApplyOrder[i];
HB_Feature feature = gsub->FeatureList.FeatureRecord[feature_index].Feature;
for ( j = 0; j < feature.LookupListCount; j++ )
{
- FT_UShort lookup_index = feature.LookupListIndex[j];
+ HB_UShort lookup_index = feature.LookupListIndex[j];
/* Skip nonexistant lookups */
if (lookup_index >= lookup_count)
#include "harfbuzz-gdef.h"
#include "harfbuzz-buffer.h"
-FT_BEGIN_HEADER
+HB_BEGIN_HEADER
#define HB_Err_Invalid_GSUB_SubTable_Format 0x1010
#define HB_Err_Invalid_GSUB_SubTable 0x1011
HB_GSUB_Register_Alternate_Function(). The function must return an
index into the `alternates' array. */
-typedef FT_UShort (*HB_AltFunction)(FT_ULong pos,
- FT_UShort glyphID,
- FT_UShort num_alternates,
- FT_UShort* alternates,
+typedef HB_UShort (*HB_AltFunction)(HB_UInt pos,
+ HB_UShort glyphID,
+ HB_UShort num_alternates,
+ HB_UShort* alternates,
void* data );
struct HB_GSUBHeader_
{
- FT_ULong offset;
+ HB_UInt offset;
FT_Fixed Version;
HB_Error HB_GSUB_Select_Script( HB_GSUBHeader* gsub,
- FT_ULong script_tag,
- FT_UShort* script_index );
+ HB_UInt script_tag,
+ HB_UShort* script_index );
HB_Error HB_GSUB_Select_Language( HB_GSUBHeader* gsub,
- FT_ULong language_tag,
- FT_UShort script_index,
- FT_UShort* language_index,
- FT_UShort* req_feature_index );
+ HB_UInt language_tag,
+ HB_UShort script_index,
+ HB_UShort* language_index,
+ HB_UShort* req_feature_index );
HB_Error HB_GSUB_Select_Feature( HB_GSUBHeader* gsub,
- FT_ULong feature_tag,
- FT_UShort script_index,
- FT_UShort language_index,
- FT_UShort* feature_index );
+ HB_UInt feature_tag,
+ HB_UShort script_index,
+ HB_UShort language_index,
+ HB_UShort* feature_index );
HB_Error HB_GSUB_Query_Scripts( HB_GSUBHeader* gsub,
- FT_ULong** script_tag_list );
+ HB_UInt** script_tag_list );
HB_Error HB_GSUB_Query_Languages( HB_GSUBHeader* gsub,
- FT_UShort script_index,
- FT_ULong** language_tag_list );
+ HB_UShort script_index,
+ HB_UInt** language_tag_list );
HB_Error HB_GSUB_Query_Features( HB_GSUBHeader* gsub,
- FT_UShort script_index,
- FT_UShort language_index,
- FT_ULong** feature_tag_list );
+ HB_UShort script_index,
+ HB_UShort language_index,
+ HB_UInt** feature_tag_list );
HB_Error HB_GSUB_Add_Feature( HB_GSUBHeader* gsub,
- FT_UShort feature_index,
- FT_UInt property );
+ HB_UShort feature_index,
+ HB_UInt property );
HB_Error HB_GSUB_Clear_Features( HB_GSUBHeader* gsub );
HB_Buffer buffer );
-FT_END_HEADER
+HB_END_HEADER
#endif /* HARFBUZZ_GSUB_H */
#include FT_FREETYPE_H
#include FT_TRUETYPE_TAGS_H
-FT_BEGIN_HEADER
+#include "harfbuzz-global.h"
+
+HB_BEGIN_HEADER
#ifndef HB_INTERNAL
# define HB_INTERNAL
#define COPY_Glyph( buffer ) \
( (error = _hb_buffer_copy_output_glyph ( buffer ) ) != HB_Err_Ok )
-FT_END_HEADER
+HB_END_HEADER
#endif /* HARFBUZZ_IMPL_H */
#include "harfbuzz-gsub-private.h"
#include "harfbuzz-gpos-private.h"
-FT_BEGIN_HEADER
+HB_BEGIN_HEADER
struct HB_SubTable_
FT_Stream input );
HB_INTERNAL HB_Error
_HB_OPEN_Load_ClassDefinition( HB_ClassDefinition* cd,
- FT_UShort limit,
+ HB_UShort limit,
FT_Stream input );
HB_INTERNAL HB_Error
_HB_OPEN_Load_EmptyOrClassDefinition( HB_ClassDefinition* cd,
- FT_UShort limit,
- FT_ULong class_offset,
- FT_ULong base_offset,
+ HB_UShort limit,
+ HB_UInt class_offset,
+ HB_UInt base_offset,
FT_Stream stream );
HB_INTERNAL HB_Error
_HB_OPEN_Load_Device( HB_Device* d,
HB_INTERNAL HB_Error
_HB_OPEN_Coverage_Index( HB_Coverage* c,
- FT_UShort glyphID,
- FT_UShort* index );
+ HB_UShort glyphID,
+ HB_UShort* index );
HB_INTERNAL HB_Error
_HB_OPEN_Get_Class( HB_ClassDefinition* cd,
- FT_UShort glyphID,
- FT_UShort* klass,
- FT_UShort* index );
+ HB_UShort glyphID,
+ HB_UShort* klass,
+ HB_UShort* index );
HB_INTERNAL HB_Error
_HB_OPEN_Get_Device( HB_Device* d,
- FT_UShort size,
- FT_Short* value );
+ HB_UShort size,
+ HB_Short* value );
-FT_END_HEADER
+HB_END_HEADER
#endif /* HARFBUZZ_OPEN_PRIVATE_H */
FT_Stream stream )
{
HB_Error error;
- FT_UShort n, count;
- FT_UShort* fi;
+ HB_UShort n, count;
+ HB_UShort* fi;
if ( ACCESS_Frame( 6L ) )
ls->FeatureIndex = NULL;
- if ( ALLOC_ARRAY( ls->FeatureIndex, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( ls->FeatureIndex, count, HB_UShort ) )
return error;
if ( ACCESS_Frame( count * 2L ) )
FT_Stream stream )
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_LangSysRecord* lsr;
static void Free_Script( HB_Script* s )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_LangSysRecord* lsr;
{
HB_Error error;
- FT_UShort n, script_count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, script_count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_ScriptRecord* sr;
HB_INTERNAL void
_HB_OPEN_Free_ScriptList( HB_ScriptList* sl )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_ScriptRecord* sr;
{
HB_Error error;
- FT_UShort n, count;
+ HB_UShort n, count;
- FT_UShort* lli;
+ HB_UShort* lli;
if ( ACCESS_Frame( 4L ) )
f->LookupListIndex = NULL;
- if ( ALLOC_ARRAY( f->LookupListIndex, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( f->LookupListIndex, count, HB_UShort ) )
return error;
lli = f->LookupListIndex;
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_FeatureRecord* fr;
if ( ALLOC_ARRAY( fl->FeatureRecord, count, HB_FeatureRecord ) )
return error;
- if ( ALLOC_ARRAY( fl->ApplyOrder, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( fl->ApplyOrder, count, HB_UShort ) )
goto Fail2;
fl->ApplyCount = 0;
HB_INTERNAL void
_HB_OPEN_Free_FeatureList( HB_FeatureList* fl )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_FeatureRecord* fr;
static HB_Error Load_SubTable( HB_SubTable* st,
FT_Stream stream,
HB_Type table_type,
- FT_UShort lookup_type )
+ HB_UShort lookup_type )
{
if ( table_type == HB_Type_GSUB )
return _HB_GSUB_Load_SubTable ( &st->st.gsub, stream, lookup_type );
static void Free_SubTable( HB_SubTable* st,
HB_Type table_type,
- FT_UShort lookup_type )
+ HB_UShort lookup_type )
{
if ( table_type == HB_Type_GSUB )
_HB_GSUB_Free_SubTable ( &st->st.gsub, lookup_type );
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_SubTable* st;
- FT_Bool is_extension = FALSE;
+ HB_Bool is_extension = FALSE;
base_offset = FILE_Pos();
static void Free_Lookup( HB_Lookup* l,
HB_Type type )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_SubTable* st;
{
HB_Error error;
- FT_UShort n, m, count;
- FT_ULong cur_offset, new_offset, base_offset;
+ HB_UShort n, m, count;
+ HB_UInt cur_offset, new_offset, base_offset;
HB_Lookup* l;
if ( ALLOC_ARRAY( ll->Lookup, count, HB_Lookup ) )
return error;
- if ( ALLOC_ARRAY( ll->Properties, count, FT_UInt ) )
+ if ( ALLOC_ARRAY( ll->Properties, count, HB_UInt ) )
goto Fail2;
l = ll->Lookup;
_HB_OPEN_Free_LookupList( HB_LookupList* ll,
HB_Type type )
{
- FT_UShort n, count;
+ HB_UShort n, count;
HB_Lookup* l;
{
HB_Error error;
- FT_UShort n, count;
+ HB_UShort n, count;
- FT_UShort* ga;
+ HB_UShort* ga;
if ( ACCESS_Frame( 2L ) )
cf1->GlyphArray = NULL;
- if ( ALLOC_ARRAY( cf1->GlyphArray, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( cf1->GlyphArray, count, HB_UShort ) )
return error;
ga = cf1->GlyphArray;
{
HB_Error error;
- FT_UShort n, count;
+ HB_UShort n, count;
HB_RangeRecord* rr;
static HB_Error Coverage_Index1( HB_CoverageFormat1* cf1,
- FT_UShort glyphID,
- FT_UShort* index )
+ HB_UShort glyphID,
+ HB_UShort* index )
{
- FT_UShort min, max, new_min, new_max, middle;
+ HB_UShort min, max, new_min, new_max, middle;
- FT_UShort* array = cf1->GlyphArray;
+ HB_UShort* array = cf1->GlyphArray;
/* binary search */
static HB_Error Coverage_Index2( HB_CoverageFormat2* cf2,
- FT_UShort glyphID,
- FT_UShort* index )
+ HB_UShort glyphID,
+ HB_UShort* index )
{
- FT_UShort min, max, new_min, new_max, middle;
+ HB_UShort min, max, new_min, new_max, middle;
HB_RangeRecord* rr = cf2->RangeRecord;
HB_INTERNAL HB_Error
_HB_OPEN_Coverage_Index( HB_Coverage* c,
- FT_UShort glyphID,
- FT_UShort* index )
+ HB_UShort glyphID,
+ HB_UShort* index )
{
switch ( c->CoverageFormat )
{
/* ClassDefFormat1 */
static HB_Error Load_ClassDef1( HB_ClassDefinition* cd,
- FT_UShort limit,
+ HB_UShort limit,
FT_Stream stream )
{
HB_Error error;
- FT_UShort n, count;
+ HB_UShort n, count;
- FT_UShort* cva;
- FT_Bool* d;
+ HB_UShort* cva;
+ HB_Bool* d;
HB_ClassDefFormat1* cdf1;
cdf1->ClassValueArray = NULL;
- if ( ALLOC_ARRAY( cdf1->ClassValueArray, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( cdf1->ClassValueArray, count, HB_UShort ) )
return error;
d = cd->Defined;
/* ClassDefFormat2 */
static HB_Error Load_ClassDef2( HB_ClassDefinition* cd,
- FT_UShort limit,
+ HB_UShort limit,
FT_Stream stream )
{
HB_Error error;
- FT_UShort n, count;
+ HB_UShort n, count;
HB_ClassRangeRecord* crr;
- FT_Bool* d;
+ HB_Bool* d;
HB_ClassDefFormat2* cdf2;
HB_INTERNAL HB_Error
_HB_OPEN_Load_ClassDefinition( HB_ClassDefinition* cd,
- FT_UShort limit,
+ HB_UShort limit,
FT_Stream stream )
{
HB_Error error;
- if ( ALLOC_ARRAY( cd->Defined, limit, FT_Bool ) )
+ if ( ALLOC_ARRAY( cd->Defined, limit, HB_Bool ) )
return error;
if ( ACCESS_Frame( 2L ) )
{
HB_Error error;
- if ( ALLOC_ARRAY( cd->Defined, 1, FT_Bool ) )
+ if ( ALLOC_ARRAY( cd->Defined, 1, HB_Bool ) )
return error;
cd->ClassFormat = 1; /* Meaningless */
cd->Defined[0] = FALSE;
- if ( ALLOC_ARRAY( cd->cd.cd1.ClassValueArray, 1, FT_UShort ) )
+ if ( ALLOC_ARRAY( cd->cd.cd1.ClassValueArray, 1, HB_UShort ) )
goto Fail;
return HB_Err_Ok;
HB_INTERNAL HB_Error
_HB_OPEN_Load_EmptyOrClassDefinition( HB_ClassDefinition* cd,
- FT_UShort limit,
- FT_ULong class_offset,
- FT_ULong base_offset,
+ HB_UShort limit,
+ HB_UInt class_offset,
+ HB_UInt base_offset,
FT_Stream stream )
{
HB_Error error;
- FT_ULong cur_offset;
+ HB_UInt cur_offset;
cur_offset = FILE_Pos();
static HB_Error Get_Class1( HB_ClassDefFormat1* cdf1,
- FT_UShort glyphID,
- FT_UShort* klass,
- FT_UShort* index )
+ HB_UShort glyphID,
+ HB_UShort* klass,
+ HB_UShort* index )
{
- FT_UShort* cva = cdf1->ClassValueArray;
+ HB_UShort* cva = cdf1->ClassValueArray;
if ( index )
in case of failure for constructed GDEF tables */
static HB_Error Get_Class2( HB_ClassDefFormat2* cdf2,
- FT_UShort glyphID,
- FT_UShort* klass,
- FT_UShort* index )
+ HB_UShort glyphID,
+ HB_UShort* klass,
+ HB_UShort* index )
{
HB_Error error = HB_Err_Ok;
- FT_UShort min, max, new_min, new_max, middle;
+ HB_UShort min, max, new_min, new_max, middle;
HB_ClassRangeRecord* crr = cdf2->ClassRangeRecord;
HB_INTERNAL HB_Error
_HB_OPEN_Get_Class( HB_ClassDefinition* cd,
- FT_UShort glyphID,
- FT_UShort* klass,
- FT_UShort* index )
+ HB_UShort glyphID,
+ HB_UShort* klass,
+ HB_UShort* index )
{
switch ( cd->ClassFormat )
{
{
HB_Error error;
- FT_UShort n, count;
+ HB_UShort n, count;
- FT_UShort* dv;
+ HB_UShort* dv;
if ( ACCESS_Frame( 6L ) )
count = ( ( d->EndSize - d->StartSize + 1 ) >>
( 4 - d->DeltaFormat ) ) + 1;
- if ( ALLOC_ARRAY( d->DeltaValue, count, FT_UShort ) )
+ if ( ALLOC_ARRAY( d->DeltaValue, count, HB_UShort ) )
return error;
if ( ACCESS_Frame( count * 2L ) )
HB_INTERNAL HB_Error
_HB_OPEN_Get_Device( HB_Device* d,
- FT_UShort size,
- FT_Short* value )
+ HB_UShort size,
+ HB_Short* value )
{
- FT_UShort byte, bits, mask, f, s;
+ HB_UShort byte, bits, mask, f, s;
f = d->DeltaFormat;
bits = byte >> ( 16 - ( ( s % ( 1 << ( 4 - f ) ) + 1 ) << f ) );
mask = 0xFFFF >> ( 16 - ( 1 << f ) );
- *value = (FT_Short)( bits & mask );
+ *value = (HB_Short)( bits & mask );
/* conversion to a signed value */
#include <ft2build.h>
#include FT_FREETYPE_H
-FT_BEGIN_HEADER
+#include "harfbuzz-global.h"
+
+HB_BEGIN_HEADER
/* Use this if a feature applies to all glyphs */
#define HB_ALL_GLYPHS 0xFFFF
struct HB_LangSys_
{
- FT_UShort LookupOrderOffset; /* always 0 for TT Open 1.0 */
- FT_UShort ReqFeatureIndex; /* required FeatureIndex */
- FT_UShort FeatureCount; /* number of Feature indices */
- FT_UShort* FeatureIndex; /* array of Feature indices */
+ HB_UShort LookupOrderOffset; /* always 0 for TT Open 1.0 */
+ HB_UShort ReqFeatureIndex; /* required FeatureIndex */
+ HB_UShort FeatureCount; /* number of Feature indices */
+ HB_UShort* FeatureIndex; /* array of Feature indices */
};
typedef struct HB_LangSys_ HB_LangSys;
struct HB_LangSysRecord_
{
- FT_ULong LangSysTag; /* LangSysTag identifier */
+ HB_UInt LangSysTag; /* LangSysTag identifier */
HB_LangSys LangSys; /* LangSys table */
};
struct HB_Script_
{
HB_LangSys DefaultLangSys; /* DefaultLangSys table */
- FT_UShort LangSysCount; /* number of LangSysRecords */
+ HB_UShort LangSysCount; /* number of LangSysRecords */
HB_LangSysRecord* LangSysRecord; /* array of LangSysRecords */
};
struct HB_ScriptRecord_
{
- FT_ULong ScriptTag; /* ScriptTag identifier */
+ HB_UInt ScriptTag; /* ScriptTag identifier */
HB_Script Script; /* Script table */
};
struct HB_ScriptList_
{
- FT_UShort ScriptCount; /* number of ScriptRecords */
+ HB_UShort ScriptCount; /* number of ScriptRecords */
HB_ScriptRecord* ScriptRecord; /* array of ScriptRecords */
};
struct HB_Feature_
{
- FT_UShort FeatureParams; /* always 0 for TT Open 1.0 */
- FT_UShort LookupListCount; /* number of LookupList indices */
- FT_UShort* LookupListIndex; /* array of LookupList indices */
+ HB_UShort FeatureParams; /* always 0 for TT Open 1.0 */
+ HB_UShort LookupListCount; /* number of LookupList indices */
+ HB_UShort* LookupListIndex; /* array of LookupList indices */
};
typedef struct HB_Feature_ HB_Feature;
struct HB_FeatureRecord_
{
- FT_ULong FeatureTag; /* FeatureTag identifier */
+ HB_UInt FeatureTag; /* FeatureTag identifier */
HB_Feature Feature; /* Feature table */
};
struct HB_FeatureList_
{
- FT_UShort FeatureCount; /* number of FeatureRecords */
+ HB_UShort FeatureCount; /* number of FeatureRecords */
HB_FeatureRecord* FeatureRecord; /* array of FeatureRecords */
- FT_UShort* ApplyOrder; /* order to apply features */
- FT_UShort ApplyCount; /* number of elements in ApplyOrder */
+ HB_UShort* ApplyOrder; /* order to apply features */
+ HB_UShort ApplyCount; /* number of elements in ApplyOrder */
};
typedef struct HB_FeatureList_ HB_FeatureList;
struct HB_Lookup_
{
- FT_UShort LookupType; /* Lookup type */
- FT_UShort LookupFlag; /* Lookup qualifiers */
- FT_UShort SubTableCount; /* number of SubTables */
+ HB_UShort LookupType; /* Lookup type */
+ HB_UShort LookupFlag; /* Lookup qualifiers */
+ HB_UShort SubTableCount; /* number of SubTables */
HB_SubTable* SubTable; /* array of SubTables */
};
struct HB_LookupList_
{
- FT_UShort LookupCount; /* number of Lookups */
+ HB_UShort LookupCount; /* number of Lookups */
HB_Lookup* Lookup; /* array of Lookup records */
- FT_UInt* Properties; /* array of flags */
+ HB_UInt* Properties; /* array of flags */
};
typedef struct HB_LookupList_ HB_LookupList;
struct HB_CoverageFormat1_
{
- FT_UShort GlyphCount; /* number of glyphs in GlyphArray */
- FT_UShort* GlyphArray; /* array of glyph IDs */
+ HB_UShort GlyphCount; /* number of glyphs in GlyphArray */
+ HB_UShort* GlyphArray; /* array of glyph IDs */
};
typedef struct HB_CoverageFormat1_ HB_CoverageFormat1;
struct HB_RangeRecord_
{
- FT_UShort Start; /* first glyph ID in the range */
- FT_UShort End; /* last glyph ID in the range */
- FT_UShort StartCoverageIndex; /* coverage index of first
+ HB_UShort Start; /* first glyph ID in the range */
+ HB_UShort End; /* last glyph ID in the range */
+ HB_UShort StartCoverageIndex; /* coverage index of first
glyph ID in the range */
};
struct HB_CoverageFormat2_
{
- FT_UShort RangeCount; /* number of RangeRecords */
+ HB_UShort RangeCount; /* number of RangeRecords */
HB_RangeRecord* RangeRecord; /* array of RangeRecords */
};
struct HB_Coverage_
{
- FT_UShort CoverageFormat; /* 1 or 2 */
+ HB_UShort CoverageFormat; /* 1 or 2 */
union
{
struct HB_ClassDefFormat1_
{
- FT_UShort StartGlyph; /* first glyph ID of the
+ HB_UShort StartGlyph; /* first glyph ID of the
ClassValueArray */
- FT_UShort GlyphCount; /* size of the ClassValueArray */
- FT_UShort* ClassValueArray; /* array of class values */
+ HB_UShort GlyphCount; /* size of the ClassValueArray */
+ HB_UShort* ClassValueArray; /* array of class values */
};
typedef struct HB_ClassDefFormat1_ HB_ClassDefFormat1;
struct HB_ClassRangeRecord_
{
- FT_UShort Start; /* first glyph ID in the range */
- FT_UShort End; /* last glyph ID in the range */
- FT_UShort Class; /* applied to all glyphs in range */
+ HB_UShort Start; /* first glyph ID in the range */
+ HB_UShort End; /* last glyph ID in the range */
+ HB_UShort Class; /* applied to all glyphs in range */
};
typedef struct HB_ClassRangeRecord_ HB_ClassRangeRecord;
struct HB_ClassDefFormat2_
{
- FT_UShort ClassRangeCount;
+ HB_UShort ClassRangeCount;
/* number of ClassRangeRecords */
HB_ClassRangeRecord* ClassRangeRecord;
/* array of ClassRangeRecords */
struct HB_ClassDefinition_
{
- FT_Bool loaded;
+ HB_Bool loaded;
- FT_Bool* Defined; /* array of Booleans.
+ HB_Bool* Defined; /* array of Booleans.
If Defined[n] is FALSE,
class n contains no glyphs. */
- FT_UShort ClassFormat; /* 1 or 2 */
+ HB_UShort ClassFormat; /* 1 or 2 */
union
{
struct HB_Device_
{
- FT_UShort StartSize; /* smallest size to correct */
- FT_UShort EndSize; /* largest size to correct */
- FT_UShort DeltaFormat; /* DeltaValue array data format:
+ HB_UShort StartSize; /* smallest size to correct */
+ HB_UShort EndSize; /* largest size to correct */
+ HB_UShort DeltaFormat; /* DeltaValue array data format:
1, 2, or 3 */
- FT_UShort* DeltaValue; /* array of compressed data */
+ HB_UShort* DeltaValue; /* array of compressed data */
};
typedef struct HB_Device_ HB_Device;
typedef enum HB_Type_ HB_Type;
-FT_END_HEADER
+HB_END_HEADER
#endif /* HARFBUZZ_OPEN_H */
#ifndef HARFBUZZ_H
#define HARFBUZZ_H
+#include "harfbuzz-global.h"
#include "harfbuzz-open.h"
#include "harfbuzz-buffer.h"
#include "harfbuzz-gdef.h"