Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 1 | /* harfbuzz-buffer.h: Buffer of glyphs for substitution/positioning |
| 2 | * |
| 3 | * Copyrigh 2004 Red Hat Software |
| 4 | * |
| 5 | * Portions Copyright 1996-2000 by |
| 6 | * David Turner, Robert Wilhelm, and Werner Lemberg. |
| 7 | * |
| 8 | * This file is part of the FreeType project, and may only be used |
| 9 | * modified and distributed under the terms of the FreeType project |
| 10 | * license, LICENSE.TXT. By continuing to use, modify, or distribute |
| 11 | * this file you indicate that you have read the license and |
| 12 | * understand and accept it fully. |
| 13 | */ |
| 14 | #ifndef HARFBUZZ_BUFFER_H |
| 15 | #define HARFBUZZ_BUFFER_H |
| 16 | |
| 17 | #include <ft2build.h> |
| 18 | #include FT_FREETYPE_H |
| 19 | |
| 20 | FT_BEGIN_HEADER |
| 21 | |
| 22 | #define HB_GLYPH_PROPERTIES_UNKNOWN 0xFFFF |
| 23 | |
| 24 | typedef struct HB_GlyphItemRec_ { |
| 25 | FT_UInt gindex; |
| 26 | FT_UInt properties; |
| 27 | FT_UInt cluster; |
| 28 | FT_UShort component; |
| 29 | FT_UShort ligID; |
| 30 | FT_UShort gproperties; |
| 31 | } HB_GlyphItemRec, *HB_GlyphItem; |
| 32 | |
| 33 | typedef struct HB_PositionRec_ { |
| 34 | FT_Pos x_pos; |
| 35 | FT_Pos y_pos; |
| 36 | FT_Pos x_advance; |
| 37 | FT_Pos y_advance; |
| 38 | FT_UShort back; /* number of glyphs to go back |
| 39 | for drawing current glyph */ |
| 40 | FT_Bool new_advance; /* if set, the advance width values are |
| 41 | absolute, i.e., they won't be |
| 42 | added to the original glyph's value |
| 43 | but rather replace them. */ |
| 44 | FT_Short cursive_chain; /* character to which this connects, |
| 45 | may be positive or negative; used |
| 46 | only internally */ |
| 47 | } HB_PositionRec, *HB_Position; |
| 48 | |
| 49 | |
| 50 | typedef struct HB_BufferRec_{ |
| 51 | FT_Memory memory; |
| 52 | FT_ULong allocated; |
| 53 | |
| 54 | FT_ULong in_length; |
| 55 | FT_ULong out_length; |
| 56 | FT_ULong in_pos; |
| 57 | FT_ULong out_pos; |
| 58 | |
| 59 | HB_GlyphItem in_string; |
| 60 | HB_GlyphItem out_string; |
| 61 | HB_Position positions; |
| 62 | FT_UShort max_ligID; |
| 63 | } HB_BufferRec, *HB_Buffer; |
| 64 | |
| 65 | FT_Error |
| 66 | hb_buffer_new( FT_Memory memory, |
| 67 | HB_Buffer *buffer ); |
| 68 | |
| 69 | FT_Error |
| 70 | hb_buffer_swap( HB_Buffer buffer ); |
| 71 | |
| 72 | FT_Error |
| 73 | hb_buffer_free( HB_Buffer buffer ); |
| 74 | |
| 75 | FT_Error |
| 76 | hb_buffer_clear( HB_Buffer buffer ); |
| 77 | |
| 78 | FT_Error |
| 79 | hb_buffer_add_glyph( HB_Buffer buffer, |
| 80 | FT_UInt glyph_index, |
| 81 | FT_UInt properties, |
| 82 | FT_UInt cluster ); |
| 83 | |
| 84 | FT_Error |
| 85 | hb_buffer_add_output_glyphs( HB_Buffer buffer, |
| 86 | FT_UShort num_in, |
| 87 | FT_UShort num_out, |
| 88 | FT_UShort *glyph_data, |
| 89 | FT_UShort component, |
| 90 | FT_UShort ligID ); |
| 91 | |
| 92 | FT_Error |
| 93 | hb_buffer_add_output_glyph ( HB_Buffer buffer, |
| 94 | FT_UInt glyph_index, |
| 95 | FT_UShort component, |
| 96 | FT_UShort ligID ); |
| 97 | |
| 98 | FT_Error |
| 99 | hb_buffer_copy_output_glyph ( HB_Buffer buffer ); |
| 100 | |
| 101 | FT_UShort |
| 102 | hb_buffer_allocate_ligid( HB_Buffer buffer ); |
| 103 | |
| 104 | FT_END_HEADER |
| 105 | |
| 106 | #endif /* HARFBUZZ_BUFFER_H */ |