Hash :
e57ca7de
Author :
Date :
2002-11-07T01:36:29
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
#ifndef __OTL_PARSER_H__
#define __OTL_PARSER_H__
#include "otlayout.h"
#include "otlgdef.h"
#include "otlgsub.h"
#include "otlgpos.h"
OTL_BEGIN_HEADER
typedef struct OTL_ParserRec_* OTL_Parser;
typedef struct OTL_StringRec_* OTL_String;
typedef struct OTL_StringGlyphRec_
{
OTL_UInt gindex;
OTL_UInt properties;
OTL_UInt lig_component;
OTL_UInt lig_id;
} OTL_StringGlyphRec, *OTL_StringGlyph;
typedef struct OTL_StringRec_
{
OTL_StringGlyph glyphs;
OTL_UInt cursor;
OTL_UInt length;
OTL_UInt capacity;
} OTL_StringRec;
typedef struct OTL_ParserRec_
{
OTL_Bytes tab_gdef;
OTL_Bytes tab_gsub;
OTL_Bytes tab_gpos;
OTL_Bytes tab_base;
OTL_Bytes tab_jstf;
OTL_Alternate alternate; /* external alternate handler */
OTL_UInt context_len;
OTL_UInt markup_flags;
OTL_jmp_buf jump_buffer;
OTL_Memory memory;
OTL_Error error;
OTL_StringRec strings[2];
OTL_String str_in;
OTL_String str_out;
} OTL_ParserRec;
typedef enum
{
OTL_Err_Parser_Ok = 0,
OTL_Err_Parser_InvalidData,
OTL_Err_Parser_UncoveredGlyph
} OTL_ParseError;
OTL_LOCAL( OTL_UInt )
otl_parser_get_gindex( OTL_Parser parser );
OTL_LOCAL( void )
otl_parser_error( OTL_Parser parser, OTL_ParserError error );
#define OTL_PARSER_UNCOVERED(x) \
otl_parser_error( x, OTL_Err_Parser_UncoveredGlyph )
OTL_LOCAL( void )
otl_parser_check_property( OTL_Parser parser,
OTL_UInt gindex,
OTL_UInt flags,
OTL_UInt *aproperty );
/* copy current input glyph to output */
OTL_LOCAL( void )
otl_parser_copy_1( OTL_Parser parser );
/* copy current input glyph to output, replacing its index */
OTL_LOCAL( void )
otl_parser_replace_1( OTL_Parser parser,
OTL_UInt gindex );
/* copy current input glyph to output, replacing it by several indices */
/* read directly from the table */
OTL_LOCAL( void )
otl_parser_replace_n( OTL_Parser parser,
OTL_UInt count,
OTL_Bytes indices );
OTL_END_HEADER
#endif /* __OTL_PARSER_H__ */