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, a text shaping 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"
32 #include "hb-unicode.h"
33 #include "hb-language.h"
37 typedef struct _hb_buffer_t hb_buffer_t;
39 typedef struct _hb_glyph_info_t {
40 hb_codepoint_t codepoint;
47 typedef struct _hb_glyph_position_t {
48 hb_position_t x_advance;
49 hb_position_t y_advance;
50 hb_position_t x_offset;
51 hb_position_t y_offset;
53 } hb_glyph_position_t;
57 hb_buffer_create (unsigned int pre_alloc_size);
60 hb_buffer_reference (hb_buffer_t *buffer);
63 hb_buffer_get_reference_count (hb_buffer_t *buffer);
66 hb_buffer_destroy (hb_buffer_t *buffer);
70 hb_buffer_set_unicode_funcs (hb_buffer_t *buffer,
71 hb_unicode_funcs_t *unicode_funcs);
74 hb_buffer_get_unicode_funcs (hb_buffer_t *buffer);
77 hb_buffer_set_direction (hb_buffer_t *buffer,
78 hb_direction_t direction);
81 hb_buffer_get_direction (hb_buffer_t *buffer);
84 hb_buffer_set_script (hb_buffer_t *buffer,
88 hb_buffer_get_script (hb_buffer_t *buffer);
91 hb_buffer_set_language (hb_buffer_t *buffer,
92 hb_language_t language);
95 hb_buffer_get_language (hb_buffer_t *buffer);
99 hb_buffer_clear (hb_buffer_t *buffer);
102 hb_buffer_clear_positions (hb_buffer_t *buffer);
105 hb_buffer_ensure (hb_buffer_t *buffer,
109 hb_buffer_reverse (hb_buffer_t *buffer);
112 hb_buffer_reverse_clusters (hb_buffer_t *buffer);
115 /* Filling the buffer in */
118 hb_buffer_add_glyph (hb_buffer_t *buffer,
119 hb_codepoint_t codepoint,
121 unsigned int cluster);
124 hb_buffer_add_utf8 (hb_buffer_t *buffer,
126 unsigned int text_length,
127 unsigned int item_offset,
128 unsigned int item_length);
131 hb_buffer_add_utf16 (hb_buffer_t *buffer,
132 const uint16_t *text,
133 unsigned int text_length,
134 unsigned int item_offset,
135 unsigned int item_length);
138 hb_buffer_add_utf32 (hb_buffer_t *buffer,
139 const uint32_t *text,
140 unsigned int text_length,
141 unsigned int item_offset,
142 unsigned int item_length);
145 /* Getting glyphs out of the buffer */
147 /* Return value valid as long as buffer not modified */
149 hb_buffer_get_length (hb_buffer_t *buffer);
151 /* Return value valid as long as buffer not modified */
153 hb_buffer_get_glyph_infos (hb_buffer_t *buffer);
155 /* Return value valid as long as buffer not modified */
156 hb_glyph_position_t *
157 hb_buffer_get_glyph_positions (hb_buffer_t *buffer);
162 #endif /* HB_BUFFER_H */