hb-buffer.h revision 6c78683c042250a7b5a6fc6ebae4717b03fadf9e
1a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod/* 2a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * Copyright (C) 1998-2004 David Turner and Werner Lemberg 36c78683c042250a7b5a6fc6ebae4717b03fadf9eBehdad Esfahbod * Copyright (C) 2004,2007,2009 Red Hat, Inc. 49f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod * 5a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * This is part of HarfBuzz, an OpenType Layout engine library. 69f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod * 7a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * Permission is hereby granted, without written agreement and without 8a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * license or royalty fees, to use, copy, modify, and distribute this 9a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * software and its documentation for any purpose, provided that the 10a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * above copyright notice and the following two paragraphs appear in 11a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * all copies of this software. 129f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod * 13a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 14a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 15a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 16a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 17a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * DAMAGE. 18a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * 19a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 20a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 21a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 22a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 23a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 24a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * 25a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod * Red Hat Author(s): Owen Taylor, Behdad Esfahbod 269f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod */ 27a2a9a023f6472ba262f89e5327318996b8258d25Behdad Esfahbod 285c0adce1ccc739415c4b26ff13ffd2d77ea4bc6cBehdad Esfahbod#ifndef HB_BUFFER_H 295c0adce1ccc739415c4b26ff13ffd2d77ea4bc6cBehdad Esfahbod#define HB_BUFFER_H 309f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod 31b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod#include "hb-common.h" 329f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod 33f96ffd43bce0ac6d9c897933c9be0e51d543e570Behdad EsfahbodHB_BEGIN_DECLS 349f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod 359f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbodtypedef struct HB_GlyphItemRec_ { 36b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod hb_codepoint_t gindex; 37b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod unsigned int properties; 38b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod unsigned int cluster; 39b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod unsigned short component; 40b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod unsigned short ligID; 41b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod unsigned short gproperty; 429f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod} HB_GlyphItemRec, *HB_GlyphItem; 439f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod 449f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbodtypedef struct HB_PositionRec_ { 45b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod hb_position_t x_pos; 46b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod hb_position_t y_pos; 47b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod hb_position_t x_advance; 48b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod hb_position_t y_advance; 49b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod unsigned short back; /* number of glyphs to go back 50b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod for drawing current glyph */ 51b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod hb_bool_t new_advance; /* if set, the advance width values are 52b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod absolute, i.e., they won't be 53b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod added to the original glyph's value 54b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod but rather replace them. */ 55b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod short cursive_chain; /* character to which this connects, 56b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod may be positive or negative; used 57b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod only internally */ 589f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod} HB_PositionRec, *HB_Position; 599f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod 609f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod 61b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbodtypedef struct _hb_buffer_t { 62b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod unsigned int allocated; 639f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod 64b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod unsigned int in_length; 65b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod unsigned int out_length; 66b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod unsigned int in_pos; 67b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod unsigned int out_pos; 685c0adce1ccc739415c4b26ff13ffd2d77ea4bc6cBehdad Esfahbod 69b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod hb_bool_t separate_out; 709f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod HB_GlyphItem in_string; 719f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod HB_GlyphItem out_string; 72a8abb8b994c3cd89808e8f7128a0c04b23eb3edeBehdad Esfahbod HB_GlyphItem alt_string; 739f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod HB_Position positions; 74b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod unsigned int max_ligID; 75b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod} HB_BufferRec, *HB_Buffer, hb_buffer_t; 769f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod 77b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbodhb_buffer_t * 78b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbodhb_buffer_new (void); 799f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod 80a8abb8b994c3cd89808e8f7128a0c04b23eb3edeBehdad Esfahbodvoid 81b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbodhb_buffer_free (hb_buffer_t *buffer); 829f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod 83a8abb8b994c3cd89808e8f7128a0c04b23eb3edeBehdad Esfahbodvoid 84b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbodhb_buffer_clear (hb_buffer_t *buffer); 859f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod 86b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbodvoid 87b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbodhb_buffer_add_glyph (hb_buffer_t *buffer, 88b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod hb_codepoint_t glyph_index, 89b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod unsigned int properties, 90b857b49c82782d29d6d189f1a9f4a84d39cd84eaBehdad Esfahbod unsigned int cluster); 919f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod 92f96ffd43bce0ac6d9c897933c9be0e51d543e570Behdad EsfahbodHB_END_DECLS 939f8da38cd108590514b71756b752d98952a9221fBehdad Esfahbod 945c0adce1ccc739415c4b26ff13ffd2d77ea4bc6cBehdad Esfahbod#endif /* HB_BUFFER_H */ 95