Behdad Esfahbod | a2a9a02 | 2008-01-15 22:46:32 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 1998-2004 David Turner and Werner Lemberg |
Behdad Esfahbod | 6c78683 | 2009-05-25 03:22:19 -0400 | [diff] [blame] | 3 | * Copyright (C) 2004,2007,2009 Red Hat, Inc. |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 4 | * |
Behdad Esfahbod | a2a9a02 | 2008-01-15 22:46:32 +0000 | [diff] [blame] | 5 | * This is part of HarfBuzz, an OpenType Layout engine library. |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 6 | * |
Behdad Esfahbod | a2a9a02 | 2008-01-15 22:46:32 +0000 | [diff] [blame] | 7 | * Permission is hereby granted, without written agreement and without |
| 8 | * license or royalty fees, to use, copy, modify, and distribute this |
| 9 | * software and its documentation for any purpose, provided that the |
| 10 | * above copyright notice and the following two paragraphs appear in |
| 11 | * all copies of this software. |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 12 | * |
Behdad Esfahbod | a2a9a02 | 2008-01-15 22:46:32 +0000 | [diff] [blame] | 13 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
| 14 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
| 15 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN |
| 16 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
| 17 | * DAMAGE. |
| 18 | * |
| 19 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
| 20 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 21 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
| 22 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
| 23 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 24 | * |
| 25 | * Red Hat Author(s): Owen Taylor, Behdad Esfahbod |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 26 | */ |
Behdad Esfahbod | a2a9a02 | 2008-01-15 22:46:32 +0000 | [diff] [blame] | 27 | |
Behdad Esfahbod | 5c0adce | 2009-05-20 05:42:12 -0400 | [diff] [blame] | 28 | #ifndef HB_BUFFER_H |
| 29 | #define HB_BUFFER_H |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 30 | |
Behdad Esfahbod | b857b49 | 2009-05-20 05:35:14 -0400 | [diff] [blame] | 31 | #include "hb-common.h" |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 32 | |
Behdad Esfahbod | f96ffd4 | 2009-05-24 15:01:16 -0400 | [diff] [blame] | 33 | HB_BEGIN_DECLS |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 34 | |
Behdad Esfahbod | d9d2a07 | 2009-05-25 03:24:19 -0400 | [diff] [blame] | 35 | /* XXX Hide structs? */ |
| 36 | |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 37 | typedef struct HB_GlyphItemRec_ { |
Behdad Esfahbod | b857b49 | 2009-05-20 05:35:14 -0400 | [diff] [blame] | 38 | hb_codepoint_t gindex; |
| 39 | unsigned int properties; |
| 40 | unsigned int cluster; |
| 41 | unsigned short component; |
| 42 | unsigned short ligID; |
| 43 | unsigned short gproperty; |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 44 | } HB_GlyphItemRec, *HB_GlyphItem; |
| 45 | |
| 46 | typedef struct HB_PositionRec_ { |
Behdad Esfahbod | b857b49 | 2009-05-20 05:35:14 -0400 | [diff] [blame] | 47 | hb_position_t x_pos; |
| 48 | hb_position_t y_pos; |
| 49 | hb_position_t x_advance; |
| 50 | hb_position_t y_advance; |
| 51 | unsigned short back; /* number of glyphs to go back |
| 52 | for drawing current glyph */ |
| 53 | hb_bool_t new_advance; /* if set, the advance width values are |
| 54 | absolute, i.e., they won't be |
| 55 | added to the original glyph's value |
| 56 | but rather replace them. */ |
| 57 | short cursive_chain; /* character to which this connects, |
| 58 | may be positive or negative; used |
| 59 | only internally */ |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 60 | } HB_PositionRec, *HB_Position; |
| 61 | |
| 62 | |
Behdad Esfahbod | b857b49 | 2009-05-20 05:35:14 -0400 | [diff] [blame] | 63 | typedef struct _hb_buffer_t { |
| 64 | unsigned int allocated; |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 65 | |
Behdad Esfahbod | b857b49 | 2009-05-20 05:35:14 -0400 | [diff] [blame] | 66 | unsigned int in_length; |
| 67 | unsigned int out_length; |
| 68 | unsigned int in_pos; |
| 69 | unsigned int out_pos; |
Behdad Esfahbod | 5c0adce | 2009-05-20 05:42:12 -0400 | [diff] [blame] | 70 | |
Behdad Esfahbod | b857b49 | 2009-05-20 05:35:14 -0400 | [diff] [blame] | 71 | hb_bool_t separate_out; |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 72 | HB_GlyphItem in_string; |
| 73 | HB_GlyphItem out_string; |
Behdad Esfahbod | a8abb8b | 2007-10-11 00:07:58 +0000 | [diff] [blame] | 74 | HB_GlyphItem alt_string; |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 75 | HB_Position positions; |
Behdad Esfahbod | b857b49 | 2009-05-20 05:35:14 -0400 | [diff] [blame] | 76 | unsigned int max_ligID; |
| 77 | } HB_BufferRec, *HB_Buffer, hb_buffer_t; |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 78 | |
Behdad Esfahbod | b857b49 | 2009-05-20 05:35:14 -0400 | [diff] [blame] | 79 | hb_buffer_t * |
| 80 | hb_buffer_new (void); |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 81 | |
Behdad Esfahbod | a8abb8b | 2007-10-11 00:07:58 +0000 | [diff] [blame] | 82 | void |
Behdad Esfahbod | b857b49 | 2009-05-20 05:35:14 -0400 | [diff] [blame] | 83 | hb_buffer_free (hb_buffer_t *buffer); |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 84 | |
Behdad Esfahbod | a8abb8b | 2007-10-11 00:07:58 +0000 | [diff] [blame] | 85 | void |
Behdad Esfahbod | b857b49 | 2009-05-20 05:35:14 -0400 | [diff] [blame] | 86 | hb_buffer_clear (hb_buffer_t *buffer); |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 87 | |
Behdad Esfahbod | b857b49 | 2009-05-20 05:35:14 -0400 | [diff] [blame] | 88 | void |
| 89 | hb_buffer_add_glyph (hb_buffer_t *buffer, |
| 90 | hb_codepoint_t glyph_index, |
| 91 | unsigned int properties, |
| 92 | unsigned int cluster); |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 93 | |
Behdad Esfahbod | f96ffd4 | 2009-05-24 15:01:16 -0400 | [diff] [blame] | 94 | HB_END_DECLS |
Behdad Esfahbod | 9f8da38 | 2006-03-31 12:28:09 +0000 | [diff] [blame] | 95 | |
Behdad Esfahbod | 5c0adce | 2009-05-20 05:42:12 -0400 | [diff] [blame] | 96 | #endif /* HB_BUFFER_H */ |