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_check_features (otf, 1,
372 spec->script, spec->langsys,
373 spec->gpos, spec->gpos_count) != 1
374 || (OTF_drive_gpos (otf, &otf_gstring, script, langsys,
378 face = ((FontInfo *) font)->face;
379 x_ppem = face->size->metrics.x_ppem;
380 y_ppem = face->size->metrics.y_ppem;
381 x_scale = face->size->metrics.x_scale;
382 y_scale = face->size->metrics.y_scale;
384 for (i = 0, otfg = otf_gstring.glyphs, g = out->glyphs + gidx;
385 i < otf_gstring.used; i++, otfg++, g++)
389 if (! otfg->glyph_id)
391 switch (otfg->positioning_type)
397 int format = otfg->f.f1.format;
399 if (format & OTF_XPlacement)
401 = otfg->f.f1.value->XPlacement * x_scale / 0x10000;
402 if (format & OTF_XPlaDevice)
404 += DEVICE_DELTA (otfg->f.f1.value->XPlaDevice, x_ppem);
405 if (format & OTF_YPlacement)
407 = - (otfg->f.f1.value->YPlacement * y_scale / 0x10000);
408 if (format & OTF_YPlaDevice)
410 -= DEVICE_DELTA (otfg->f.f1.value->YPlaDevice, y_ppem);
411 if (format & OTF_XAdvance)
413 += otfg->f.f1.value->XAdvance * x_scale / 0x10000;
414 if (format & OTF_XAdvDevice)
416 += DEVICE_DELTA (otfg->f.f1.value->XAdvDevice, x_ppem);
417 if (format & OTF_YAdvance)
419 += otfg->f.f1.value->YAdvance * y_scale / 0x10000;
420 if (format & OTF_YAdvDevice)
422 += DEVICE_DELTA (otfg->f.f1.value->YAdvDevice, y_ppem);
423 adjustment[i].set = 1;
427 /* Not yet supported. */
433 goto label_adjust_anchor;
434 default: /* i.e. case 6 */
441 int base_x, base_y, mark_x, mark_y;
443 base_x = otfg->f.f4.base_anchor->XCoordinate * x_scale / 0x10000;
444 base_y = otfg->f.f4.base_anchor->YCoordinate * y_scale / 0x10000;
445 mark_x = otfg->f.f4.mark_anchor->XCoordinate * x_scale / 0x10000;
446 mark_y = otfg->f.f4.mark_anchor->YCoordinate * y_scale / 0x10000;;
448 if (otfg->f.f4.base_anchor->AnchorFormat != 1)
449 adjust_anchor (otfg->f.f4.base_anchor, face, prev->code,
450 x_ppem, y_ppem, &base_x, &base_y);
451 if (otfg->f.f4.mark_anchor->AnchorFormat != 1)
452 adjust_anchor (otfg->f.f4.mark_anchor, face, g->code,
453 x_ppem, y_ppem, &mark_x, &mark_y);
454 adjustment[i].xoff = (base_x - mark_x);
455 adjustment[i].yoff = - (base_y - mark_y);
456 adjustment[i].back = (g - prev);
457 adjustment[i].set = 1;
460 if (otfg->GlyphClass == OTF_GlyphClass0)
462 else if (otfg->GlyphClass == OTF_GlyphClassMark)
468 free (otf_gstring.glyphs);
472 font->get_metric (font, in, from, to);
473 for (i = 0; i < len; i++)
475 MFLTGlyph *g = in->glyphs + (from + i);
477 out->glyphs[out->used++] = *g;
479 if (otf_gstring.glyphs)
480 free (otf_gstring.glyphs);
485 open_font (char *fontname, char **err)
487 FT_Face face = new_face (fontname, err);
488 FontInfoOTF *font_info;
492 font_info = malloc (sizeof (FontInfoOTF));
493 font_info->font.get_glyph_id = get_glyph_id;
494 font_info->font.get_metric = get_metric;
495 font_info->font.drive_otf = drive_otf;
496 font_info->face = face;
497 font_info->otf = OTF_open_ft_face (face);
498 return ((MFLTFont *) font_info);
502 close_font (MFLTFont *font)
504 FontInfoOTF *font_info = (FontInfoOTF *) font;
506 OTF_close (font_info->otf);
507 FT_Done_Face (font_info->face);
527 HB_StreamRec gdef_stream;
531 MPlist *otf_spec_cache;
535 convertStringToGlyphIndices (HB_Font font, const HB_UChar16 *string,
536 hb_uint32 length, HB_Glyph *glyphs,
537 hb_uint32 *numGlyphs, HB_Bool rightToLeft)
543 getGlyphAdvances (HB_Font font, const HB_Glyph *glyphs, hb_uint32 numGlyphs,
544 HB_Fixed *advances, int flags /*HB_ShaperFlag*/)
548 for (i = 0; i < numGlyphs; i++)
553 canRender (HB_Font font, const HB_UChar16 *string, hb_uint32 length)
559 getPointInOutline (HB_Font font, HB_Glyph glyph, int flags /*HB_ShaperFlag*/,
560 hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos,
563 FT_Face face = font->faceData;
566 if ((error = (HB_Error) FT_Load_Glyph (face, glyph, flags)))
568 if (face->glyph->format != ft_glyph_format_outline)
569 return (HB_Error) HB_Err_Invalid_GPOS_SubTable;
570 *nPoints = face->glyph->outline.n_points;
573 if (point > *nPoints)
574 return (HB_Error) HB_Err_Invalid_GPOS_SubTable;
576 *xpos = face->glyph->outline.points[point].x;
577 *ypos = face->glyph->outline.points[point].y;
583 getGlyphMetrics (HB_Font font, HB_Glyph glyph, HB_GlyphMetrics *metrics)
588 getFontMetric (HB_Font font, HB_FontMetric metric)
593 #define MAKE_TAG(name) ((((FT_ULong) (name)[0]) << 24) \
594 | (((FT_ULong) (name)[1]) << 16) \
595 | (((FT_ULong) (name)[2]) << 8) \
599 new_stream (FT_Face face, char *tagname, HB_Stream stream)
601 FT_ULong tag = MAKE_TAG (tagname);
605 if (! FT_IS_SFNT (face))
606 return HB_Err_Invalid_Argument;
608 if (FT_Load_Sfnt_Table (face, tag, 0, NULL, &len))
609 return HB_Err_Table_Missing;
612 return HB_Err_Out_Of_Memory;
613 if (FT_Load_Sfnt_Table (face, tag, 0, buf, &len))
616 return HB_Err_Table_Missing;
618 stream->base = (HB_Byte *) buf;
621 stream->cursor = NULL;
627 load_gdef (FontInfoHB *font_info)
631 if (! font_info->gdef_stream.base)
633 err = new_stream ((FT_Face) font_info->hb_font.faceData, "GDEF",
634 &font_info->gdef_stream);
635 if (err != HB_Err_Ok)
638 return HB_Load_GDEF_Table (&font_info->gdef_stream, &font_info->gdef);
642 load_gsub (FontInfoHB *font_info)
646 HB_LookupList *lookup_list;
649 if (! font_info->gdef)
651 if ((err = load_gdef (font_info)) != HB_Err_Ok)
654 err = new_stream ((FT_Face) font_info->hb_font.faceData, "GSUB", &stream);
655 if (err != HB_Err_Ok)
657 err = HB_Load_GSUB_Table (&stream, &font_info->gsub,
658 font_info->gdef, &font_info->gdef_stream);
660 lookup_list = &font_info->gsub->LookupList;
661 for (i = 0; i < lookup_list->LookupCount; i++)
662 lookup_list->Properties[i] = HB_GLYPH_PROPERTIES_UNKNOWN;
667 load_gpos (FontInfoHB *font_info)
671 HB_LookupList *lookup_list;
674 if (! font_info->gdef)
676 if ((err = load_gdef (font_info)) != HB_Err_Ok)
679 err = new_stream ((FT_Face) font_info->hb_font.faceData, "GPOS", &stream);
680 if (err != HB_Err_Ok)
682 err = HB_Load_GPOS_Table (&stream, &font_info->gpos,
683 font_info->gdef, &font_info->gdef_stream);
685 lookup_list = &font_info->gpos->LookupList;
686 for (i = 0; i < lookup_list->LookupCount; i++)
687 lookup_list->Properties[i] = HB_GLYPH_PROPERTIES_UNKNOWN;
691 const HB_FontClass hb_fontClass = {
692 convertStringToGlyphIndices, getGlyphAdvances, canRender,
693 getPointInOutline, getGlyphMetrics, getFontMetric
697 setup_features (int gsubp, FontInfoHB *font_info, MFLT_OTF_Spec *spec,
700 int count, preordered;
701 unsigned int *features;
702 FT_UShort script, langsys;
703 FT_UShort req_feature, index;
704 FT_UInt *feature_list;
710 if (! font_info->gsub)
712 if ((err = load_gsub (font_info)) != HB_Err_Ok)
715 if ((err = HB_GSUB_Select_Script (font_info->gsub, spec->script, &script))
720 if ((err = HB_GSUB_Select_Language (font_info->gsub, spec->langsys,
721 script, &langsys, &req_feature))
726 langsys = req_feature = 0xFFFF;
727 count = spec->gsub_count;
728 features = spec->gsub;
732 if (! font_info->gpos)
734 if ((err = load_gpos (font_info)) != HB_Err_Ok)
737 if ((err = HB_GPOS_Select_Script (font_info->gpos, spec->script, &script))
742 if ((err = HB_GPOS_Select_Language (font_info->gpos, spec->langsys,
743 script, &langsys, &req_feature))
748 langsys = req_feature = 0xFFFF;
749 count = spec->gpos_count;
750 features = spec->gpos;
753 for (preordered = 0; preordered < count; preordered++)
754 if (features[preordered] == 0)
757 ? HB_GSUB_Query_Features (font_info->gsub, script, langsys,
759 : HB_GPOS_Query_Features (font_info->gpos, script, langsys,
766 for (i = 0; feature_list[i]; i++);
769 info->indices = malloc (sizeof (FT_UShort) * ((req_feature != 0xFFFF) + i));
771 if (req_feature != 0xFFFF)
772 info->indices[i++] = req_feature;
773 for (j = 0; j < preordered; j++)
776 ? HB_GSUB_Select_Feature (font_info->gsub, features[j],
777 script, langsys, &index)
778 : HB_GPOS_Select_Feature (font_info->gpos, features[j],
779 script, langsys, &index)))
782 info->indices[i++] = index;
785 for (j = 0; feature_list[j]; j++)
787 for (k = preordered + 1; k < count; k++)
788 if (feature_list[j] == features[k])
793 ? HB_GSUB_Select_Feature (font_info->gsub, feature_list[j],
794 script, langsys, &index)
795 : HB_GPOS_Select_Feature (font_info->gpos, feature_list[j],
796 script, langsys, &index))
799 info->indices[i++] = index;
807 setup_otf_spec (MFLTFont *font, MFLT_OTF_Spec *spec)
809 FontInfoHB *font_info = (FontInfoHB *) font;
812 if (spec->gsub_count + spec->gpos_count == 0)
814 ginfo = mplist_get (font_info->otf_spec_cache, spec->sym);
816 return (ginfo->gsub.count + ginfo->gpos.count > 0 ? ginfo : NULL);
817 ginfo = calloc (1, sizeof (GsubGposInfo));
818 mplist_push (font_info->otf_spec_cache, spec->sym, ginfo);
819 if (setup_features (1, font_info, spec, &(ginfo->gsub)) != HB_Err_Ok)
821 if (setup_features (0, font_info, spec, &(ginfo->gpos)) != HB_Err_Ok)
827 drive_otf (MFLTFont *font, MFLT_OTF_Spec *spec,
828 MFLTGlyphString *in, int from, int to,
829 MFLTGlyphString *out, MFLTGlyphAdjustment *adjustment)
831 FontInfoHB *font_info = (FontInfoHB *) font;
836 HB_UShort *apply_order_save;
837 HB_UShort apply_count_save;
839 int gpos_applied = 0;
846 if (hb_buffer_new (&buf) != FT_Err_Ok)
848 for (i = from; i < to; i++)
850 if (hb_buffer_add_glyph (buf, in->glyphs[i].code, 0, i) != FT_Err_Ok)
853 ginfo = setup_otf_spec (font, spec);
856 if (ginfo->gsub.count > 0)
858 if (! font_info->gdef
859 && load_gdef (font_info) != HB_Err_Ok)
861 apply_order_save = font_info->gsub->FeatureList.ApplyOrder;
862 apply_count_save = font_info->gsub->FeatureList.ApplyCount;
864 font_info->gsub->FeatureList.ApplyOrder = ginfo->gsub.indices;
865 font_info->gsub->FeatureList.ApplyCount = ginfo->gsub.count;
866 err = HB_GSUB_Apply_String (font_info->gsub, buf);
867 if (err != HB_Err_Ok && err != HB_Err_Not_Covered)
869 if (out->used + buf->in_length > out->allocated)
873 if (ginfo->gpos.count > 0
874 && (font_info->gpos || load_gpos (font_info) == HB_Err_Ok))
878 apply_order_save = font_info->gsub->FeatureList.ApplyOrder;
879 apply_count_save = font_info->gsub->FeatureList.ApplyCount;
882 font_info->gpos->FeatureList.ApplyOrder = ginfo->gpos.indices;
883 font_info->gpos->FeatureList.ApplyCount = ginfo->gpos.count;
884 err = HB_GPOS_Apply_String (&font_info->hb_font, font_info->gpos,
885 FT_LOAD_DEFAULT, buf, FALSE, FALSE);
886 if (err == HB_Err_Ok)
892 font_info->gsub->FeatureList.ApplyOrder = apply_order_save;
893 font_info->gsub->FeatureList.ApplyCount = apply_count_save;
898 for (i = 0; i < buf->in_length; i++)
900 HB_GlyphItem hg = buf->in_string + i;
901 HB_Position pos = buf->positions + i;
904 out->glyphs[out->used] = in->glyphs[hg->cluster];
905 g = out->glyphs + out->used++;
906 if (g->code != hg->gindex)
907 g->c = 0, g->code = hg->gindex;
908 adjustment[i].set = gpos_applied;
911 adjustment[i].xadv = pos->x_advance;
912 adjustment[i].yadv = pos->y_advance;
913 adjustment[i].xoff = pos->x_pos;
914 adjustment[i].yoff = - pos->y_pos;
915 adjustment[i].back = pos->back;
916 adjustment[i].advance_is_absolute = pos->new_advance;
923 hb_buffer_free (buf);
924 for (i = 0; i < len; i++)
925 out->glyphs[out->used++] = in->glyphs[from + i];
930 open_font (char *fontname, char **err)
932 FT_Face face = new_face (fontname, err);
933 FontInfoHB *font_info;
937 font_info = calloc (1, sizeof (FontInfoHB));
938 font_info->font.get_glyph_id = get_glyph_id;
939 font_info->font.get_metric = get_metric;
940 font_info->font.drive_otf = drive_otf;
941 font_info->face = face;
942 font_info->hb_font.klass = &hb_fontClass;
943 font_info->hb_font.faceData = face;
944 font_info->hb_font.userData = NULL;
945 font_info->hb_font.x_ppem = face->size->metrics.x_ppem;
946 font_info->hb_font.x_scale = face->size->metrics.x_scale;
947 font_info->hb_font.y_scale = face->size->metrics.y_scale;
948 font_info->hb_font.y_ppem = face->size->metrics.y_ppem;
949 font_info->otf_spec_cache = mplist ();
950 return ((MFLTFont *) font_info);
954 close_font (MFLTFont *font)
956 FontInfoHB *font_info = (FontInfoHB *) font;
961 HB_Done_GDEF_Table (font_info->gdef);
962 free (font_info->gdef_stream.base);
965 HB_Done_GSUB_Table (font_info->gsub);
967 HB_Done_GPOS_Table (font_info->gpos);
968 FT_Done_Face ((FT_Face) (font_info->hb_font.faceData));
969 for (p = font_info->otf_spec_cache; mplist_key (p) != Mnil;
972 GsubGposInfo *ginfo = mplist_value (p);
974 if (ginfo->gsub.count > 0)
975 free (ginfo->gsub.indices);
976 if (ginfo->gpos.count > 0)
977 free (ginfo->gpos.indices);
979 m17n_object_unref (font_info->otf_spec_cache);
987 main (int argc, char **argv)
989 char *font_name, *flt_name;
997 fprintf (stderr, "Usage: flt FONT-NAME FLT-NAME < TEXT-FILE\n");
1001 font_name = argv[1];
1004 FT_Init_FreeType (&ft_library);
1006 font = open_font (font_name, &err);
1009 fprintf (stderr, "Font error: %s: %s\n", argv[1], err);
1013 mt = mconv_decode_stream (msymbol ("utf-8"), stdin);
1014 len = mtext_len (mt);
1015 for (i = 0, j = mtext_character (mt, i, len, '\n'); i < len;
1016 i = j + 1, j = mtext_character (mt, i, len, '\n'))
1020 if (flt (mt, i, j, font, flt_name) < 0)
1022 fprintf (stderr, "Error in FLT processing.\n");
1026 m17n_object_unref (mt);