.\" Copyright (C) 2001 Information-technology Promotion Agency (IPA)
.\" Copyright (C) 2001-2009
.\"   National Institute of Advanced Industrial Science and Technology (AIST)
.\" This file is part of the m17n library documentation.
.\" Permission is granted to copy, distribute and/or modify this document
.\" under the terms of the GNU Free Documentation License, Version 1.2 or
.\" any later version published by the Free Software Foundation; with no
.\" Invariant Section, no Front-Cover Texts,
.\" and no Back-Cover Texts.  A copy of the license is included in the
.\" appendix entitled "GNU Free Documentation License".
.TH "FLT API" 3m17n "15 Oct 2009" "" "Version 1.5.5" "" "The m17n Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
FLT API \- API provided by libm17n\-flt.so.  

.PP
.SS "Data Structures"

.in +1c
.ti -1c
.RI "struct \fBMFLTGlyph\fP"
.br
.RI "\fIType of information about a glyph. \fP"
.ti -1c
.RI "struct \fBMFLTGlyphAdjustment\fP"
.br
.RI "\fIType of information about a glyph position adjustment. \fP"
.ti -1c
.RI "struct \fBMFLTGlyphString\fP"
.br
.RI "\fIType of information about a glyph sequence. \fP"
.ti -1c
.RI "struct \fBMFLTOtfSpec\fP"
.br
.RI "\fIType of specification of GSUB and GPOS OpenType tables. \fP"
.ti -1c
.RI "struct \fBMFLTFont\fP"
.br
.RI "\fIType of font to be used by the FLT driver. \fP"
.in -1c
.SS "Typedefs"

.in +1c
.ti -1c
.RI "typedef struct _MFLT \fBMFLT\fP"
.br
.RI "\fIType of FLT (Font Layout Table). \fP"
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "\fBMFLT\fP * \fBmflt_get\fP (\fBMSymbol\fP name)"
.br
.RI "\fIReturn an FLT object that has a specified name. \fP"
.ti -1c
.RI "\fBMFLT\fP * \fBmflt_find\fP (int c, \fBMFLTFont\fP *font)"
.br
.RI "\fIFind an FLT suitable for the specified character and font. \fP"
.ti -1c
.RI "const char * \fBmflt_name\fP (\fBMFLT\fP *flt)"
.br
.RI "\fIReturn the name of an FLT. \fP"
.ti -1c
.RI "\fBMCharTable\fP * \fBmflt_coverage\fP (\fBMFLT\fP *flt)"
.br
.RI "\fIReturn a coverage of a FLT. \fP"
.ti -1c
.RI "int \fBmflt_run\fP (\fBMFLTGlyphString\fP *gstring, int from, int to, \fBMFLTFont\fP *font, \fBMFLT\fP *flt)"
.br
.RI "\fILayout characters with an FLT. \fP"
.ti -1c
.RI "\fBMFLT\fP * \fBmdebug_dump_flt\fP (\fBMFLT\fP *flt, int indent)"
.br
.RI "\fIDump a Font Layout Table. \fP"
.in -1c
.SS "Variables"

.in +1c
.ti -1c
.RI "\fBMSymbol\fP(* \fBmflt_font_id\fP )(struct _MFLTFont *font)"
.br
.ti -1c
.RI "int(* \fBmflt_iterate_otf_feature\fP )(struct _MFLTFont *font, \fBMFLTOtfSpec\fP *spec, int from, int to, unsigned char *table)"
.br
.ti -1c
.RI "int(* \fBmflt_iterate_otf_feature\fP )(struct _MFLTFont *font, \fBMFLTOtfSpec\fP *spec, int from, int to, unsigned char *table)"
.br
.ti -1c
.RI "\fBMSymbol\fP(* \fBmflt_font_id\fP )(struct _MFLTFont *font)"
.br
.in -1c
.SH "Detailed Description"
.PP 
API provided by libm17n\-flt.so. 
.PP
FLT support for a window system.
.PP
This section defines the m17n FLT API concerning character layouting facility using FLT (Font Layout Table). The format of FLT is described in \fBmdbFLT\fP. 
.SH "Data Structure Documentation"
.SS MFLTGlyph
.PP
Type of information about a glyph.  

.PP
.ad l
.nh
.PP
\fBFIELD DOCUMENTATION:\fP
.PP 
.PP
\fBint \fBMFLTGlyph::c\fP\fP
.PP
Character code (Unicode) of the glyph. This is the sole member to be set before calling the functions \fBmflt_find()\fP and \fBmflt_run()\fP. 
.PP
\fBunsigned int \fBMFLTGlyph::code\fP\fP
.PP
Glyph ID of the glyph in the font. 
.PP
\fBint \fBMFLTGlyph::from\fP\fP
.PP
Starting index of the run in \fBMFLTGlyphString\fP that is replaced by this glyph. 
.PP
\fBint \fBMFLTGlyph::to\fP\fP
.PP
Ending index of the run in \fBMFLTGlyphString\fP that is replaced by this glyph. 
.PP
\fBint \fBMFLTGlyph::xadv\fP\fP
.PP
Advance width for horizontal layout expressed in 26.6 fractional pixel format. 
.PP
\fBint \fBMFLTGlyph::yadv\fP\fP
.PP
Advance height for vertical layout expressed in 26.6 fractional pixel format. 
.PP
\fBint \fBMFLTGlyph::ascent\fP\fP
.PP
Ink metrics of the glyph expressed in 26.6 fractional pixel format. 
.PP
\fBint \fBMFLTGlyph::descent\fP\fP
.PP
.PP
\fBint \fBMFLTGlyph::lbearing\fP\fP
.PP
.PP
\fBint \fBMFLTGlyph::rbearing\fP\fP
.PP
.PP
\fBint \fBMFLTGlyph::xoff\fP\fP
.PP
Horizontal and vertical adjustments for the glyph positioning expressed in 26.6 fractional pixel format. 
.PP
\fBint \fBMFLTGlyph::yoff\fP\fP
.PP
.PP
\fBunsigned \fBMFLTGlyph::encoded\fP\fP
.PP
Flag to tell whether the member <code> has already been set to a glyph ID in the font. 
.PP
\fBunsigned \fBMFLTGlyph::measured\fP\fP
.PP
Flag to tell if the metrics of the glyph (members <xadv> thru <rbearing>) are already calculated. 
.PP
\fBunsigned \fBMFLTGlyph::adjusted\fP\fP
.PP
Flag to tell if the metrics of the glyph is adjusted, i.e. <xadv> or <yadv> is different from the normal size, or <xoff> or <yoff> is nonzero. 

.SS MFLTGlyphAdjustment
.PP
Type of information about a glyph position adjustment.  

.PP
.ad l
.nh
.PP
\fBFIELD DOCUMENTATION:\fP
.PP 
.PP
\fBint \fBMFLTGlyphAdjustment::xadv\fP\fP
.PP
Adjustments for advance width for horizontal layout and advance height for vertical layout expressed in 26.6 fractional pixel format. 
.PP
\fBint \fBMFLTGlyphAdjustment::yadv\fP\fP
.PP
.PP
\fBint \fBMFLTGlyphAdjustment::xoff\fP\fP
.PP
Horizontal and vertical adjustments for glyph positioning expressed in 26.6 fractional pixel format. 
.PP
\fBint \fBMFLTGlyphAdjustment::yoff\fP\fP
.PP
.PP
\fBshort \fBMFLTGlyphAdjustment::back\fP\fP
.PP
Number of glyphs to go back for drawing a glyph. 
.PP
\fBunsigned \fBMFLTGlyphAdjustment::advance_is_absolute\fP\fP
.PP
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. 
.PP
\fBunsigned \fBMFLTGlyphAdjustment::set\fP\fP
.PP
Should be set to 1 iff at least one of the other members has a nonzero value. 

.SS MFLTGlyphString
.PP
Type of information about a glyph sequence.  

.PP
.ad l
.nh
.PP
\fBFIELD DOCUMENTATION:\fP
.PP 
.PP
\fBint \fBMFLTGlyphString::glyph_size\fP\fP
.PP
The actual byte size of elements of the array pointed by the member \fBglyphs\fP. It must be equal to or greater than 'sizeof (\fBMFLTGlyph\fP)'. 
.PP
\fB\fBMFLTGlyph\fP* \fBMFLTGlyphString::glyphs\fP\fP
.PP
Array of glyphs. 
.PP
\fBint \fBMFLTGlyphString::allocated\fP\fP
.PP
Number of elements allocated in \fBglyphs\fP. 
.PP
\fBint \fBMFLTGlyphString::used\fP\fP
.PP
Number of elements in \fBglyphs\fP in use. 
.PP
\fBunsigned int \fBMFLTGlyphString::r2l\fP\fP
.PP
Flag to tell if the glyphs should be drawn from right\-to\-left or not. 

.SS MFLTOtfSpec
.PP
Type of specification of GSUB and GPOS OpenType tables.  

.PP
.ad l
.nh
.PP
\fBFIELD DOCUMENTATION:\fP
.PP 
.PP
\fB\fBMSymbol\fP \fBMFLTOtfSpec::sym\fP\fP
.PP
Unique symbol representing the spec. This is the same as the \fBOTF\-SPEC\fP of the FLT. 
.PP
\fBunsigned int \fBMFLTOtfSpec::script\fP\fP
.PP
Tags for script and language system. 
.PP
\fBunsigned int \fBMFLTOtfSpec::langsys\fP\fP
.PP
.PP
\fBunsigned int* \fBMFLTOtfSpec::features\fP[2]\fP
.PP
Array of GSUB (1st element) and GPOS (2nd element) features. Each array is terminated by 0. If an element is 0xFFFFFFFF apply the previous features in that order, and apply all the other features except those that appear in the following elements. It may be NULL if there are no features. 

.SS MFLTFont
.PP
Type of font to be used by the FLT driver.  

.PP
.ad l
.nh
.PP
\fBFIELD DOCUMENTATION:\fP
.PP 
.PP
\fB\fBMSymbol\fP \fBMFLTFont::family\fP\fP
.PP
Family name of the font. It may be \fBMnil\fP 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). 
.PP
\fBint \fBMFLTFont::x_ppem\fP\fP
.PP
Horizontal font sizes in pixels per EM. 
.PP
\fBint \fBMFLTFont::y_ppem\fP\fP
.PP
Vertical font sizes in pixels per EM. 
.PP
\fBint(* \fBMFLTFont::get_glyph_id\fP)(struct _MFLTFont *font, \fBMFLTGlyphString\fP *gstring, int from, int to)\fP
.PP
Callback function to get glyph IDs for glyphs between FROM (inclusive) and TO (exclusive) of GSTRING. If the member <encoded> of a glyph is zero, the member <code> of that glyph is a character code. The function must convert it to the glyph ID of FONT. 
.PP
\fBint(* \fBMFLTFont::get_metrics\fP)(struct _MFLTFont *font, \fBMFLTGlyphString\fP *gstring, int from, int to)\fP
.PP
Callback function to get metrics of glyphs between FROM (inclusive) and TO (exclusive) of GSTRING. If the member <measured> of a glyph is zero, the function must set the members <xadv>, <yadv>, <ascent>, <descent>, <lbearing>, and <rbearing> of the glyph. 
.PP
\fBint(* \fBMFLTFont::check_otf\fP)(struct _MFLTFont *font, \fBMFLTOtfSpec\fP *spec)\fP
.PP
Callback function to check if the font has OpenType GSUB/GPOS features for a specific script/language. The function must return 1, if the font satisfies SPEC, or 0. It must be NULL if the font does not have OpenType tables. 
.PP
\fBint(* \fBMFLTFont::drive_otf\fP)(struct _MFLTFont *font, \fBMFLTOtfSpec\fP *spec, \fBMFLTGlyphString\fP *in, int from, int to, \fBMFLTGlyphString\fP *out, \fBMFLTGlyphAdjustment\fP *adjustment)\fP
.PP
Callback function to apply OpenType features in SPEC to glyphs between FROM (inclusive) and TO (exclusive) of IN. The resulting glyphs are appended to the tail of OUT. If OUT does not have a room to store all the resulting glyphs, it must return \-2. It must be NULL if the font does not have OpenType tables. 
.PP
\fBvoid* \fBMFLTFont::internal\fP\fP
.PP
For m17n\-lib's internal use only. It should be initialized to NULL. 

.SH "Typedef Documentation"
.PP 
.SS "typedef struct _MFLT \fBMFLT\fP"
.PP
Type of FLT (Font Layout Table). 
.PP
The type \fBMFLT\fP is for an FLT object. Its internal structure is concealed from application programs. 
.SH "Variable Documentation"
.PP 
.SS "\fBMSymbol\fP(* \fBmflt_font_id\fP)(struct _MFLTFont *font)"
.PP
.SS "int(* \fBmflt_iterate_otf_feature\fP)(struct _MFLTFont *font, \fBMFLTOtfSpec\fP *spec, int from, int to, unsigned char *table)"
.PP
.SS "int(* \fBmflt_iterate_otf_feature\fP)(struct _MFLTFont *font, \fBMFLTOtfSpec\fP *spec, int from, int to, unsigned char *table)"
.PP
.SS "\fBMSymbol\fP(* \fBmflt_font_id\fP)(struct _MFLTFont *font)"
.PP

.SH COPYRIGHT
Copyright (C) 2001 Information\-technology Promotion Agency (IPA)
.br
Copyright (C) 2001\-2009 National Institute of Advanced Industrial Science and Technology (AIST)
.br
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License 
<http://www.gnu.org/licenses/fdl.html>.
