11512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod/*
21512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * Copyright (C) 1998-2004  David Turner and Werner Lemberg
31512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * Copyright (C) 2004,2007  Red Hat, Inc.
41512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod *
51512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * This is part of HarfBuzz, an OpenType Layout engine library.
61512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod *
71512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * Permission is hereby granted, without written agreement and without
81512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * license or royalty fees, to use, copy, modify, and distribute this
91512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * software and its documentation for any purpose, provided that the
101512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * above copyright notice and the following two paragraphs appear in
111512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * all copies of this software.
121512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod *
131512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
141512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
151512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
161512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
171512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * DAMAGE.
181512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod *
191512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
201512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
211512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
221512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
231512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
241512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod *
251512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod * Red Hat Author(s): Owen Taylor, Behdad Esfahbod
261512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod */
271512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
281512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod#ifndef HARFBUZZ_BUFFER_H
291512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod#define HARFBUZZ_BUFFER_H
301512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
311512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod#include "harfbuzz-global.h"
321512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
331512a7357513b72e2a07dda706a176bb23d694e9Behdad EsfahbodHB_BEGIN_HEADER
341512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
351512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod#ifdef HB_USE_PACKED_STRUCTS
361512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod#pragma pack(push, 1)
371512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod#endif
381512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
391512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbodtypedef struct HB_GlyphItemRec_ {
401512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_UInt     gindex;
411512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_UInt     properties;
421512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_UInt     cluster;
431512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_UShort   component;
441512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_UShort   ligID;
451512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_UShort   gproperties;
461512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod} HB_GlyphItemRec, *HB_GlyphItem;
471512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
481512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbodtypedef struct HB_PositionRec_ {
491512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_Fixed   x_pos;
501512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_Fixed   y_pos;
511512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_Fixed   x_advance;
521512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_Fixed   y_advance;
531512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_UShort  back;            /* number of glyphs to go back
541512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod				 for drawing current glyph   */
551512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_Short  cursive_chain;   /* character to which this connects,
561512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod				 may be positive or negative; used
571512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod				 only internally                     */
581512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_Bool    new_advance;     /* if set, the advance width values are
591512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod				 absolute, i.e., they won't be
601512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod				 added to the original glyph's value
611512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod				 but rather replace them.            */
621512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod} HB_PositionRec, *HB_Position;
631512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
641512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
651512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbodtypedef struct HB_BufferRec_{
661512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_UInt    allocated;
671512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
681512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_UInt    in_length;
691512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_UInt    out_length;
701512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_UInt    in_pos;
711512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_UInt    out_pos;
721512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
731512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_GlyphItem  in_string;
741512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_GlyphItem  out_string;
751512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_GlyphItem  alt_string;
761512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_Position   positions;
771512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_UShort      max_ligID;
781512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod  HB_Bool       separate_out;
791512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod} HB_BufferRec, *HB_Buffer;
801512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
811512a7357513b72e2a07dda706a176bb23d694e9Behdad EsfahbodHB_Error
82fb47209c5b3aa992faf18d1a3f78b9d7682cf62fBehdad EsfahbodHB_Buffer_new( HB_Buffer *buffer );
831512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
841512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbodvoid
85fb47209c5b3aa992faf18d1a3f78b9d7682cf62fBehdad EsfahbodHB_Buffer_free( HB_Buffer buffer );
861512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
871512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbodvoid
88fb47209c5b3aa992faf18d1a3f78b9d7682cf62fBehdad EsfahbodHB_Buffer_clear( HB_Buffer buffer );
891512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
901512a7357513b72e2a07dda706a176bb23d694e9Behdad EsfahbodHB_Error
91fb47209c5b3aa992faf18d1a3f78b9d7682cf62fBehdad EsfahbodHB_Buffer_add_glyph( HB_Buffer buffer,
921512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod		      HB_UInt    glyph_index,
931512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod		      HB_UInt    properties,
941512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod		      HB_UInt    cluster );
951512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
961512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod#ifdef HB_USE_PACKED_STRUCTS
971512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod#pragma pack(pop)
981512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod#endif
991512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
1001512a7357513b72e2a07dda706a176bb23d694e9Behdad EsfahbodHB_END_HEADER
1011512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod
1021512a7357513b72e2a07dda706a176bb23d694e9Behdad Esfahbod#endif /* HARFBUZZ_BUFFER_H */
103