2 * Copyright © 2019-2020 Ebrahim Byagowi
4 * This is part of HarfBuzz, a text shaping library.
6 * Permission is hereby granted, without written agreement and without
7 * license or royalty fees, to use, copy, modify, and distribute this
8 * software and its documentation for any purpose, provided that the
9 * above copyright notice and the following two paragraphs appear in
10 * all copies of this software.
12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25 #if !defined(HB_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)
26 #error "Include <hb.h> instead."
36 #ifdef HB_EXPERIMENTAL_API
37 typedef void (*hb_draw_move_to_func_t) (hb_position_t to_x, hb_position_t to_y, void *user_data);
38 typedef void (*hb_draw_line_to_func_t) (hb_position_t to_x, hb_position_t to_y, void *user_data);
39 typedef void (*hb_draw_quadratic_to_func_t) (hb_position_t control_x, hb_position_t control_y,
40 hb_position_t to_x, hb_position_t to_y,
42 typedef void (*hb_draw_cubic_to_func_t) (hb_position_t control1_x, hb_position_t control1_y,
43 hb_position_t control2_x, hb_position_t control2_y,
44 hb_position_t to_x, hb_position_t to_y,
46 typedef void (*hb_draw_close_path_func_t) (void *user_data);
51 * Glyph draw callbacks.
53 * _move_to, _line_to and _cubic_to calls are necessary to be defined but we
54 * translate _quadratic_to calls to _cubic_to if the callback isn't defined.
58 typedef struct hb_draw_funcs_t hb_draw_funcs_t;
61 hb_draw_funcs_set_move_to_func (hb_draw_funcs_t *funcs,
62 hb_draw_move_to_func_t move_to);
65 hb_draw_funcs_set_line_to_func (hb_draw_funcs_t *funcs,
66 hb_draw_line_to_func_t line_to);
69 hb_draw_funcs_set_quadratic_to_func (hb_draw_funcs_t *funcs,
70 hb_draw_quadratic_to_func_t quadratic_to);
73 hb_draw_funcs_set_cubic_to_func (hb_draw_funcs_t *funcs,
74 hb_draw_cubic_to_func_t cubic_to);
77 hb_draw_funcs_set_close_path_func (hb_draw_funcs_t *funcs,
78 hb_draw_close_path_func_t close_path);
80 HB_EXTERN hb_draw_funcs_t *
81 hb_draw_funcs_create (void);
83 HB_EXTERN hb_draw_funcs_t *
84 hb_draw_funcs_reference (hb_draw_funcs_t *funcs);
87 hb_draw_funcs_destroy (hb_draw_funcs_t *funcs);
90 hb_draw_funcs_make_immutable (hb_draw_funcs_t *funcs);
93 hb_draw_funcs_is_immutable (hb_draw_funcs_t *funcs);
98 #endif /* HB_DRAW_H */