hb-ot-layout-private.hh revision eee8598d75d3af692d9ececf7e8ac458e892ba9e
1fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod/*
26c78683c042250a7b5a6fc6ebae4717b03fadf9eBehdad Esfahbod * Copyright (C) 2007,2008,2009  Red Hat, Inc.
3fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod *
4c755cb3e3ac55156d0d2ec05adea7a650b97cc41Behdad Esfahbod *  This is part of HarfBuzz, a text shaping library.
5fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod *
6fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * Permission is hereby granted, without written agreement and without
7fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * license or royalty fees, to use, copy, modify, and distribute this
8fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * software and its documentation for any purpose, provided that the
9fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * above copyright notice and the following two paragraphs appear in
10fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * all copies of this software.
11fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod *
12fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
16fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * DAMAGE.
17fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod *
18fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
21fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
23fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod *
24fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod * Red Hat Author(s): Behdad Esfahbod
25fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod */
26fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod
27fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod#ifndef HB_OT_LAYOUT_PRIVATE_H
28fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod#define HB_OT_LAYOUT_PRIVATE_H
29fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod
30fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod#include "hb-private.h"
312c80296aa5991ad67483889147f5c84fefe54af2Behdad Esfahbod
32fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod#include "hb-ot-layout.h"
332c80296aa5991ad67483889147f5c84fefe54af2Behdad Esfahbod
3423c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod#include "hb-font.h"
3522da7fd94d6318c52df69d70470a85464ffc533dBehdad Esfahbod#include "hb-buffer-private.hh"
36fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod
376f425b11799aa20dab553085f05744191b7318e2Behdad Esfahbod
3823c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad EsfahbodHB_BEGIN_DECLS
3923c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod
4030bd763fa2fa4aceee51433ec9fc8dc28480b5d7Behdad Esfahbodtypedef unsigned int hb_ot_layout_class_t;
41ead428d7a0bf4dc84340a99f3959e5cc58123e99Behdad Esfahbod
420ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod/*
430ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod * hb_ot_layout_t
440ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod */
450ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod
460ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbodtypedef struct _hb_ot_layout_t hb_ot_layout_t;
470ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod
4860d77cf05fddc5304b4b1fc19cdedba15cbee1e9Behdad Esfahbodstruct _hb_ot_layout_t
4960d77cf05fddc5304b4b1fc19cdedba15cbee1e9Behdad Esfahbod{
5070e0f2a75ec1559f2f70ada837ce4bc4baca49e3Behdad Esfahbod  hb_blob_t *gdef_blob;
5170e0f2a75ec1559f2f70ada837ce4bc4baca49e3Behdad Esfahbod  hb_blob_t *gsub_blob;
5270e0f2a75ec1559f2f70ada837ce4bc4baca49e3Behdad Esfahbod  hb_blob_t *gpos_blob;
5370e0f2a75ec1559f2f70ada837ce4bc4baca49e3Behdad Esfahbod
54c43562b2a7587fa3f9ef4c1c4338e4eda77368b5Behdad Esfahbod  const struct GDEF *gdef;
55c43562b2a7587fa3f9ef4c1c4338e4eda77368b5Behdad Esfahbod  const struct GSUB *gsub;
565e5eb0573f7ea2ce2cf037fef0df70a4351e82c0Behdad Esfahbod  const struct GPOS *gpos;
57c43562b2a7587fa3f9ef4c1c4338e4eda77368b5Behdad Esfahbod
5860d77cf05fddc5304b4b1fc19cdedba15cbee1e9Behdad Esfahbod  struct
5960d77cf05fddc5304b4b1fc19cdedba15cbee1e9Behdad Esfahbod  {
60c43562b2a7587fa3f9ef4c1c4338e4eda77368b5Behdad Esfahbod    unsigned char *klasses;
61c43562b2a7587fa3f9ef4c1c4338e4eda77368b5Behdad Esfahbod    unsigned int len;
62c43562b2a7587fa3f9ef4c1c4338e4eda77368b5Behdad Esfahbod  } new_gdef;
630ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod};
645e5eb0573f7ea2ce2cf037fef0df70a4351e82c0Behdad Esfahbod
650ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbodtypedef struct _hb_ot_layout_context_t hb_ot_layout_context_t;
660ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbodstruct _hb_ot_layout_context_t
670ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod{
6823c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod  hb_face_t *face;
690ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod  hb_font_t *font;
702ebb89d63dd27e800f2b6cbf624924601105f48aBehdad Esfahbod
710ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod  union info_t
720ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod  {
730ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod    struct gpos_t
740ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod    {
750ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod      unsigned int last;        /* the last valid glyph--used with cursive positioning */
760ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod      hb_position_t anchor_x;   /* the coordinates of the anchor point */
770ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod      hb_position_t anchor_y;   /* of the last valid glyph */
780ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod    } gpos;
790ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod  } info;
80c43562b2a7587fa3f9ef4c1c4338e4eda77368b5Behdad Esfahbod};
81c43562b2a7587fa3f9ef4c1c4338e4eda77368b5Behdad Esfahbod
82c43562b2a7587fa3f9ef4c1c4338e4eda77368b5Behdad Esfahbod
83eee8598d75d3af692d9ececf7e8ac458e892ba9eBehdad EsfahbodHB_INTERNAL void
8470e0f2a75ec1559f2f70ada837ce4bc4baca49e3Behdad Esfahbod_hb_ot_layout_init (hb_face_t *face);
8523c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod
86eee8598d75d3af692d9ececf7e8ac458e892ba9eBehdad EsfahbodHB_INTERNAL void
8770e0f2a75ec1559f2f70ada837ce4bc4baca49e3Behdad Esfahbod_hb_ot_layout_fini (hb_face_t *face);
8823c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod
89aff831ed6787abe8e24a977e34d97ff2e0b7dc21Behdad Esfahbod
9054e5aac5e2947d4e2864c6f2987e4d275da73100Behdad Esfahbod/*
9154e5aac5e2947d4e2864c6f2987e4d275da73100Behdad Esfahbod * GDEF
9254e5aac5e2947d4e2864c6f2987e4d275da73100Behdad Esfahbod */
9354e5aac5e2947d4e2864c6f2987e4d275da73100Behdad Esfahbod
94347f0b8621d3adfec157e5634ff3defc818ea37fBehdad EsfahbodHB_INTERNAL hb_bool_t
9523c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod_hb_ot_layout_has_new_glyph_classes (hb_face_t *face);
9630bd763fa2fa4aceee51433ec9fc8dc28480b5d7Behdad Esfahbod
97347f0b8621d3adfec157e5634ff3defc818ea37fBehdad EsfahbodHB_INTERNAL void
9823c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod_hb_ot_layout_set_glyph_property (hb_face_t      *face,
9930bd763fa2fa4aceee51433ec9fc8dc28480b5d7Behdad Esfahbod				  hb_codepoint_t  glyph,
10030bd763fa2fa4aceee51433ec9fc8dc28480b5d7Behdad Esfahbod				  unsigned int    property);
101590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod
1020ead481a5a8623103565fd7d924666e7342278ddBehdad EsfahbodHB_INTERNAL void
10323c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod_hb_ot_layout_set_glyph_class (hb_face_t                  *face,
1040ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod			       hb_codepoint_t              glyph,
1050ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod			       hb_ot_layout_glyph_class_t  klass);
1060ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod
107347f0b8621d3adfec157e5634ff3defc818ea37fBehdad EsfahbodHB_INTERNAL hb_bool_t
10823c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod_hb_ot_layout_check_glyph_property (hb_face_t    *face,
109f1322e52d557726baa010be8d35a594748e8fa1aBehdad Esfahbod				    hb_internal_glyph_info_t *ginfo,
11023c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod				    unsigned int  lookup_flags,
11123c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod				    unsigned int *property);
1125a0b791184cf6ef39eae0570e14aca21abc32845Behdad Esfahbod
1134189b92aaa41e4a1756c561cc6e08b0ed024afdaBehdad EsfahbodHB_INTERNAL hb_bool_t
11423c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod_hb_ot_layout_skip_mark (hb_face_t    *face,
11523c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod			 hb_internal_glyph_info_t *ginfo,
11623c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod			 unsigned int  lookup_flags,
11723c86aa0009324433e78fcd0c47f2c0ff14b1949Behdad Esfahbod			 unsigned int *property);
1184189b92aaa41e4a1756c561cc6e08b0ed024afdaBehdad Esfahbod
119f96ffd43bce0ac6d9c897933c9be0e51d543e570Behdad EsfahbodHB_END_DECLS
120fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod
121fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod#endif /* HB_OT_LAYOUT_PRIVATE_H */
122