Use invisible-glyph for spaces if font has no ASCII space
Fixes https://github.com/harfbuzz/harfbuzz/issues/3340 Should add tests ideally.
This commit is contained in:
parent
067f90a820
commit
06ee40213c
|
@ -525,6 +525,15 @@ _hb_ot_shape_fallback_spaces (const hb_ot_shape_plan_t *plan HB_UNUSED,
|
|||
for (unsigned int i = 0; i < count; i++)
|
||||
if (_hb_glyph_info_is_unicode_space (&info[i]) && !_hb_glyph_info_ligated (&info[i]))
|
||||
{
|
||||
/* If font had no ASCII space and we used the invisible glyph, give it a 1/4 EM default advance. */
|
||||
if (buffer->invisible && info[i].codepoint == buffer->invisible)
|
||||
{
|
||||
if (horizontal)
|
||||
pos[i].x_advance = +font->x_scale / 4;
|
||||
else
|
||||
pos[i].y_advance = -font->y_scale / 4;
|
||||
}
|
||||
|
||||
hb_unicode_funcs_t::space_t space_type = _hb_glyph_info_get_unicode_space_fallback_type (&info[i]);
|
||||
hb_codepoint_t glyph;
|
||||
typedef hb_unicode_funcs_t t;
|
||||
|
|
|
@ -193,7 +193,8 @@ decompose_current_character (const hb_ot_shape_normalize_context_t *c, bool shor
|
|||
{
|
||||
hb_codepoint_t space_glyph;
|
||||
hb_unicode_funcs_t::space_t space_type = buffer->unicode->space_fallback_type (u);
|
||||
if (space_type != hb_unicode_funcs_t::NOT_SPACE && c->font->get_nominal_glyph (0x0020u, &space_glyph))
|
||||
if (space_type != hb_unicode_funcs_t::NOT_SPACE &&
|
||||
(c->font->get_nominal_glyph (0x0020, &space_glyph) || (space_glyph = buffer->invisible)))
|
||||
{
|
||||
_hb_glyph_info_set_unicode_space_fallback_type (&buffer->cur(), space_type);
|
||||
next_char (buffer, space_glyph);
|
||||
|
|
Loading…
Reference in New Issue