+int
+mdraw_glyph_list (MFrame *frame, MText *mt, int from, int to,
+ MDrawControl *control, MDrawGlyphInfo *info,
+ int array_size, int *num_glyphs_return)
+{
+ MGlyphString *gstring;
+ MGlyph *g;
+ int n;
+
+ ASSURE_CONTROL (control);
+ *num_glyphs_return = 0;
+ M_CHECK_RANGE (mt, from, to, -1, 0);
+ gstring = get_gstring (frame, mt, from, to, control);
+ if (! gstring)
+ return -1;
+ for (g = MGLYPH (1), n = 0; g->type != GLYPH_ANCHOR; g++)
+ {
+ if (g->type == GLYPH_BOX
+ || g->pos < from || g->pos >= to)
+ continue;
+ if (n < array_size)
+ {
+ info->from = g->pos;
+ info->to = g->to;
+ info->glyph_code = (g->type == GLYPH_CHAR ? g->code : 0);
+ info->x = g->xoff;
+ info->y = g->yoff;
+ info->this.x = g->lbearing;
+ info->this.y = - g->ascent;
+ info->this.height = g->ascent + g->descent;
+ info->this.width = g->rbearing - g->lbearing;
+ info->logical_width = g->width;
+ if (g->rface->rfont)
+ info->font = &g->rface->rfont->font;
+ else
+ info->font = NULL;
+ info++;
+ }
+ n++;
+ }
+ M17N_OBJECT_UNREF (gstring->top);
+
+ *num_glyphs_return = n;
+ return (n <= array_size ? 0 : -1);
+}
+
+/*=*/
+