2006-03-31 14:28:09 +02:00
|
|
|
/*******************************************************************
|
|
|
|
*
|
|
|
|
* Copyright 1996-2000 by
|
|
|
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
|
|
|
*
|
|
|
|
* Copyright 2006 Behdad Esfahbod
|
|
|
|
*
|
|
|
|
* This is part of HarfBuzz, an OpenType Layout engine library.
|
|
|
|
*
|
|
|
|
* See the file name COPYING for licensing information.
|
|
|
|
*
|
|
|
|
******************************************************************/
|
|
|
|
#ifndef HARFBUZZ_GDEF_H
|
|
|
|
#define HARFBUZZ_GDEF_H
|
|
|
|
|
|
|
|
#include "harfbuzz-open.h"
|
|
|
|
|
2007-10-25 00:44:47 +02:00
|
|
|
HB_BEGIN_HEADER
|
2006-03-31 14:28:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* GDEF glyph properties. Note that HB_GDEF_COMPONENT has no corresponding
|
|
|
|
* flag in the LookupFlag field. */
|
|
|
|
#define HB_GDEF_BASE_GLYPH 0x0002
|
|
|
|
#define HB_GDEF_LIGATURE 0x0004
|
|
|
|
#define HB_GDEF_MARK 0x0008
|
|
|
|
#define HB_GDEF_COMPONENT 0x0010
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct HB_AttachPoint_ HB_AttachPoint;
|
|
|
|
|
|
|
|
|
|
|
|
struct HB_AttachList_
|
|
|
|
{
|
2007-10-25 00:44:47 +02:00
|
|
|
HB_Bool loaded;
|
2006-03-31 14:28:09 +02:00
|
|
|
|
|
|
|
HB_Coverage Coverage; /* Coverage table */
|
2007-10-25 00:44:47 +02:00
|
|
|
HB_UShort GlyphCount; /* number of glyphs with
|
2006-03-31 14:28:09 +02:00
|
|
|
attachments */
|
|
|
|
HB_AttachPoint* AttachPoint; /* array of AttachPoint tables */
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct HB_AttachList_ HB_AttachList;
|
|
|
|
|
|
|
|
typedef struct HB_LigGlyph_ HB_LigGlyph;
|
|
|
|
|
|
|
|
struct HB_LigCaretList_
|
|
|
|
{
|
2007-10-25 00:44:47 +02:00
|
|
|
HB_Bool loaded;
|
2006-03-31 14:28:09 +02:00
|
|
|
|
|
|
|
HB_Coverage Coverage; /* Coverage table */
|
2007-10-25 00:44:47 +02:00
|
|
|
HB_UShort LigGlyphCount; /* number of ligature glyphs */
|
2006-03-31 14:28:09 +02:00
|
|
|
HB_LigGlyph* LigGlyph; /* array of LigGlyph tables */
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct HB_LigCaretList_ HB_LigCaretList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* The `NewGlyphClasses' field is not defined in the TTO specification.
|
|
|
|
We use it for fonts with a constructed `GlyphClassDef' structure
|
|
|
|
(i.e., which don't have a GDEF table) to collect glyph classes
|
|
|
|
assigned during the lookup process. The number of arrays in this
|
|
|
|
pointer array is GlyphClassDef->cd.cd2.ClassRangeCount+1; the nth
|
|
|
|
array then contains the glyph class values of the glyphs not covered
|
|
|
|
by the ClassRangeRecords structures with index n-1 and n. We store
|
|
|
|
glyph class values for four glyphs in a single array element.
|
|
|
|
|
|
|
|
`LastGlyph' is identical to the number of glyphs minus one in the
|
|
|
|
font; we need it only if `NewGlyphClasses' is not NULL (to have an
|
|
|
|
upper bound for the last array).
|
|
|
|
|
|
|
|
Note that we first store the file offset to the `MarkAttachClassDef'
|
|
|
|
field (which has been introduced in OpenType 1.2) -- since the
|
|
|
|
`Version' field value hasn't been increased to indicate that we have
|
|
|
|
one more field for some obscure reason, we must parse the GSUB table
|
|
|
|
to find out whether class values refer to this table. Only then we
|
|
|
|
can finally load the MarkAttachClassDef structure if necessary. */
|
|
|
|
|
|
|
|
struct HB_GDEFHeader_
|
|
|
|
{
|
2007-10-25 00:44:47 +02:00
|
|
|
HB_UInt offset;
|
2006-03-31 14:28:09 +02:00
|
|
|
|
2007-11-07 10:59:18 +01:00
|
|
|
HB_16Dot16 Version;
|
2006-03-31 14:28:09 +02:00
|
|
|
|
|
|
|
HB_ClassDefinition GlyphClassDef;
|
|
|
|
HB_AttachList AttachList;
|
|
|
|
HB_LigCaretList LigCaretList;
|
2007-10-25 00:44:47 +02:00
|
|
|
HB_UInt MarkAttachClassDef_offset;
|
2006-03-31 14:28:09 +02:00
|
|
|
HB_ClassDefinition MarkAttachClassDef; /* new in OT 1.2 */
|
|
|
|
|
2007-10-25 00:44:47 +02:00
|
|
|
HB_UShort LastGlyph;
|
|
|
|
HB_UShort** NewGlyphClasses;
|
2006-03-31 14:28:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct HB_GDEFHeader_ HB_GDEFHeader;
|
|
|
|
typedef struct HB_GDEFHeader_* HB_GDEF;
|
|
|
|
|
|
|
|
|
2007-10-11 08:52:07 +02:00
|
|
|
HB_Error HB_New_GDEF_Table( HB_GDEFHeader** retptr );
|
2006-03-31 14:28:09 +02:00
|
|
|
|
|
|
|
|
2007-11-07 10:59:18 +01:00
|
|
|
HB_Error HB_Load_GDEF_Table( HB_Font font,
|
2006-03-31 14:28:09 +02:00
|
|
|
HB_GDEFHeader** gdef );
|
|
|
|
|
|
|
|
|
2007-10-11 02:07:58 +02:00
|
|
|
HB_Error HB_Done_GDEF_Table ( HB_GDEFHeader* gdef );
|
2006-03-31 14:28:09 +02:00
|
|
|
|
|
|
|
|
2007-10-11 02:07:58 +02:00
|
|
|
HB_Error HB_GDEF_Get_Glyph_Property( HB_GDEFHeader* gdef,
|
2007-10-25 00:44:47 +02:00
|
|
|
HB_UShort glyphID,
|
|
|
|
HB_UShort* property );
|
2006-03-31 14:28:09 +02:00
|
|
|
|
2007-10-11 02:07:58 +02:00
|
|
|
HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef,
|
2007-10-25 00:44:47 +02:00
|
|
|
HB_UShort num_glyphs,
|
|
|
|
HB_UShort glyph_count,
|
|
|
|
HB_UShort* glyph_array,
|
|
|
|
HB_UShort* class_array );
|
2006-03-31 14:28:09 +02:00
|
|
|
|
|
|
|
|
2007-10-25 00:44:47 +02:00
|
|
|
HB_END_HEADER
|
2006-03-31 14:28:09 +02:00
|
|
|
|
|
|
|
#endif /* HARFBUZZ_GDEF_H */
|