提交 75483aaf 编写于 作者: B Behdad Esfahbod

Untangle if/else waterfall

上级 04fd8517
......@@ -164,26 +164,40 @@ decompose_current_character (const hb_ot_shape_normalize_context_t *c, bool shor
{
hb_buffer_t * const buffer = c->buffer;
hb_codepoint_t u = buffer->cur().codepoint;
hb_codepoint_t glyph, space_glyph;
hb_unicode_funcs_t::space_t space_type;
hb_codepoint_t glyph;
/* Kind of a cute waterfall here... */
if (shortest && c->font->get_glyph (u, 0, &glyph))
{
next_char (buffer, glyph);
else if (decompose (c, shortest, u))
return;
}
if (decompose (c, shortest, u))
{
skip_char (buffer);
else if (!shortest && c->font->get_glyph (u, 0, &glyph))
return;
}
if (!shortest && c->font->get_glyph (u, 0, &glyph))
{
next_char (buffer, glyph);
else if (_hb_glyph_info_is_unicode_space (&buffer->cur()) &&
(space_type = buffer->unicode->space_fallback_type (u)) != hb_unicode_funcs_t::NOT_SPACE &&
c->font->get_glyph (0x0020u, 0, &space_glyph))
return;
}
if (_hb_glyph_info_is_unicode_space (&buffer->cur()))
{
_hb_glyph_info_set_unicode_space_fallback_type (&buffer->cur(), space_type);
next_char (buffer, space_glyph);
buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_SPACE_FALLBACK;
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_glyph (0x0020u, 0, &space_glyph))
{
_hb_glyph_info_set_unicode_space_fallback_type (&buffer->cur(), space_type);
next_char (buffer, space_glyph);
buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_SPACE_FALLBACK;
return;
}
}
else
next_char (buffer, glyph); /* glyph is initialized in earlier branches. */
next_char (buffer, glyph); /* glyph is initialized in earlier branches. */
}
static inline void
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册