+ if (! flt && ! otf)
+ {
+ flt = mflt_find (LGLYPH_CHAR (LGSTRING_GLYPH (lgstring, 0)),
+ &flt_font_ft.flt_font);
+ if (! flt)
+ return make_number (0);
+ }
+
+ MFLTGlyphFT *glyphs = (MFLTGlyphFT *) gstring.glyphs;
+ ptrdiff_t allocated = gstring.allocated;
+ ptrdiff_t incr_min = len - allocated;
+
+ do
+ {
+ if (0 < incr_min)
+ {
+ xfree (glyphs);
+ glyphs = xpalloc (NULL, &allocated, incr_min, INT_MAX, sizeof *glyphs);
+ }
+ incr_min = 1;
+
+ for (i = 0; i < len; i++)
+ {
+ Lisp_Object g = LGSTRING_GLYPH (lgstring, i);
+ memset (&glyphs[i], 0, sizeof glyphs[i]);
+ glyphs[i].g.c = LGLYPH_CHAR (g);
+ if (with_variation_selector)
+ {
+ glyphs[i].g.code = LGLYPH_CODE (g);
+ glyphs[i].g.encoded = 1;
+ }
+ }
+
+ gstring.glyph_size = sizeof *glyphs;
+ gstring.glyphs = (MFLTGlyph *) glyphs;
+ gstring.allocated = allocated;
+ gstring.used = len;
+ gstring.r2l = 0;
+ }
+ while (mflt_run (&gstring, 0, len, &flt_font_ft.flt_font, flt) == -2);
+