[morx] Reverse graphemese, not whole buffer
Fixes https://github.com/harfbuzz/harfbuzz/issues/3314 Supersedes https://github.com/harfbuzz/harfbuzz/pull/3315
This commit is contained in:
parent
5b995526f7
commit
23159084b4
|
@ -1038,12 +1038,12 @@ struct Chain
|
||||||
goto skip;
|
goto skip;
|
||||||
|
|
||||||
if (reverse)
|
if (reverse)
|
||||||
c->buffer->reverse ();
|
_hb_ot_layout_reverse_graphemes (c->buffer);
|
||||||
|
|
||||||
subtable->apply (c);
|
subtable->apply (c);
|
||||||
|
|
||||||
if (reverse)
|
if (reverse)
|
||||||
c->buffer->reverse ();
|
_hb_ot_layout_reverse_graphemes (c->buffer);
|
||||||
|
|
||||||
(void) c->buffer->message (c->font, "end chainsubtable %d", c->lookup_index);
|
(void) c->buffer->message (c->font, "end chainsubtable %d", c->lookup_index);
|
||||||
|
|
||||||
|
|
|
@ -359,6 +359,12 @@ _hb_grapheme_group_func (const hb_glyph_info_t& a HB_UNUSED,
|
||||||
#define foreach_grapheme(buffer, start, end) \
|
#define foreach_grapheme(buffer, start, end) \
|
||||||
foreach_group (buffer, start, end, _hb_grapheme_group_func)
|
foreach_group (buffer, start, end, _hb_grapheme_group_func)
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
_hb_ot_layout_reverse_graphemes (hb_buffer_t *buffer)
|
||||||
|
{
|
||||||
|
buffer->reverse_groups (_hb_grapheme_group_func,
|
||||||
|
buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS);
|
||||||
|
}
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
_hb_glyph_info_is_unicode_format (const hb_glyph_info_t *info)
|
_hb_glyph_info_is_unicode_format (const hb_glyph_info_t *info)
|
||||||
|
|
|
@ -628,20 +628,7 @@ hb_ensure_native_direction (hb_buffer_t *buffer)
|
||||||
(HB_DIRECTION_IS_VERTICAL (direction) &&
|
(HB_DIRECTION_IS_VERTICAL (direction) &&
|
||||||
direction != HB_DIRECTION_TTB))
|
direction != HB_DIRECTION_TTB))
|
||||||
{
|
{
|
||||||
|
_hb_ot_layout_reverse_graphemes (buffer);
|
||||||
if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS)
|
|
||||||
foreach_grapheme (buffer, start, end)
|
|
||||||
{
|
|
||||||
buffer->merge_clusters (start, end);
|
|
||||||
buffer->reverse_range (start, end);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
foreach_grapheme (buffer, start, end)
|
|
||||||
/* form_clusters() merged clusters already, we don't merge. */
|
|
||||||
buffer->reverse_range (start, end);
|
|
||||||
|
|
||||||
buffer->reverse ();
|
|
||||||
|
|
||||||
buffer->props.direction = HB_DIRECTION_REVERSE (buffer->props.direction);
|
buffer->props.direction = HB_DIRECTION_REVERSE (buffer->props.direction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
# https://github.com/harfbuzz/harfbuzz/issues/3314
|
||||||
|
/System/Library/Fonts/Apple\ Color\ Emoji.ttc;;U+05D0,U+1F1FA,U+1F1F8,U+1F1EE,U+1F1F1;[u1F1EE_u1F1F1=3+800|u1F1FA_u1F1F8=1+800|.notdef=0+800]
|
||||||
|
|
||||||
# https;//github.com/harfbuzz/harfbuzz/issues/3008
|
# https;//github.com/harfbuzz/harfbuzz/issues/3008
|
||||||
/System/Library/Fonts/ヒラギノ丸ゴ\ ProN\ W4.ttc;--features=palt;U+FF11;[gid781=0@-78,0+842]
|
/System/Library/Fonts/ヒラギノ丸ゴ\ ProN\ W4.ttc;--features=palt;U+FF11;[gid781=0@-78,0+842]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue