- Inherits from:
- Object
- Conforms to:
- DFont
- Declared in:
- DTrueTypeFont.h
Object
|
+---DTrueTypeFont
Class Description
The DTrueTypeFont class implements methods for using a TrueType font.
Actually every font that can be loaded with the FreeType library, can
be used by this class.
- Last modified:
- 05-Nov-2007 (DTrueTypeFont.h)
Instance Variables
- private void *_font
- the loaded font
- Constructors
- - (DTrueTypeFont *) init
- Initialise an graphic drawable object
- Returns:
- the object
- Copy related methods
- - shallowCopy
- Do a shallow copy of the graphic drawable object
- Returns:
- the object
- Deconstructor
- - free
- Free the truetype font
- Returns:
- the object
- Font members
- - (const char *) familyName
- Get the family name of the font
- Returns:
- the family name (or NULL)
- - (int) glyphsInFont
- Get the number of characters in font
- Returns:
- the number of characters in the font (or -1)
- - (const char *) styleName
- Get the style name of the font
- Returns:
- the style name (or NULL)
- Font methods
- - (BOOL) charSize :(char) ch :(unsigned *) width :(unsigned *) height
- Get the size of a character for the current font and size
- Parameters:
- ch - the character
width - the width of the string
height - the height of the string
- Returns:
- success
- - (BOOL) close
- Close the font (file)
- Returns:
- success
- - (BOOL) glyph :(char) ch :(DFT_Glyph *) glyph
- Get the glyph info for blitting a character for the current font and size
- Parameters:
- ch - the character
glyph - the character bitmap and blit info
- Returns:
- success
- - (BOOL) isOpen
- Check if the font is open
- Returns:
- is it ?
- - (BOOL) open :(const char *) filename
- Open a (true type) font file
- Parameters:
- filename - the name of the font file
- Returns:
- success
- - (BOOL) size :(unsigned) width :(unsigned) height
- Set the font size based on the width and height of one character
- Parameters:
- width - the requested width
height - the requested height
- Returns:
- success
- - (BOOL) size :(const char *) cstr :(unsigned) width :(unsigned) height
- Set the font size based on a string and requested a size
- Parameters:
- cstr - the string
width - the requested width
height - the requested height
- Returns:
- success
- - (BOOL) stringSize :(const char *) cstr :(unsigned *) width :(unsigned *) height
- Get the size of a string for the current font size
- Parameters:
- cstr - the string
width - the width of the string
height - the height of the string
- Returns:
- success
generated 05-Nov-2007 by ObjcDoc 3.0.0