From: handa Date: Sun, 16 Sep 2007 10:42:35 +0000 (+0000) Subject: (mflt_find): Prototype adjusted. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=a7c26872b56cbe9846782bc3bdb6249dfb64d6f3;p=m17n%2Fm17n-lib.git (mflt_find): Prototype adjusted. (mflt_name): Extern it. --- diff --git a/src/m17n-flt.h b/src/m17n-flt.h index 12d2840..f8aa48d 100644 --- a/src/m17n-flt.h +++ b/src/m17n-flt.h @@ -74,14 +74,16 @@ struct _MFLTGlyph /***en Horizontal and vertical adjustments for the glyph positioning expressed in 26.6 fractional pixel format. */ int xoff, yoff; - /***en Flag to tell if the member is encoded into a glyph ID - of a font. */ + /***en Flag to tell if the member is already encoded into a + glyph ID of a font. */ unsigned encoded : 1; /***en Flag to tell if the metrics of the glyph (members thru ) are already calculated. */ unsigned measured : 1; /***en For m17n-lib's internal use only. */ unsigned internal : 30; + + /* Arbitrary data can follow. */ }; /***en @@ -167,11 +169,39 @@ typedef struct _MFLTFont MFLTFont; struct _MFLTFont { + /* Family name of the font. It may be #Mnil if the family name is + not important in finding a Font Layout Table suitable for the + font (for instance, in the case that the font is an OpenType + font). */ + MSymbol family; + + /* Horizontal and vertical font sizes in pixel per EM. */ int x_ppem, y_ppem; + + /* If the font is an OpenType font, MFLTFont->otf.sym must be #Mt, + and the other members must describe available GSUB/GPOS features + of the specific script and language system for which the font is + used. Otherwise, MFLTFont->spec.sym must be #Mnil. */ + MFLTOtfSpec otf; + + /* Callback function to get glyph IDs for glyphs between FROM + (inclusive) and TO (exclusive) of GSTRING. If member + of a glyph is zero, the member of the glyph is a character + code. The function must convert it to the glyph ID of FONT. */ int (*get_glyph_id) (MFLTFont *font, MFLTGlyphString *gstring, int form, int to); - int (*get_metric) (MFLTFont *font, MFLTGlyphString *gstring, int form, int to); - int (*suitable_p) (MFLTFont *font, MSymbol family, MFLTOtfSpec *spec); + + /* Callback function to get metrics of glyphs between FROM + (inclusive) and TO (exclusive) of GSTRING. If member + of a glyph is zero, the function must set members , , + , , , and of the glyph. */ + int (*get_metrics) (MFLTFont *font, MFLTGlyphString *gstring, + int form, int to); + + /* Callback function to apply OpenType features in SPEC to glyphs + between FROM (inclusive) and TO (exclusive) of IN. The resulting + glyphs should be appended to the tail of OUT. If OUT doesn't + have a room to store all resulting glyphs, it must return -2. */ int (*drive_otf) (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in, int from, int to, MFLTGlyphString *out, MFLTGlyphAdjustment *adjustment); @@ -182,7 +212,9 @@ typedef struct _MFLT MFLT; extern MFLT *mflt_get (char *name); -extern MFLT *mflt_find (MFLTGlyphString *gstring, int pos, MFLTFont *font); +extern MFLT *mflt_find (int c, MFLTFont *font); + +extern char *mflt_name (MFLT *flt); extern MCharTable *mflt_coverage (MFLT *flt);