2 * Copyright (C) 1998-2004 David Turner and Werner Lemberg
3 * Copyright (C) 2004,2007,2009 Red Hat, Inc.
5 * This is part of HarfBuzz, an OpenType Layout engine library.
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.
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
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.
25 * Red Hat Author(s): Owen Taylor, Behdad Esfahbod
31 #include "hb-common.h"
35 /* XXX Hide structs? */
37 typedef struct _hb_glyph_info_t {
38 hb_codepoint_t gindex;
39 unsigned int properties;
41 unsigned short component;
43 unsigned short gproperty;
46 typedef struct _hb_glyph_position_t {
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
60 } hb_glyph_position_t;
63 typedef struct _hb_buffer_t {
64 unsigned int allocated;
66 unsigned int in_length;
67 unsigned int out_length;
71 hb_bool_t separate_out;
72 hb_glyph_info_t *in_string;
73 hb_glyph_info_t *out_string;
74 hb_glyph_info_t *alt_string;
75 hb_glyph_position_t *positions;
76 unsigned int max_lig_id;
83 hb_buffer_free (hb_buffer_t *buffer);
86 hb_buffer_clear (hb_buffer_t *buffer);
89 hb_buffer_add_glyph (hb_buffer_t *buffer,
90 hb_codepoint_t glyph_index,
91 unsigned int properties,
92 unsigned int cluster);
96 #endif /* HB_BUFFER_H */