xref: /aosp_15_r20/external/harfbuzz_ng/src/hb-shape-plan.h (revision 2d1272b857b1f7575e6e246373e1cb218663db8a)
1*2d1272b8SAndroid Build Coastguard Worker /*
2*2d1272b8SAndroid Build Coastguard Worker  * Copyright © 2012  Google, Inc.
3*2d1272b8SAndroid Build Coastguard Worker  *
4*2d1272b8SAndroid Build Coastguard Worker  *  This is part of HarfBuzz, a text shaping library.
5*2d1272b8SAndroid Build Coastguard Worker  *
6*2d1272b8SAndroid Build Coastguard Worker  * Permission is hereby granted, without written agreement and without
7*2d1272b8SAndroid Build Coastguard Worker  * license or royalty fees, to use, copy, modify, and distribute this
8*2d1272b8SAndroid Build Coastguard Worker  * software and its documentation for any purpose, provided that the
9*2d1272b8SAndroid Build Coastguard Worker  * above copyright notice and the following two paragraphs appear in
10*2d1272b8SAndroid Build Coastguard Worker  * all copies of this software.
11*2d1272b8SAndroid Build Coastguard Worker  *
12*2d1272b8SAndroid Build Coastguard Worker  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13*2d1272b8SAndroid Build Coastguard Worker  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14*2d1272b8SAndroid Build Coastguard Worker  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15*2d1272b8SAndroid Build Coastguard Worker  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
16*2d1272b8SAndroid Build Coastguard Worker  * DAMAGE.
17*2d1272b8SAndroid Build Coastguard Worker  *
18*2d1272b8SAndroid Build Coastguard Worker  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19*2d1272b8SAndroid Build Coastguard Worker  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20*2d1272b8SAndroid Build Coastguard Worker  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
21*2d1272b8SAndroid Build Coastguard Worker  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22*2d1272b8SAndroid Build Coastguard Worker  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
23*2d1272b8SAndroid Build Coastguard Worker  *
24*2d1272b8SAndroid Build Coastguard Worker  * Google Author(s): Behdad Esfahbod
25*2d1272b8SAndroid Build Coastguard Worker  */
26*2d1272b8SAndroid Build Coastguard Worker 
27*2d1272b8SAndroid Build Coastguard Worker #if !defined(HB_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)
28*2d1272b8SAndroid Build Coastguard Worker #error "Include <hb.h> instead."
29*2d1272b8SAndroid Build Coastguard Worker #endif
30*2d1272b8SAndroid Build Coastguard Worker 
31*2d1272b8SAndroid Build Coastguard Worker #ifndef HB_SHAPE_PLAN_H
32*2d1272b8SAndroid Build Coastguard Worker #define HB_SHAPE_PLAN_H
33*2d1272b8SAndroid Build Coastguard Worker 
34*2d1272b8SAndroid Build Coastguard Worker #include "hb-common.h"
35*2d1272b8SAndroid Build Coastguard Worker #include "hb-font.h"
36*2d1272b8SAndroid Build Coastguard Worker 
37*2d1272b8SAndroid Build Coastguard Worker HB_BEGIN_DECLS
38*2d1272b8SAndroid Build Coastguard Worker 
39*2d1272b8SAndroid Build Coastguard Worker /**
40*2d1272b8SAndroid Build Coastguard Worker  * hb_shape_plan_t:
41*2d1272b8SAndroid Build Coastguard Worker  *
42*2d1272b8SAndroid Build Coastguard Worker  * Data type for holding a shaping plan.
43*2d1272b8SAndroid Build Coastguard Worker  *
44*2d1272b8SAndroid Build Coastguard Worker  * Shape plans contain information about how HarfBuzz will shape a
45*2d1272b8SAndroid Build Coastguard Worker  * particular text segment, based on the segment's properties and the
46*2d1272b8SAndroid Build Coastguard Worker  * capabilities in the font face in use.
47*2d1272b8SAndroid Build Coastguard Worker  *
48*2d1272b8SAndroid Build Coastguard Worker  * Shape plans can be queried about how shaping will perform, given a set
49*2d1272b8SAndroid Build Coastguard Worker  * of specific input parameters (script, language, direction, features,
50*2d1272b8SAndroid Build Coastguard Worker  * etc.).
51*2d1272b8SAndroid Build Coastguard Worker  *
52*2d1272b8SAndroid Build Coastguard Worker  **/
53*2d1272b8SAndroid Build Coastguard Worker typedef struct hb_shape_plan_t hb_shape_plan_t;
54*2d1272b8SAndroid Build Coastguard Worker 
55*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_shape_plan_t *
56*2d1272b8SAndroid Build Coastguard Worker hb_shape_plan_create (hb_face_t                     *face,
57*2d1272b8SAndroid Build Coastguard Worker 		      const hb_segment_properties_t *props,
58*2d1272b8SAndroid Build Coastguard Worker 		      const hb_feature_t            *user_features,
59*2d1272b8SAndroid Build Coastguard Worker 		      unsigned int                   num_user_features,
60*2d1272b8SAndroid Build Coastguard Worker 		      const char * const            *shaper_list);
61*2d1272b8SAndroid Build Coastguard Worker 
62*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_shape_plan_t *
63*2d1272b8SAndroid Build Coastguard Worker hb_shape_plan_create_cached (hb_face_t                     *face,
64*2d1272b8SAndroid Build Coastguard Worker 			     const hb_segment_properties_t *props,
65*2d1272b8SAndroid Build Coastguard Worker 			     const hb_feature_t            *user_features,
66*2d1272b8SAndroid Build Coastguard Worker 			     unsigned int                   num_user_features,
67*2d1272b8SAndroid Build Coastguard Worker 			     const char * const            *shaper_list);
68*2d1272b8SAndroid Build Coastguard Worker 
69*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_shape_plan_t *
70*2d1272b8SAndroid Build Coastguard Worker hb_shape_plan_create2 (hb_face_t                     *face,
71*2d1272b8SAndroid Build Coastguard Worker 		       const hb_segment_properties_t *props,
72*2d1272b8SAndroid Build Coastguard Worker 		       const hb_feature_t            *user_features,
73*2d1272b8SAndroid Build Coastguard Worker 		       unsigned int                   num_user_features,
74*2d1272b8SAndroid Build Coastguard Worker 		       const int                     *coords,
75*2d1272b8SAndroid Build Coastguard Worker 		       unsigned int                   num_coords,
76*2d1272b8SAndroid Build Coastguard Worker 		       const char * const            *shaper_list);
77*2d1272b8SAndroid Build Coastguard Worker 
78*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_shape_plan_t *
79*2d1272b8SAndroid Build Coastguard Worker hb_shape_plan_create_cached2 (hb_face_t                     *face,
80*2d1272b8SAndroid Build Coastguard Worker 			      const hb_segment_properties_t *props,
81*2d1272b8SAndroid Build Coastguard Worker 			      const hb_feature_t            *user_features,
82*2d1272b8SAndroid Build Coastguard Worker 			      unsigned int                   num_user_features,
83*2d1272b8SAndroid Build Coastguard Worker 			      const int                     *coords,
84*2d1272b8SAndroid Build Coastguard Worker 			      unsigned int                   num_coords,
85*2d1272b8SAndroid Build Coastguard Worker 			      const char * const            *shaper_list);
86*2d1272b8SAndroid Build Coastguard Worker 
87*2d1272b8SAndroid Build Coastguard Worker 
88*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_shape_plan_t *
89*2d1272b8SAndroid Build Coastguard Worker hb_shape_plan_get_empty (void);
90*2d1272b8SAndroid Build Coastguard Worker 
91*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_shape_plan_t *
92*2d1272b8SAndroid Build Coastguard Worker hb_shape_plan_reference (hb_shape_plan_t *shape_plan);
93*2d1272b8SAndroid Build Coastguard Worker 
94*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void
95*2d1272b8SAndroid Build Coastguard Worker hb_shape_plan_destroy (hb_shape_plan_t *shape_plan);
96*2d1272b8SAndroid Build Coastguard Worker 
97*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_bool_t
98*2d1272b8SAndroid Build Coastguard Worker hb_shape_plan_set_user_data (hb_shape_plan_t    *shape_plan,
99*2d1272b8SAndroid Build Coastguard Worker 			     hb_user_data_key_t *key,
100*2d1272b8SAndroid Build Coastguard Worker 			     void *              data,
101*2d1272b8SAndroid Build Coastguard Worker 			     hb_destroy_func_t   destroy,
102*2d1272b8SAndroid Build Coastguard Worker 			     hb_bool_t           replace);
103*2d1272b8SAndroid Build Coastguard Worker 
104*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN void *
105*2d1272b8SAndroid Build Coastguard Worker hb_shape_plan_get_user_data (const hb_shape_plan_t *shape_plan,
106*2d1272b8SAndroid Build Coastguard Worker 			     hb_user_data_key_t    *key);
107*2d1272b8SAndroid Build Coastguard Worker 
108*2d1272b8SAndroid Build Coastguard Worker 
109*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN hb_bool_t
110*2d1272b8SAndroid Build Coastguard Worker hb_shape_plan_execute (hb_shape_plan_t    *shape_plan,
111*2d1272b8SAndroid Build Coastguard Worker 		       hb_font_t          *font,
112*2d1272b8SAndroid Build Coastguard Worker 		       hb_buffer_t        *buffer,
113*2d1272b8SAndroid Build Coastguard Worker 		       const hb_feature_t *features,
114*2d1272b8SAndroid Build Coastguard Worker 		       unsigned int        num_features);
115*2d1272b8SAndroid Build Coastguard Worker 
116*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN const char *
117*2d1272b8SAndroid Build Coastguard Worker hb_shape_plan_get_shaper (hb_shape_plan_t *shape_plan);
118*2d1272b8SAndroid Build Coastguard Worker 
119*2d1272b8SAndroid Build Coastguard Worker 
120*2d1272b8SAndroid Build Coastguard Worker HB_END_DECLS
121*2d1272b8SAndroid Build Coastguard Worker 
122*2d1272b8SAndroid Build Coastguard Worker #endif /* HB_SHAPE_PLAN_H */
123