summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-private.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-private.hh')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-private.hh58
1 files changed, 40 insertions, 18 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-private.hh
index 39572dfe00..fb2f61157a 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-private.hh
@@ -39,6 +39,8 @@
#define complex_var_u8_1() var2.u8[3]
+#define HB_OT_SHAPE_COMPLEX_MAX_COMBINING_MARKS 32
+
enum hb_ot_shape_zero_width_marks_type_t {
HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
@@ -63,12 +65,10 @@ enum hb_ot_shape_zero_width_marks_type_t {
struct hb_ot_complex_shaper_t
{
- char name[8];
-
/* collect_features()
* Called during shape_plan().
* Shapers should use plan->map to add their features and callbacks.
- * May be NULL.
+ * May be nullptr.
*/
void (*collect_features) (hb_ot_shape_planner_t *plan);
@@ -76,7 +76,7 @@ struct hb_ot_complex_shaper_t
* Called during shape_plan().
* Shapers should use plan->map to override features and add callbacks after
* common features are added.
- * May be NULL.
+ * May be nullptr.
*/
void (*override_features) (hb_ot_shape_planner_t *plan);
@@ -84,15 +84,15 @@ struct hb_ot_complex_shaper_t
/* data_create()
* Called at the end of shape_plan().
* Whatever shapers return will be accessible through plan->data later.
- * If NULL is returned, means a plan failure.
+ * If nullptr is returned, means a plan failure.
*/
void *(*data_create) (const hb_ot_shape_plan_t *plan);
/* data_destroy()
* Called when the shape_plan is being destroyed.
* plan->data is passed here for destruction.
- * If NULL is returned, means a plan failure.
- * May be NULL.
+ * If nullptr is returned, means a plan failure.
+ * May be nullptr.
*/
void (*data_destroy) (void *data);
@@ -100,7 +100,7 @@ struct hb_ot_complex_shaper_t
/* preprocess_text()
* Called during shape().
* Shapers can use to modify text before shaping starts.
- * May be NULL.
+ * May be nullptr.
*/
void (*preprocess_text) (const hb_ot_shape_plan_t *plan,
hb_buffer_t *buffer,
@@ -109,7 +109,7 @@ struct hb_ot_complex_shaper_t
/* postprocess_glyphs()
* Called during shape().
* Shapers can use to modify glyphs after shaping ends.
- * May be NULL.
+ * May be nullptr.
*/
void (*postprocess_glyphs) (const hb_ot_shape_plan_t *plan,
hb_buffer_t *buffer,
@@ -120,7 +120,7 @@ struct hb_ot_complex_shaper_t
/* decompose()
* Called during shape()'s normalization.
- * May be NULL.
+ * May be nullptr.
*/
bool (*decompose) (const hb_ot_shape_normalize_context_t *c,
hb_codepoint_t ab,
@@ -129,7 +129,7 @@ struct hb_ot_complex_shaper_t
/* compose()
* Called during shape()'s normalization.
- * May be NULL.
+ * May be nullptr.
*/
bool (*compose) (const hb_ot_shape_normalize_context_t *c,
hb_codepoint_t a,
@@ -140,7 +140,7 @@ struct hb_ot_complex_shaper_t
* Called during shape().
* Shapers should use map to get feature masks and set on buffer.
* Shapers may NOT modify characters.
- * May be NULL.
+ * May be nullptr.
*/
void (*setup_masks) (const hb_ot_shape_plan_t *plan,
hb_buffer_t *buffer,
@@ -150,10 +150,20 @@ struct hb_ot_complex_shaper_t
* Called during shape().
* If set and returns true, GDEF/GSUB/GPOS of the font are ignored
* and fallback operations used.
- * May be NULL.
+ * May be nullptr.
*/
bool (*disable_otl) (const hb_ot_shape_plan_t *plan);
+ /* reorder_marks()
+ * Called during shape().
+ * Shapers can use to modify ordering of combining marks.
+ * May be nullptr.
+ */
+ void (*reorder_marks) (const hb_ot_shape_plan_t *plan,
+ hb_buffer_t *buffer,
+ unsigned int start,
+ unsigned int end);
+
hb_ot_shape_zero_width_marks_type_t zero_width_marks;
bool fallback_position;
@@ -191,6 +201,9 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
case HB_SCRIPT_MANICHAEAN:
case HB_SCRIPT_PSALTER_PAHLAVI:
+ /* Unicode-9.0 additions */
+ case HB_SCRIPT_ADLAM:
+
/* For Arabic script, use the Arabic shaper even if no OT script tag was found.
* This is because we do fallback shaping for Arabic script (and not others).
* But note that Arabic shaping is applicable only to horizontal layout; for
@@ -250,10 +263,12 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
case HB_SCRIPT_SINHALA:
/* If the designer designed the font for the 'DFLT' script,
- * use the default shaper. Otherwise, use the specific shaper.
+ * (or we ended up arbitrarily pick 'latn'), use the default shaper.
+ * Otherwise, use the specific shaper.
* Note that for some simple scripts, there may not be *any*
* GSUB/GPOS needed, so there may be no scripts found! */
- if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T'))
+ if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') ||
+ planner->map.chosen_script[0] == HB_TAG ('l','a','t','n'))
return &_hb_ot_complex_shaper_default;
else
return &_hb_ot_complex_shaper_indic;
@@ -269,7 +284,7 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
planner->map.script_index[0],
planner->map.language_index[0],
HB_TAG ('p','r','e','f'),
- NULL))
+ nullptr))
return &_hb_ot_complex_shaper_indic;
else
return &_hb_ot_complex_shaper_default;
@@ -359,11 +374,18 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
case HB_SCRIPT_MARCHEN:
case HB_SCRIPT_NEWA:
+ /* Unicode-10.0 additions */
+ case HB_SCRIPT_MASARAM_GONDI:
+ case HB_SCRIPT_SOYOMBO:
+ case HB_SCRIPT_ZANABAZAR_SQUARE:
+
/* If the designer designed the font for the 'DFLT' script,
- * use the default shaper. Otherwise, use the specific shaper.
+ * (or we ended up arbitrarily pick 'latn'), use the default shaper.
+ * Otherwise, use the specific shaper.
* Note that for some simple scripts, there may not be *any*
* GSUB/GPOS needed, so there may be no scripts found! */
- if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T'))
+ if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') ||
+ planner->map.chosen_script[0] == HB_TAG ('l','a','t','n'))
return &_hb_ot_complex_shaper_default;
else
return &_hb_ot_complex_shaper_use;