/src/harfbuzz/src/hb-limits.hh
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright © 2022 Behdad Esfahbod |
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 | | |
25 | | #ifndef HB_LIMITS_HH |
26 | | #define HB_LIMITS_HH |
27 | | |
28 | | #include "hb.hh" |
29 | | |
30 | | |
31 | | #ifndef HB_BUFFER_MAX_LEN_FACTOR |
32 | | #define HB_BUFFER_MAX_LEN_FACTOR 64 |
33 | | #endif |
34 | | #ifndef HB_BUFFER_MAX_LEN_MIN |
35 | 47.8M | #define HB_BUFFER_MAX_LEN_MIN 16384 |
36 | | #endif |
37 | | #ifndef HB_BUFFER_MAX_LEN_DEFAULT |
38 | 107M | #define HB_BUFFER_MAX_LEN_DEFAULT 0x3FFFFFFF /* Shaping more than a billion chars? Let us know! */ |
39 | | #endif |
40 | | |
41 | | #ifndef HB_BUFFER_MAX_OPS_FACTOR |
42 | | #define HB_BUFFER_MAX_OPS_FACTOR 1024 |
43 | | #endif |
44 | | #ifndef HB_BUFFER_MAX_OPS_MIN |
45 | 47.8M | #define HB_BUFFER_MAX_OPS_MIN 16384 |
46 | | #endif |
47 | | #ifndef HB_BUFFER_MAX_OPS_DEFAULT |
48 | 107M | #define HB_BUFFER_MAX_OPS_DEFAULT 0x1FFFFFFF /* Shaping more than a billion operations? Let us know! */ |
49 | | #endif |
50 | | |
51 | | |
52 | | #ifndef HB_MAX_NESTING_LEVEL |
53 | | #define HB_MAX_NESTING_LEVEL 64 |
54 | | #endif |
55 | | |
56 | | |
57 | | #ifndef HB_MAX_CONTEXT_LENGTH |
58 | 13.2M | #define HB_MAX_CONTEXT_LENGTH 64 |
59 | | #endif |
60 | | |
61 | | #ifndef HB_CLOSURE_MAX_STAGES |
62 | | /* |
63 | | * The maximum number of times a lookup can be applied during shaping. |
64 | | * Used to limit the number of iterations of the closure algorithm. |
65 | | * This must be larger than the number of times add_gsub_pause() is |
66 | | * called in a collect_features call of any shaper. |
67 | | */ |
68 | 0 | #define HB_CLOSURE_MAX_STAGES 12 |
69 | | #endif |
70 | | |
71 | | #ifndef HB_MAX_SCRIPTS |
72 | 0 | #define HB_MAX_SCRIPTS 500 |
73 | | #endif |
74 | | |
75 | | #ifndef HB_MAX_LANGSYS |
76 | 0 | #define HB_MAX_LANGSYS 2000 |
77 | | #endif |
78 | | |
79 | | #ifndef HB_MAX_LANGSYS_FEATURE_COUNT |
80 | | #define HB_MAX_LANGSYS_FEATURE_COUNT 50000 |
81 | | #endif |
82 | | |
83 | | #ifndef HB_MAX_FEATURE_INDICES |
84 | 0 | #define HB_MAX_FEATURE_INDICES 1500 |
85 | | #endif |
86 | | |
87 | | #ifndef HB_MAX_LOOKUP_VISIT_COUNT |
88 | 0 | #define HB_MAX_LOOKUP_VISIT_COUNT 35000 |
89 | | #endif |
90 | | |
91 | | |
92 | | #ifndef HB_GLYF_MAX_POINTS |
93 | 983k | #define HB_GLYF_MAX_POINTS 20000 |
94 | | #endif |
95 | | |
96 | | #ifndef HB_GLYF_MAX_EDGE_COUNT |
97 | | #define HB_GLYF_MAX_EDGE_COUNT 1024 |
98 | | #endif |
99 | | |
100 | | #ifndef HB_CFF_MAX_OPS |
101 | 421k | #define HB_CFF_MAX_OPS 10000 |
102 | | #endif |
103 | | |
104 | | #ifndef HB_COLRV1_MAX_EDGE_COUNT |
105 | | #define HB_COLRV1_MAX_EDGE_COUNT 1024 |
106 | | #endif |
107 | | |
108 | | |
109 | | #endif /* HB_LIMITS_HH */ |