diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 978230cd6..d63eba2f0 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -73,8 +73,7 @@ hb_ft_get_glyph (hb_font_t *font HB_UNUSED, #ifdef HAVE_FT_FACE_GETCHARVARIANTINDEX if (unlikely (variation_selector)) { *glyph = FT_Face_GetCharVariantIndex (ft_face, unicode, variation_selector); - if (*glyph) - return true; + return *glyph != 0; } #endif diff --git a/src/hb-ot-shape-normalize.cc b/src/hb-ot-shape-normalize.cc index 51ef77b9a..3fee809cf 100644 --- a/src/hb-ot-shape-normalize.cc +++ b/src/hb-ot-shape-normalize.cc @@ -217,8 +217,18 @@ handle_variation_selector_cluster (const hb_ot_shape_normalize_context_t *c, uns for (; buffer->idx < end - 1;) { if (unlikely (buffer->unicode->is_variation_selector (buffer->cur(+1).codepoint))) { /* The next two lines are some ugly lines... But work. */ - c->font->get_glyph (buffer->cur().codepoint, buffer->cur(+1).codepoint, &buffer->cur().glyph_index()); - buffer->replace_glyphs (2, 1, &buffer->cur().codepoint); + if (c->font->get_glyph (buffer->cur().codepoint, buffer->cur(+1).codepoint, &buffer->cur().glyph_index())) + { + buffer->replace_glyphs (2, 1, &buffer->cur().codepoint); + } + else + { + /* Just pass on the two characters separately, let GSUB do its magic. */ + set_glyph (buffer->cur(), c->font); + buffer->next_glyph (); + set_glyph (buffer->cur(), c->font); + buffer->next_glyph (); + } /* Skip any further variation selectors. */ while (buffer->idx < end && unlikely (buffer->unicode->is_variation_selector (buffer->cur().codepoint))) {