diff options
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc')
-rw-r--r-- | src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc index 6ba925c675..347ea2e7ac 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc +++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc @@ -24,7 +24,11 @@ * Google Author(s): Behdad Esfahbod */ -#include "hb-ot-shape-complex-private.hh" +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + +#include "hb-ot-shape-complex.hh" /* Thai / Lao shaper */ @@ -218,6 +222,10 @@ do_thai_pua_shaping (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_buffer_t *buffer, hb_font_t *font) { +#ifdef HB_NO_OT_SHAPE_COMPLEX_THAI_FALLBACK + return; +#endif + thai_above_state_t above_state = thai_above_start_state[NOT_CONSONANT]; thai_below_state_t below_state = thai_below_start_state[NOT_CONSONANT]; unsigned int base = 0; @@ -260,7 +268,7 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan, { /* This function implements the shaping logic documented here: * - * http://linux.thai.net/~thep/th-otf/shaping.html + * https://linux.thai.net/~thep/th-otf/shaping.html * * The first shaping rule listed there is needed even if the font has Thai * OpenType tables. The rest do fallback positioning based on PUA codepoints. @@ -315,7 +323,7 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan, buffer->clear_output (); unsigned int count = buffer->len; - for (buffer->idx = 0; buffer->idx < count && !buffer->in_error;) + for (buffer->idx = 0; buffer->idx < count && buffer->successful;) { hb_codepoint_t u = buffer->cur().codepoint; if (likely (!IS_SARA_AM (u))) { @@ -324,10 +332,10 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan, } /* Is SARA AM. Decompose and reorder. */ - hb_codepoint_t decomposed[2] = {hb_codepoint_t (NIKHAHIT_FROM_SARA_AM (u)), - hb_codepoint_t (SARA_AA_FROM_SARA_AM (u))}; - buffer->replace_glyphs (1, 2, decomposed); - if (unlikely (buffer->in_error)) + hb_glyph_info_t &nikhahit = buffer->output_glyph (NIKHAHIT_FROM_SARA_AM (u)); + _hb_glyph_info_set_continuation (&nikhahit); + buffer->replace_glyph (SARA_AA_FROM_SARA_AM (u)); + if (unlikely (!buffer->successful)) return; /* Make Nikhahit be recognized as a ccc=0 mark when zeroing widths. */ @@ -376,8 +384,11 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_thai = nullptr, /* decompose */ nullptr, /* compose */ nullptr, /* setup_masks */ - nullptr, /* disable_otl */ + HB_TAG_NONE, /* gpos_tag */ nullptr, /* reorder_marks */ HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE, false,/* fallback_position */ }; + + +#endif |