blob: bf37975d2914e252429ad7eaf284092bb29e9f88 [file] [log] [blame]
Frédéric Wang319ff592016-08-25 11:06:41 +02001/*
2 * Copyright © 2016 Igalia S.L.
3 *
4 * This is part of HarfBuzz, a text shaping library.
5 *
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.
11 *
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
16 * DAMAGE.
17 *
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.
23 *
24 * Igalia Author(s): Frédéric Wang
25 */
26
27#ifndef HB_OT_H_IN
28#error "Include <hb-ot.h> instead."
29#endif
30
31#ifndef HB_OT_MATH_H
32#define HB_OT_MATH_H
33
34#include "hb.h"
35
36HB_BEGIN_DECLS
37
38
39typedef enum {
40 HB_OT_MATH_CONSTANT_SCRIPT_PERCENT_SCALE_DOWN = 0,
41 HB_OT_MATH_CONSTANT_SCRIPT_SCRIPT_PERCENT_SCALE_DOWN = 1,
42 HB_OT_MATH_CONSTANT_DELIMITED_SUB_FORMULA_MIN_HEIGHT = 2,
43 HB_OT_MATH_CONSTANT_DISPLAY_OPERATOR_MIN_HEIGHT = 3,
44 HB_OT_MATH_CONSTANT_MATH_LEADING = 4,
45 HB_OT_MATH_CONSTANT_AXIS_HEIGHT = 5,
46 HB_OT_MATH_CONSTANT_ACCENT_BASE_HEIGHT = 6,
47 HB_OT_MATH_CONSTANT_FLATTENED_ACCENT_BASE_HEIGHT = 7,
48 HB_OT_MATH_CONSTANT_SUBSCRIPT_SHIFT_DOWN = 8,
49 HB_OT_MATH_CONSTANT_SUBSCRIPT_TOP_MAX = 9,
50 HB_OT_MATH_CONSTANT_SUBSCRIPT_BASELINE_DROP_MIN = 10,
51 HB_OT_MATH_CONSTANT_SUPERSCRIPT_SHIFT_UP = 11,
52 HB_OT_MATH_CONSTANT_SUPERSCRIPT_SHIFT_UP_CRAMPED = 12,
53 HB_OT_MATH_CONSTANT_SUPERSCRIPT_BOTTOM_MIN = 13,
54 HB_OT_MATH_CONSTANT_SUPERSCRIPT_BASELINE_DROP_MAX = 14,
55 HB_OT_MATH_CONSTANT_SUB_SUPERSCRIPT_GAP_MIN = 15,
56 HB_OT_MATH_CONSTANT_SUPERSCRIPT_BOTTOM_MAX_WITH_SUBSCRIPT = 16,
57 HB_OT_MATH_CONSTANT_SPACE_AFTER_SCRIPT = 17,
58 HB_OT_MATH_CONSTANT_UPPER_LIMIT_GAP_MIN = 18,
59 HB_OT_MATH_CONSTANT_UPPER_LIMIT_BASELINE_RISE_MIN = 19,
60 HB_OT_MATH_CONSTANT_LOWER_LIMIT_GAP_MIN = 20,
61 HB_OT_MATH_CONSTANT_LOWER_LIMIT_BASELINE_DROP_MIN = 21,
62 HB_OT_MATH_CONSTANT_STACK_TOP_SHIFT_UP = 22,
63 HB_OT_MATH_CONSTANT_STACK_TOP_DISPLAY_STYLE_SHIFT_UP = 23,
64 HB_OT_MATH_CONSTANT_STACK_BOTTOM_SHIFT_DOWN = 24,
65 HB_OT_MATH_CONSTANT_STACK_BOTTOM_DISPLAY_STYLE_SHIFT_DOWN = 25,
66 HB_OT_MATH_CONSTANT_STACK_GAP_MIN = 26,
67 HB_OT_MATH_CONSTANT_STACK_DISPLAY_STYLE_GAP_MIN = 27,
68 HB_OT_MATH_CONSTANT_STRETCH_STACK_TOP_SHIFT_UP = 28,
69 HB_OT_MATH_CONSTANT_STRETCH_STACK_BOTTOM_SHIFT_DOWN = 29,
70 HB_OT_MATH_CONSTANT_STRETCH_STACK_GAP_ABOVE_MIN = 30,
71 HB_OT_MATH_CONSTANT_STRETCH_STACK_GAP_BELOW_MIN = 31,
72 HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_SHIFT_UP = 32,
73 HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_DISPLAY_STYLE_SHIFT_UP = 33,
74 HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_SHIFT_DOWN = 34,
75 HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_DISPLAY_STYLE_SHIFT_DOWN = 35,
76 HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_GAP_MIN = 36,
77 HB_OT_MATH_CONSTANT_FRACTION_NUM_DISPLAY_STYLE_GAP_MIN = 37,
78 HB_OT_MATH_CONSTANT_FRACTION_RULE_THICKNESS = 38,
79 HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_GAP_MIN = 39,
80 HB_OT_MATH_CONSTANT_FRACTION_DENOM_DISPLAY_STYLE_GAP_MIN = 40,
81 HB_OT_MATH_CONSTANT_SKEWED_FRACTION_HORIZONTAL_GAP = 41,
82 HB_OT_MATH_CONSTANT_SKEWED_FRACTION_VERTICAL_GAP = 42,
83 HB_OT_MATH_CONSTANT_OVERBAR_VERTICAL_GAP = 43,
84 HB_OT_MATH_CONSTANT_OVERBAR_RULE_THICKNESS = 44,
85 HB_OT_MATH_CONSTANT_OVERBAR_EXTRA_ASCENDER = 45,
86 HB_OT_MATH_CONSTANT_UNDERBAR_VERTICAL_GAP = 46,
87 HB_OT_MATH_CONSTANT_UNDERBAR_RULE_THICKNESS = 47,
88 HB_OT_MATH_CONSTANT_UNDERBAR_EXTRA_DESCENDER = 48,
89 HB_OT_MATH_CONSTANT_RADICAL_VERTICAL_GAP = 49,
90 HB_OT_MATH_CONSTANT_RADICAL_DISPLAY_STYLE_VERTICAL_GAP = 50,
91 HB_OT_MATH_CONSTANT_RADICAL_RULE_THICKNESS = 51,
92 HB_OT_MATH_CONSTANT_RADICAL_EXTRA_ASCENDER = 52,
93 HB_OT_MATH_CONSTANT_RADICAL_KERN_BEFORE_DEGREE = 53,
94 HB_OT_MATH_CONSTANT_RADICAL_KERN_AFTER_DEGREE = 54,
95 HB_OT_MATH_CONSTANT_RADICAL_DEGREE_BOTTOM_RAISE_PERCENT = 55
96} hb_ot_math_constant_t;
97
Frédéric Wangd7182d12016-08-25 11:15:31 +020098typedef enum {
99 HB_OT_MATH_KERN_TOP_RIGHT = 0,
100 HB_OT_MATH_KERN_TOP_LEFT = 1,
101 HB_OT_MATH_KERN_BOTTOM_RIGHT = 2,
102 HB_OT_MATH_KERN_BOTTOM_LEFT = 3
103} hb_ot_math_kern_t;
104
Behdad Esfahbod7fe0e282016-09-26 17:51:47 +0100105typedef struct hb_math_glyph_variant_t {
106 hb_codepoint_t glyph;
107 hb_position_t advance;
108} hb_math_glyph_variant_t;
109
110typedef enum { /*< flags >*/
111 HB_MATH_GLYPH_PART_FLAG_EXTENDER = 0x00000001u /* Extender glyph */
112} hb_math_glyph_part_flags_t;
113
114typedef struct hb_math_glyph_part_t {
115 hb_codepoint_t glyph;
116 hb_position_t start_connector_length;
117 hb_position_t end_connector_length;
118 hb_position_t full_advance;
119 hb_math_glyph_part_flags_t flags;
120} hb_math_glyph_part_t;
121
122
Frédéric Wang319ff592016-08-25 11:06:41 +0200123HB_END_DECLS
124
125#endif /* HB_OT_MATH_H */