Win32NativeFonts Package
Last updated at 1:34 am UTC on 17 January 2006
The Plugin requires an implementation of the following (C-level) functions:
Font Enumeration
char *ioListFont(int fontIndex);
* Returns the name for the font with index "fontIndex"
(this assumes there's a way of enumerating the font names uniquely)
Font creation and queries
int ioCreateFont(int fontNameIndex, int fontNameLength, int pixelSize, int flags);
* Creates a font instance and return an "int" handle
- fontNameIndex/Length: The font name
- pixelSize: The requested size in pixels (not points)
- flags: encoding bold/italic/underline/struckout
int ioDestroyFont(int fontIndex);
* Destroys the font with the given font handle
int ioFontWidthOfChar(int fontIndex, int characterIndex);
Returns the width (in pixels) of one character in a font
- fontIndex: the handle to the font
- charIndex: the index of the character
int ioFontEncoding(int fontIndex);
* Returns the encoding for this font:
- 0: Mac Roman
- 1: ISO-Latin
int ioFontAscent(int fontIndex);
* Returns the ascent of the font
int ioFontDescent(int fontIndex);
* Returns the descent of the font
Font rendering
int ioFontGlyphOfChar(int fontIndex, int characterIndex, int formBitsIndex, int formWidth, int formHeight, int formDepth);
* Returns the form for the given character
Extended queries
int ioFontFullWidthOfChar(int fontIndex, int characterIndex, int width[3]);
* Returns the width of a character describing:
- width[0]: The advance width before the glyph is drawn
(may be negative -> underhang)
- width[1]: The glyph width
- width[2]: The advance width after the glyph is drawn
(may be negative -> overhang)
int ioFontNumKernPairs(int fontIndex);
* Returns the number of kerning pairs for this font
int ioFontGetKernPair(int fontIndex, int kernIndex, int kernPair[3]);
* Returns a kerninpair:
- kernPair[0]: Left character
- kernPair[1]: Right charater
- kernPair[2]: kerning value
TrueType specific
int ioGetFontDataSize(int fontIndex);
* Returns the size needed for embedding font data
int ioGetFontData(int fontIndex, char *buffer, int bufSize);
* Returns the data for font embedding
int ioFontEmbeddingFlags(int fontIndex);
* Returns the "font embedding" flags as defined by the TrueType specification
(the embedding flags describe if and how fonts may be redistributed with documents)