From bcfb4b64b52122a25f81d0de058a4a0945e75411 Mon Sep 17 00:00:00 2001 From: handa Date: Fri, 17 Aug 2007 13:02:53 +0000 Subject: [PATCH] (struct _MFLTGlyphString): Member pointer renamed to user_data. (MFLTOtfSpec): Renamed from MFLT_OTF_Spec. (MFLTFont): Prototype of the member drive_otf adjusted. --- src/m17n-flt.h | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 71 insertions(+), 7 deletions(-) diff --git a/src/m17n-flt.h b/src/m17n-flt.h index 44a9db5..cd0bcec 100644 --- a/src/m17n-flt.h +++ b/src/m17n-flt.h @@ -47,50 +47,114 @@ extern void m17n_fini_flt (void); /*** @ingroup m17nFLT */ +/***en + @brief Type of information about a glyph. + + The type #MFLTGlyph is the structure that contains information + about a glyph. It is used as an argument to mflt_run (). */ + typedef struct _MFLTGlyph MFLTGlyph; struct _MFLTGlyph { + /***en Character code (Unicode) of the glyph. This is the sole + member to be set before calling the function mflt_run (). */ int c; + /***en Glyph-id of the font of the glyph. */ unsigned int code; + /***en Glyph indices indicating to which original glyphs the glyph + corresonds. */ int from, to; + /***en Ink metrics of the glyph expressed in 26.6 fractional pixel + format. */ int ascent, descent, lbearing, rbearing; - int xadv, yadv, xoff, yoff; + /***en Advance width for horizontal layout and advance height for + vertical layout expressed in 26.6 fractional pixel format. */ + int xadv, yadv; + /***en Horizontal and vertical adjustments for the glyph positioning + expressed in 26.6 fractional pixel format. */ + int xoff, yoff; + /***en For m17n-lib's internal use only. */ unsigned int internal; }; +/***en + @brief Type of information about a glyph position adjustment. + + The type #MFLTGlyphAdjustment is the structure that contains + information about a glyph position adjustment. It is used as an + argument to the callback function #drive_otf of #MFLTFont. */ + typedef struct _MFLTGlyphAdjustment MFLTGlyphAdjustment; struct _MFLTGlyphAdjustment { - int xadv, yadv, xoff, yoff; + /***en Adjustments advance width for horizontal layout and advance + height for vertical layout expressed in 26.6 fractional pixel + format. */ + int xadv, yadv; + /***en Horizontal and vertical adjustment for a glyph positioning + expressed in 26.6 fractional pixel format. */ + int xoff, yoff; + /***en Number of glyphs to go back for drawing a glyph. */ short back; + /***en If nonzero, the member #xadv and #yadv are absolute, i.e., + they should not be added to a glyph's origianl advance width and + height. */ unsigned advance_is_absolute : 1; + /***en If nonzero, at least one of the other members has a nonzero + value. */ unsigned set : 1; }; +/***en + @brief Type of information about a glyph sequence. + + The type #MFLTGlyphString is the structure that contains + information about a sequence of glyphs. It is used as an argument + to the callback function #drive_otf of #MFLTFont. */ + typedef struct _MFLTGlyphString MFLTGlyphString; struct _MFLTGlyphString { + /***en The actual byte size of elements of the array pointed by the + member #glyphs. */ int glyph_size; + /***en Array of glyphs. The byte size of elements may be bigger + than the byte size of the type #MFLTGlyph. */ MFLTGlyph *glyphs; + /***en Memory for how many elements is allocated in #glyphs. */ int allocated; + /***en How many elements in #glyphs are in use. */ int used; - void *pointer; + /***en A field reserved for client uses. */ + void *user_data; }; -typedef struct _MFLT_OTF_Spec MFLT_OTF_Spec; +/***en + @brief Type of information about GSUB/GPOS features of OTF. + + The type #MFLTOtfSpec is the structure that contains information + about GSUB and GPOS features to be applied to a glyph sequence. */ + +typedef struct _MFLTOtfSpec MFLTOtfSpec; -struct _MFLT_OTF_Spec +struct _MFLTOtfSpec { + /***en Symbol representing the spec. This is the same as the + #OTF-SPEC of the FLT. */ MSymbol sym; + /***en Tags for script and langsys. */ unsigned int script, langsys; + /***en Number of GSUB features stored in the member #gsub. */ int gsub_count; + /***en Array of tags of GSUB features. */ unsigned int *gsub; + /***en Number of GPOS features stored in the member #gpos. */ int gpos_count; + /***en Array of tags of GPOS features. */ unsigned int *gpos; - void *pointer; }; typedef struct _MFLTFont MFLTFont; @@ -100,7 +164,7 @@ struct _MFLTFont int x_ppem, y_ppem; int (*get_glyph_id) (MFLTFont *font, MFLTGlyph *g); int (*get_metric) (MFLTFont *font, MFLTGlyphString *gstring, int form, int to); - int (*drive_otf) (MFLTFont *font, MFLT_OTF_Spec *spec, + int (*drive_otf) (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in, int from, int to, MFLTGlyphString *out, MFLTGlyphAdjustment *adjustment); /* Arbitrary data can follow. */ -- 1.7.10.4