5 #include FT_TRUETYPE_TABLES_H
6 #include <fontconfig/fontconfig.h>
7 #include <fontconfig/fcfreetype.h>
12 #define PROGNAME "flt-gui"
14 #elif defined (FLT_OTF)
18 #define PROGNAME "flt-otf"
20 #else /* defined (FLT_HB) */
24 #define PROGNAME "flt-hb"
28 static FT_Library ft_library;
31 new_face (char *fontname, char **err)
40 pat = FcNameParse ((FcChar8 *) fontname);
43 *err = "invalid name format";
46 if (FcPatternGetString (pat, FC_FAMILY, 0, &fam) != FcResultMatch)
48 *err = "no family name";
51 if (FcPatternGetDouble (pat, FC_PIXEL_SIZE, 0, &pixelsize) != FcResultMatch)
53 FcPatternAddBool (pat, FC_SCALABLE, FcTrue);
54 FcPatternDel (pat, FC_PIXEL_SIZE);
55 os = FcObjectSetBuild (FC_FILE, NULL);
56 fs = FcFontList (NULL, pat, os);
59 *err = "no matching font";
62 FcPatternGetString (fs->fonts[0], FC_FILE, 0, &file);
64 if (FT_New_Face (ft_library, (char *) file, 0, &face))
66 FcFontSetDestroy (fs);
67 FcObjectSetDestroy (os);
68 FcPatternDestroy (pat);
69 *err = "font open fail";
72 FcFontSetDestroy (fs);
73 FcObjectSetDestroy (os);
74 FcPatternDestroy (pat);
75 if (FT_Set_Pixel_Sizes (face, pixelsize, pixelsize))
77 *err = "set pixelsize fail";
95 open_font (char *fontname, char **err)
97 FT_Face ft_face = new_face (fontname, err);
107 fontset = mfontset ("generic");
108 mface_put_prop (face, Mfontset, fontset);
109 mplist_add (plist, Mface, face);
110 mplist_add (plist, Mdevice, Mnil);
111 frame = mframe (plist);
112 m17n_object_unref (plist);
113 m17n_object_unref (face);
114 m17n_object_unref (fontset);
116 font = calloc (1, sizeof (MFLTFont));
117 font->font = mfont_encapsulate (frame, Mfreetype, ft_face);
118 font->face = ft_face;
123 close_font (MFLTFont *font)
125 FT_Done_Face (font->face);
127 m17n_object_unref (frame);
131 flt (MText *mt, int from, int to, MFLTFont *font, char *flt_name)
133 mtext_put_prop (mt, from, to, Mfont, font->font);
134 mdraw_text_extents (frame, mt, from, to, NULL, NULL, NULL, NULL);
138 #else /* FLT_OTF or FLT_HB */
146 get_glyph_id (MFLTFont *font, MFLTGlyph *g)
148 FT_Face face = ((FontInfo *) font)->face;
150 g->code = FT_Get_Char_Index (face, g->code);
152 return (g->code ? 0 : -1);
156 get_metric (MFLTFont *font, MFLTGlyphString *gstring, int from, int to)
158 FT_Face face = ((FontInfo *) font)->face;
160 for (; from < to; from++)
162 MFLTGlyph *g = gstring->glyphs + from;
163 FT_Glyph_Metrics *metrics;
165 if (FT_Load_Glyph (face, g->code, FT_LOAD_DEFAULT))
167 metrics = &face->glyph->metrics;
168 g->lbearing = metrics->horiBearingX;
169 g->rbearing = metrics->horiBearingX + metrics->width;
170 g->xadv = metrics->horiAdvance;
171 g->yadv = metrics->vertAdvance;
172 g->ascent = metrics->horiBearingY;
173 g->descent = metrics->height - metrics->horiBearingY;
179 flt (MText *mt, int from, int to, MFLTFont *font, char *flt_name)
181 MFLTGlyphString gstring;
185 memset (&gstring, 0, sizeof (MFLTGlyphString));
186 gstring.glyph_size = sizeof (MFLTGlyph);
187 gstring.allocated = len * 2;
188 gstring.glyphs = alloca (sizeof (MFLTGlyph) * gstring.allocated);
189 for (i = 0; i < len; i++)
190 gstring.glyphs[i].c = mtext_ref_char (mt, from + i);
192 return mflt_run (&gstring, 0, len, font, msymbol (flt_name));
203 #define DEVICE_DELTA(table, size) \
204 (((size) >= (table).StartSize && (size) <= (table).EndSize) \
205 ? ((table).DeltaValue[(size) - (table).StartSize] << 6) \
209 adjust_anchor (OTF_Anchor *anchor, FT_Face face,
210 unsigned code, unsigned x_ppem, unsigned y_ppem, int *x, int *y)
212 if (anchor->AnchorFormat == 2)
215 int ap = anchor->f.f1.AnchorPoint;
217 FT_Load_Glyph (face, (FT_UInt) code, FT_LOAD_MONOCHROME);
218 outline = &face->glyph->outline;
219 if (ap < outline->n_points)
221 *x = outline->points[ap].x;
222 *y = outline->points[ap].y;
225 else if (anchor->AnchorFormat == 3)
227 if (anchor->f.f2.XDeviceTable.offset)
228 *x += DEVICE_DELTA (anchor->f.f2.XDeviceTable, x_ppem);
229 if (anchor->f.f2.YDeviceTable.offset)
230 *y += DEVICE_DELTA (anchor->f.f2.YDeviceTable, y_ppem);
235 tag_name (char *str, unsigned tag)
238 *str++ = (tag >> 16) & 0xFF;
239 *str++ = (tag >> 8) & 0xFF;
245 encode_features (char *str, int count, unsigned *features)
250 for (i = 0; i < count; i++)
252 unsigned tag = features[i];
262 str = tag_name (str, tag);
275 drive_otf (MFLTFont *font, MFLT_OTF_Spec *spec,
276 MFLTGlyphString *in, int from, int to,
277 MFLTGlyphString *out, MFLTGlyphAdjustment *adjustment)
281 OTF *otf = ((FontInfoOTF *) font)->otf;
282 OTF_GlyphString otf_gstring;
284 char script[4], langsys[4];
285 char *gsub_features = NULL, *gpos_features = NULL;
292 otf_gstring.glyphs = NULL;
293 if (OTF_get_table (otf, "head") < 0)
296 ((FontInfoOTF *) font)->otf = NULL;
300 tag_name (script, spec->script);
301 tag_name (langsys, spec->langsys);
303 if (spec->gsub_count > 0)
305 gsub_features = alloca (6 * spec->gsub_count);
308 if (OTF_check_table (otf, "GSUB") < 0)
309 gsub_features = NULL;
311 encode_features (gsub_features, spec->gsub_count, spec->gsub);
314 if (spec->gpos_count)
316 gpos_features = alloca (6 * spec->gpos_count);
319 if (OTF_check_table (otf, "GPOS") < 0)
320 gpos_features = NULL;
322 encode_features (gpos_features, spec->gpos_count, spec->gpos);
326 otf_gstring.size = otf_gstring.used = len;
327 otf_gstring.glyphs = (OTF_Glyph *) malloc (sizeof (OTF_Glyph) * len);
328 memset (otf_gstring.glyphs, 0, sizeof (OTF_Glyph) * len);
329 for (i = 0; i < len; i++)
331 otf_gstring.glyphs[i].c = in->glyphs[from + i].c;
332 otf_gstring.glyphs[i].glyph_id = in->glyphs[from + i].code;
335 OTF_drive_gdef (otf, &otf_gstring);
340 if (OTF_drive_gsub (otf, &otf_gstring, script, langsys, gsub_features)
343 if (out->allocated < out->used + otf_gstring.used)
345 for (i = 0, otfg = otf_gstring.glyphs; i < otf_gstring.used; i++, otfg++)
347 MFLTGlyph *g = out->glyphs + out->used;
349 *g = in->glyphs[from + otfg->f.index.from];
351 g->code = otfg->glyph_id;
357 if (out->allocated < out->used + len)
359 for (i = 0; i < len; i++)
360 out->glyphs[out->used++] = in->glyphs[from + i];
363 font->get_metric (font, out, gidx, out->used);
368 MFLTGlyph *base = NULL, *mark = NULL, *g;
369 int x_ppem, y_ppem, x_scale, y_scale;
371 if (OTF_drive_gpos (otf, &otf_gstring, script, langsys, gpos_features)
375 face = ((FontInfo *) font)->face;
376 x_ppem = face->size->metrics.x_ppem;
377 y_ppem = face->size->metrics.y_ppem;
378 x_scale = face->size->metrics.x_scale;
379 y_scale = face->size->metrics.y_scale;
381 for (i = 0, otfg = otf_gstring.glyphs, g = out->glyphs + gidx;
382 i < otf_gstring.used; i++, otfg++, g++)
386 if (! otfg->glyph_id)
388 switch (otfg->positioning_type)
394 int format = otfg->f.f1.format;
396 if (format & OTF_XPlacement)
398 = otfg->f.f1.value->XPlacement * x_scale / 0x10000;
399 if (format & OTF_XPlaDevice)
401 += DEVICE_DELTA (otfg->f.f1.value->XPlaDevice, x_ppem);
402 if (format & OTF_YPlacement)
404 = - (otfg->f.f1.value->YPlacement * y_scale / 0x10000);
405 if (format & OTF_YPlaDevice)
407 -= DEVICE_DELTA (otfg->f.f1.value->YPlaDevice, y_ppem);
408 if (format & OTF_XAdvance)
410 += otfg->f.f1.value->XAdvance * x_scale / 0x10000;
411 if (format & OTF_XAdvDevice)
413 += DEVICE_DELTA (otfg->f.f1.value->XAdvDevice, x_ppem);
414 if (format & OTF_YAdvance)
416 += otfg->f.f1.value->YAdvance * y_scale / 0x10000;
417 if (format & OTF_YAdvDevice)
419 += DEVICE_DELTA (otfg->f.f1.value->YAdvDevice, y_ppem);
420 adjustment[i].set = 1;
424 /* Not yet supported. */
430 goto label_adjust_anchor;
431 default: /* i.e. case 6 */
438 int base_x, base_y, mark_x, mark_y;
440 base_x = otfg->f.f4.base_anchor->XCoordinate * x_scale / 0x10000;
441 base_y = otfg->f.f4.base_anchor->YCoordinate * y_scale / 0x10000;
442 mark_x = otfg->f.f4.mark_anchor->XCoordinate * x_scale / 0x10000;
443 mark_y = otfg->f.f4.mark_anchor->YCoordinate * y_scale / 0x10000;;
445 if (otfg->f.f4.base_anchor->AnchorFormat != 1)
446 adjust_anchor (otfg->f.f4.base_anchor, face, prev->code,
447 x_ppem, y_ppem, &base_x, &base_y);
448 if (otfg->f.f4.mark_anchor->AnchorFormat != 1)
449 adjust_anchor (otfg->f.f4.mark_anchor, face, g->code,
450 x_ppem, y_ppem, &mark_x, &mark_y);
451 adjustment[i].xoff = (base_x - mark_x);
452 adjustment[i].yoff = - (base_y - mark_y);
453 adjustment[i].back = (g - prev);
454 adjustment[i].set = 1;
457 if (otfg->GlyphClass == OTF_GlyphClass0)
459 else if (otfg->GlyphClass == OTF_GlyphClassMark)
465 free (otf_gstring.glyphs);
469 font->get_metric (font, in, from, to);
470 for (i = 0; i < len; i++)
472 MFLTGlyph *g = in->glyphs + (from + i);
474 out->glyphs[out->used++] = *g;
476 if (otf_gstring.glyphs)
477 free (otf_gstring.glyphs);
482 open_font (char *fontname, char **err)
484 FT_Face face = new_face (fontname, err);
485 FontInfoOTF *font_info;
489 font_info = malloc (sizeof (FontInfoOTF));
490 font_info->font.get_glyph_id = get_glyph_id;
491 font_info->font.get_metric = get_metric;
492 font_info->font.drive_otf = drive_otf;
493 font_info->face = face;
494 font_info->otf = OTF_open_ft_face (face);
495 return ((MFLTFont *) font_info);
499 close_font (MFLTFont *font)
501 FontInfoOTF *font_info = (FontInfoOTF *) font;
503 OTF_close (font_info->otf);
504 FT_Done_Face (font_info->face);
524 HB_StreamRec gdef_stream;
528 MPlist *otf_spec_cache;
532 convertStringToGlyphIndices (HB_Font font, const HB_UChar16 *string,
533 hb_uint32 length, HB_Glyph *glyphs,
534 hb_uint32 *numGlyphs, HB_Bool rightToLeft)
540 getGlyphAdvances (HB_Font font, const HB_Glyph *glyphs, hb_uint32 numGlyphs,
541 HB_Fixed *advances, int flags /*HB_ShaperFlag*/)
545 for (i = 0; i < numGlyphs; i++)
550 canRender (HB_Font font, const HB_UChar16 *string, hb_uint32 length)
556 getPointInOutline (HB_Font font, HB_Glyph glyph, int flags /*HB_ShaperFlag*/,
557 hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos,
560 FT_Face face = font->faceData;
563 if ((error = (HB_Error) FT_Load_Glyph (face, glyph, flags)))
565 if (face->glyph->format != ft_glyph_format_outline)
566 return (HB_Error) HB_Err_Invalid_GPOS_SubTable;
567 *nPoints = face->glyph->outline.n_points;
570 if (point > *nPoints)
571 return (HB_Error) HB_Err_Invalid_GPOS_SubTable;
573 *xpos = face->glyph->outline.points[point].x;
574 *ypos = face->glyph->outline.points[point].y;
580 getGlyphMetrics (HB_Font font, HB_Glyph glyph, HB_GlyphMetrics *metrics)
585 getFontMetric (HB_Font font, HB_FontMetric metric)
590 #define MAKE_TAG(name) ((((FT_ULong) (name)[0]) << 24) \
591 | (((FT_ULong) (name)[1]) << 16) \
592 | (((FT_ULong) (name)[2]) << 8) \
596 new_stream (FT_Face face, char *tagname, HB_Stream stream)
598 FT_ULong tag = MAKE_TAG (tagname);
602 if (! FT_IS_SFNT (face))
603 return HB_Err_Invalid_Argument;
605 if (FT_Load_Sfnt_Table (face, tag, 0, NULL, &len))
606 return HB_Err_Table_Missing;
609 return HB_Err_Out_Of_Memory;
610 if (FT_Load_Sfnt_Table (face, tag, 0, buf, &len))
613 return HB_Err_Table_Missing;
615 stream->base = (HB_Byte *) buf;
618 stream->cursor = NULL;
624 load_gdef (FontInfoHB *font_info)
628 if (! font_info->gdef_stream.base)
630 err = new_stream ((FT_Face) font_info->hb_font.faceData, "GDEF",
631 &font_info->gdef_stream);
632 if (err != HB_Err_Ok)
635 return HB_Load_GDEF_Table (&font_info->gdef_stream, &font_info->gdef);
639 load_gsub (FontInfoHB *font_info)
643 HB_LookupList *lookup_list;
646 if (! font_info->gdef)
648 if ((err = load_gdef (font_info)) != HB_Err_Ok)
651 err = new_stream ((FT_Face) font_info->hb_font.faceData, "GSUB", &stream);
652 if (err != HB_Err_Ok)
654 err = HB_Load_GSUB_Table (&stream, &font_info->gsub,
655 font_info->gdef, &font_info->gdef_stream);
657 lookup_list = &font_info->gsub->LookupList;
658 for (i = 0; i < lookup_list->LookupCount; i++)
659 lookup_list->Properties[i] = HB_GLYPH_PROPERTIES_UNKNOWN;
664 load_gpos (FontInfoHB *font_info)
668 HB_LookupList *lookup_list;
671 if (! font_info->gdef)
673 if ((err = load_gdef (font_info)) != HB_Err_Ok)
676 err = new_stream ((FT_Face) font_info->hb_font.faceData, "GPOS", &stream);
677 if (err != HB_Err_Ok)
679 err = HB_Load_GPOS_Table (&stream, &font_info->gpos,
680 font_info->gdef, &font_info->gdef_stream);
682 lookup_list = &font_info->gpos->LookupList;
683 for (i = 0; i < lookup_list->LookupCount; i++)
684 lookup_list->Properties[i] = HB_GLYPH_PROPERTIES_UNKNOWN;
688 const HB_FontClass hb_fontClass = {
689 convertStringToGlyphIndices, getGlyphAdvances, canRender,
690 getPointInOutline, getGlyphMetrics, getFontMetric
694 setup_features (int gsubp, FontInfoHB *font_info, MFLT_OTF_Spec *spec,
697 int count, preordered;
698 unsigned int *features;
699 FT_UShort script, langsys;
700 FT_UShort req_feature, index;
701 FT_UInt *feature_list;
707 if (! font_info->gsub)
709 if ((err = load_gsub (font_info)) != HB_Err_Ok)
712 if ((err = HB_GSUB_Select_Script (font_info->gsub, spec->script, &script))
717 if ((err = HB_GSUB_Select_Language (font_info->gsub, spec->langsys,
718 script, &langsys, &req_feature))
723 langsys = req_feature = 0xFFFF;
724 count = spec->gsub_count;
725 features = spec->gsub;
729 if (! font_info->gpos)
731 if ((err = load_gpos (font_info)) != HB_Err_Ok)
734 if ((err = HB_GPOS_Select_Script (font_info->gpos, spec->script, &script))
739 if ((err = HB_GPOS_Select_Language (font_info->gpos, spec->langsys,
740 script, &langsys, &req_feature))
745 langsys = req_feature = 0xFFFF;
746 count = spec->gpos_count;
747 features = spec->gpos;
750 for (preordered = 0; preordered < count; preordered++)
751 if (features[preordered] == 0)
754 ? HB_GSUB_Query_Features (font_info->gsub, script, langsys,
756 : HB_GPOS_Query_Features (font_info->gpos, script, langsys,
763 for (i = 0; feature_list[i]; i++);
766 info->indices = malloc (sizeof (FT_UShort) * ((req_feature != 0xFFFF) + i));
768 if (req_feature != 0xFFFF)
769 info->indices[i++] = req_feature;
770 for (j = 0; j < preordered; j++)
772 ? HB_GSUB_Select_Feature (font_info->gsub, features[j],
773 script, langsys, &index)
774 : HB_GPOS_Select_Feature (font_info->gpos, features[j],
775 script, langsys, &index)))
777 info->indices[i++] = index;
779 for (j = 0; feature_list[j]; j++)
781 for (k = preordered + 1; k < count; k++)
782 if (feature_list[j] == features[k])
786 ? HB_GSUB_Select_Feature (font_info->gsub, feature_list[j],
787 script, langsys, &index)
788 : HB_GPOS_Select_Feature (font_info->gpos, feature_list[j],
789 script, langsys, &index))
791 info->indices[i++] = index;
798 setup_otf_spec (MFLTFont *font, MFLT_OTF_Spec *spec)
800 FontInfoHB *font_info = (FontInfoHB *) font;
803 if (spec->gsub_count + spec->gpos_count == 0)
805 ginfo = mplist_get (font_info->otf_spec_cache, spec->sym);
807 return (ginfo->gsub.count + ginfo->gpos.count > 0 ? ginfo : NULL);
808 ginfo = calloc (1, sizeof (GsubGposInfo));
809 mplist_push (font_info->otf_spec_cache, spec->sym, ginfo);
810 if (setup_features (1, font_info, spec, &(ginfo->gsub)) != HB_Err_Ok)
812 if (setup_features (0, font_info, spec, &(ginfo->gpos)) != HB_Err_Ok)
818 drive_otf (MFLTFont *font, MFLT_OTF_Spec *spec,
819 MFLTGlyphString *in, int from, int to,
820 MFLTGlyphString *out, MFLTGlyphAdjustment *adjustment)
822 FontInfoHB *font_info = (FontInfoHB *) font;
827 HB_UShort *apply_order_save;
828 HB_UShort apply_count_save;
830 int gpos_applied = 0;
837 if (hb_buffer_new (&buf) != FT_Err_Ok)
839 for (i = from; i < to; i++)
841 if (hb_buffer_add_glyph (buf, in->glyphs[i].code, 0, i) != FT_Err_Ok)
844 ginfo = setup_otf_spec (font, spec);
847 if (ginfo->gsub.count > 0)
849 if (! font_info->gdef
850 && load_gdef (font_info) != HB_Err_Ok)
852 apply_order_save = font_info->gsub->FeatureList.ApplyOrder;
853 apply_count_save = font_info->gsub->FeatureList.ApplyCount;
855 font_info->gsub->FeatureList.ApplyOrder = ginfo->gsub.indices;
856 font_info->gsub->FeatureList.ApplyCount = ginfo->gsub.count;
857 err = HB_GSUB_Apply_String (font_info->gsub, buf);
858 if (err != HB_Err_Ok && err != HB_Err_Not_Covered)
860 if (out->used + buf->in_length > out->allocated)
864 if (ginfo->gpos.count > 0
865 && (font_info->gpos || load_gpos (font_info) == HB_Err_Ok))
869 apply_order_save = font_info->gsub->FeatureList.ApplyOrder;
870 apply_count_save = font_info->gsub->FeatureList.ApplyCount;
873 font_info->gpos->FeatureList.ApplyOrder = ginfo->gpos.indices;
874 font_info->gpos->FeatureList.ApplyCount = ginfo->gpos.count;
875 err = HB_GPOS_Apply_String (&font_info->hb_font, font_info->gpos,
876 FT_LOAD_DEFAULT, buf, FALSE, FALSE);
877 if (err == HB_Err_Ok)
883 font_info->gsub->FeatureList.ApplyOrder = apply_order_save;
884 font_info->gsub->FeatureList.ApplyCount = apply_count_save;
889 for (i = 0; i < buf->in_length; i++)
891 HB_GlyphItem hg = buf->in_string + i;
892 HB_Position pos = buf->positions + i;
895 out->glyphs[out->used] = in->glyphs[hg->cluster];
896 g = out->glyphs + out->used++;
897 if (g->code != hg->gindex)
898 g->c = 0, g->code = hg->gindex;
899 adjustment[i].set = gpos_applied;
902 adjustment[i].xadv = pos->x_advance;
903 adjustment[i].yadv = pos->y_advance;
904 adjustment[i].xoff = pos->x_pos;
905 adjustment[i].yoff = - pos->y_pos;
906 adjustment[i].back = pos->back;
907 adjustment[i].advance_is_absolute = pos->new_advance;
914 hb_buffer_free (buf);
915 for (i = 0; i < len; i++)
916 out->glyphs[out->used++] = in->glyphs[from + i];
921 open_font (char *fontname, char **err)
923 FT_Face face = new_face (fontname, err);
924 FontInfoHB *font_info;
928 font_info = calloc (1, sizeof (FontInfoHB));
929 font_info->font.get_glyph_id = get_glyph_id;
930 font_info->font.get_metric = get_metric;
931 font_info->font.drive_otf = drive_otf;
932 font_info->face = face;
933 font_info->hb_font.klass = &hb_fontClass;
934 font_info->hb_font.faceData = face;
935 font_info->hb_font.userData = NULL;
936 font_info->hb_font.x_ppem = face->size->metrics.x_ppem;
937 font_info->hb_font.x_scale = face->size->metrics.x_scale;
938 font_info->hb_font.y_scale = face->size->metrics.y_scale;
939 font_info->hb_font.y_ppem = face->size->metrics.y_ppem;
940 font_info->otf_spec_cache = mplist ();
941 return ((MFLTFont *) font_info);
945 close_font (MFLTFont *font)
947 FontInfoHB *font_info = (FontInfoHB *) font;
952 HB_Done_GDEF_Table (font_info->gdef);
953 free (font_info->gdef_stream.base);
956 HB_Done_GSUB_Table (font_info->gsub);
958 HB_Done_GPOS_Table (font_info->gpos);
959 FT_Done_Face ((FT_Face) (font_info->hb_font.faceData));
960 for (p = font_info->otf_spec_cache; mplist_key (p) != Mnil;
963 GsubGposInfo *ginfo = mplist_value (p);
965 if (ginfo->gsub.count > 0)
966 free (ginfo->gsub.indices);
967 if (ginfo->gpos.count > 0)
968 free (ginfo->gpos.indices);
970 m17n_object_unref (font_info->otf_spec_cache);
978 main (int argc, char **argv)
980 char *font_name, *flt_name;
988 fprintf (stderr, "Usage: flt FONT-NAME FLT-NAME < TEXT-FILE\n");
995 FT_Init_FreeType (&ft_library);
997 font = open_font (font_name, &err);
1000 fprintf (stderr, "Font error: %s: %s\n", argv[1], err);
1004 mt = mconv_decode_stream (msymbol ("utf-8"), stdin);
1005 len = mtext_len (mt);
1006 for (i = 0, j = mtext_character (mt, i, len, '\n'); i < len;
1007 i = j + 1, j = mtext_character (mt, i, len, '\n'))
1011 if (flt (mt, i, j, font, flt_name) < 0)
1013 fprintf (stderr, "Error in FLT processing.\n");
1017 m17n_object_unref (mt);