Reorder hb_ot_shaper_t members to save 8 bytes of data per shaper

This commit is contained in:
Behdad Esfahbod 2022-07-13 13:34:11 -06:00
parent e5f0bc8f0a
commit c2712ff4f5
10 changed files with 30 additions and 30 deletions

View File

@ -735,12 +735,12 @@ const hb_ot_shaper_t _hb_ot_shaper_arabic =
data_destroy_arabic, data_destroy_arabic,
nullptr, /* preprocess_text */ nullptr, /* preprocess_text */
postprocess_glyphs_arabic, postprocess_glyphs_arabic,
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
nullptr, /* decompose */ nullptr, /* decompose */
nullptr, /* compose */ nullptr, /* compose */
setup_masks_arabic, setup_masks_arabic,
HB_TAG_NONE, /* gpos_tag */
reorder_marks_arabic, reorder_marks_arabic,
HB_TAG_NONE, /* gpos_tag */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE, HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
true, /* fallback_position */ true, /* fallback_position */
}; };

View File

@ -39,12 +39,12 @@ const hb_ot_shaper_t _hb_ot_shaper_default =
nullptr, /* data_destroy */ nullptr, /* data_destroy */
nullptr, /* preprocess_text */ nullptr, /* preprocess_text */
nullptr, /* postprocess_glyphs */ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
nullptr, /* decompose */ nullptr, /* decompose */
nullptr, /* compose */ nullptr, /* compose */
nullptr, /* setup_masks */ nullptr, /* setup_masks */
HB_TAG_NONE, /* gpos_tag */
nullptr, /* reorder_marks */ nullptr, /* reorder_marks */
HB_TAG_NONE, /* gpos_tag */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE, HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
true, /* fallback_position */ true, /* fallback_position */
}; };
@ -59,12 +59,12 @@ const hb_ot_shaper_t _hb_ot_shaper_dumber =
nullptr, /* data_destroy */ nullptr, /* data_destroy */
nullptr, /* preprocess_text */ nullptr, /* preprocess_text */
nullptr, /* postprocess_glyphs */ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
nullptr, /* decompose */ nullptr, /* decompose */
nullptr, /* compose */ nullptr, /* compose */
nullptr, /* setup_masks */ nullptr, /* setup_masks */
HB_TAG_NONE, /* gpos_tag */
nullptr, /* reorder_marks */ nullptr, /* reorder_marks */
HB_TAG_NONE, /* gpos_tag */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
false, /* fallback_position */ false, /* fallback_position */
}; };

View File

@ -422,12 +422,12 @@ const hb_ot_shaper_t _hb_ot_shaper_hangul =
data_destroy_hangul, data_destroy_hangul,
preprocess_text_hangul, preprocess_text_hangul,
nullptr, /* postprocess_glyphs */ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_NONE,
nullptr, /* decompose */ nullptr, /* decompose */
nullptr, /* compose */ nullptr, /* compose */
setup_masks_hangul, setup_masks_hangul,
HB_TAG_NONE, /* gpos_tag */
nullptr, /* reorder_marks */ nullptr, /* reorder_marks */
HB_TAG_NONE, /* gpos_tag */
HB_OT_SHAPE_NORMALIZATION_MODE_NONE,
HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
false, /* fallback_position */ false, /* fallback_position */
}; };

View File

@ -171,12 +171,12 @@ const hb_ot_shaper_t _hb_ot_shaper_hebrew =
nullptr, /* data_destroy */ nullptr, /* data_destroy */
nullptr, /* preprocess_text */ nullptr, /* preprocess_text */
nullptr, /* postprocess_glyphs */ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
nullptr, /* decompose */ nullptr, /* decompose */
compose_hebrew, compose_hebrew,
nullptr, /* setup_masks */ nullptr, /* setup_masks */
HB_TAG ('h','e','b','r'), /* gpos_tag. https://github.com/harfbuzz/harfbuzz/issues/347#issuecomment-267838368 */
nullptr, /* reorder_marks */ nullptr, /* reorder_marks */
HB_TAG ('h','e','b','r'), /* gpos_tag. https://github.com/harfbuzz/harfbuzz/issues/347#issuecomment-267838368 */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE, HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
true, /* fallback_position */ true, /* fallback_position */
}; };

View File

@ -1528,12 +1528,12 @@ const hb_ot_shaper_t _hb_ot_shaper_indic =
data_destroy_indic, data_destroy_indic,
preprocess_text_indic, preprocess_text_indic,
nullptr, /* postprocess_glyphs */ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
decompose_indic, decompose_indic,
compose_indic, compose_indic,
setup_masks_indic, setup_masks_indic,
HB_TAG_NONE, /* gpos_tag */
nullptr, /* reorder_marks */ nullptr, /* reorder_marks */
HB_TAG_NONE, /* gpos_tag */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
false, /* fallback_position */ false, /* fallback_position */
}; };

View File

@ -368,12 +368,12 @@ const hb_ot_shaper_t _hb_ot_shaper_khmer =
data_destroy_khmer, data_destroy_khmer,
nullptr, /* preprocess_text */ nullptr, /* preprocess_text */
nullptr, /* postprocess_glyphs */ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
decompose_khmer, decompose_khmer,
compose_khmer, compose_khmer,
setup_masks_khmer, setup_masks_khmer,
HB_TAG_NONE, /* gpos_tag */
nullptr, /* reorder_marks */ nullptr, /* reorder_marks */
HB_TAG_NONE, /* gpos_tag */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
false, /* fallback_position */ false, /* fallback_position */
}; };

View File

@ -320,12 +320,12 @@ const hb_ot_shaper_t _hb_ot_shaper_myanmar =
nullptr, /* data_destroy */ nullptr, /* data_destroy */
nullptr, /* preprocess_text */ nullptr, /* preprocess_text */
nullptr, /* postprocess_glyphs */ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
nullptr, /* decompose */ nullptr, /* decompose */
nullptr, /* compose */ nullptr, /* compose */
setup_masks_myanmar, setup_masks_myanmar,
HB_TAG_NONE, /* gpos_tag */
nullptr, /* reorder_marks */ nullptr, /* reorder_marks */
HB_TAG_NONE, /* gpos_tag */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY, HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
false, /* fallback_position */ false, /* fallback_position */
}; };
@ -342,12 +342,12 @@ const hb_ot_shaper_t _hb_ot_shaper_myanmar_zawgyi =
nullptr, /* data_destroy */ nullptr, /* data_destroy */
nullptr, /* preprocess_text */ nullptr, /* preprocess_text */
nullptr, /* postprocess_glyphs */ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_NONE,
nullptr, /* decompose */ nullptr, /* decompose */
nullptr, /* compose */ nullptr, /* compose */
nullptr, /* setup_masks */ nullptr, /* setup_masks */
HB_TAG_NONE, /* gpos_tag */
nullptr, /* reorder_marks */ nullptr, /* reorder_marks */
HB_TAG_NONE, /* gpos_tag */
HB_OT_SHAPE_NORMALIZATION_MODE_NONE,
HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
false, /* fallback_position */ false, /* fallback_position */
}; };

View File

@ -379,12 +379,12 @@ const hb_ot_shaper_t _hb_ot_shaper_thai =
nullptr, /* data_destroy */ nullptr, /* data_destroy */
preprocess_text_thai, preprocess_text_thai,
nullptr, /* postprocess_glyphs */ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
nullptr, /* decompose */ nullptr, /* decompose */
nullptr, /* compose */ nullptr, /* compose */
nullptr, /* setup_masks */ nullptr, /* setup_masks */
HB_TAG_NONE, /* gpos_tag */
nullptr, /* reorder_marks */ nullptr, /* reorder_marks */
HB_TAG_NONE, /* gpos_tag */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE, HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
false,/* fallback_position */ false,/* fallback_position */
}; };

View File

@ -490,12 +490,12 @@ const hb_ot_shaper_t _hb_ot_shaper_use =
data_destroy_use, data_destroy_use,
preprocess_text_use, preprocess_text_use,
nullptr, /* postprocess_glyphs */ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
nullptr, /* decompose */ nullptr, /* decompose */
compose_use, compose_use,
setup_masks_use, setup_masks_use,
HB_TAG_NONE, /* gpos_tag */
nullptr, /* reorder_marks */ nullptr, /* reorder_marks */
HB_TAG_NONE, /* gpos_tag */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY, HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
false, /* fallback_position */ false, /* fallback_position */
}; };

View File

@ -117,8 +117,6 @@ struct hb_ot_shaper_t
hb_font_t *font); hb_font_t *font);
hb_ot_shape_normalization_mode_t normalization_preference;
/* decompose() /* decompose()
* Called during shape()'s normalization. * Called during shape()'s normalization.
* May be NULL. * May be NULL.
@ -147,12 +145,6 @@ struct hb_ot_shaper_t
hb_buffer_t *buffer, hb_buffer_t *buffer,
hb_font_t *font); hb_font_t *font);
/* gpos_tag()
* If not HB_TAG_NONE, then must match found GPOS script tag for
* GPOS to be applied. Otherwise, fallback positioning will be used.
*/
hb_tag_t gpos_tag;
/* reorder_marks() /* reorder_marks()
* Called during shape(). * Called during shape().
* Shapers can use to modify ordering of combining marks. * Shapers can use to modify ordering of combining marks.
@ -163,6 +155,14 @@ struct hb_ot_shaper_t
unsigned int start, unsigned int start,
unsigned int end); unsigned int end);
/* gpos_tag()
* If not HB_TAG_NONE, then must match found GPOS script tag for
* GPOS to be applied. Otherwise, fallback positioning will be used.
*/
hb_tag_t gpos_tag;
hb_ot_shape_normalization_mode_t normalization_preference;
hb_ot_shape_zero_width_marks_type_t zero_width_marks; hb_ot_shape_zero_width_marks_type_t zero_width_marks;
bool fallback_position; bool fallback_position;