|
| void | glcAppendFont (GLint inFont) |
| void | glcDeleteFont (GLint inFont) |
| void | glcFont (GLint inFont) |
| GLboolean | glcFontFace (GLint inFont, const GLCchar *inFace) |
| void | glcFontMap (GLint inFont, GLint inCode, const GLCchar *inCharName) |
| GLint | glcGenFontID (void) |
| const GLCchar * | glcGetFontFace (GLint inFont) |
| const GLCchar * | glcGetFontListc (GLint inFont, GLCenum inAttrib, GLint inIndex) |
| const GLCchar * | glcGetFontMap (GLint inFont, GLint inCode) |
| const GLCchar * | glcGetFontc (GLint inFont, GLCenum inAttrib) |
| GLint | glcGetFonti (GLint inFont, GLCenum inAttrib) |
| GLboolean | glcIsFont (GLint inFont) |
| GLint | glcNewFontFromMaster (GLint inFont, GLint inMaster) |
| GLint | glcNewFontFromFamily (GLint inFont, const GLCchar *inFamily) |
Commands to create, manage and destroy fonts.
A font is a stylistically consistent set of glyphs that can be used to render some set of characters. Each font has a family name (for example Palatino) and a state variable that selects one of the faces (for example Regular, Bold, Italic, BoldItalic) that the font contains. A typeface is the combination of a family and a face (for example Palatino Bold).
A font is an instantiation of a master for a given face.
Every font has an associated character map. A character map is a table of entries that maps integer values to the name string that identifies the characters. The character maps are used by GLC, for instance, to determine that the character code 65 corresponds to A. The character map of a font can be modified by either adding new entries or changing the mapping of the characters (see glcFontMap()).
GLC maintains two lists of fonts : GLC_FONT_LIST and GLC_CURRENT_FONT_LIST. The former contains every font that have been created with the commands glcNewFontFromFamily() and glcNewFontFromMaster() and the later contains the fonts that GLC can use when it renders a character (notice however that if GLC_AUTO_FONT is enabled, GLC may automatically add new fonts from GLC_FONT_LIST to the GLC_CURRENT_FONT_LIST ). Finally, it must be stressed that the order in which the fonts are stored in the GLC_CURRENT_FONT_LIST matters : the first font of the list should be considered as the main font with which strings are rendered, while other fonts of this list should be seen as fallback fonts (i.e. fonts that are used when the first font of GLC_CURRENT_FONT_LIST does not map the character to render).
Most of the commands in this category have a parameter inFont. Unless otherwise specified, these commands raise GLC_PARAMETER_ERROR if inFont is less than zero or is greater than or equal to the value of the variable GLC_FONT_COUNT.
| GLboolean glcFontFace |
( |
GLint | inFont, |
|
|
const GLCchar * | inFace ) |
This command attempts to set the current face of the font identified by inFont to the face identified by the string inFace.
Examples for font faces are strings like "Normal", "Bold" or "Bold Italic". In contrast to some systems that have a different font for each face, GLC allows you to have the face be an attribute of the font.
If inFace is not an element of the font's string list attribute GLC_FACE_LIST, the command leaves the font's current face unchanged and returns GL_FALSE. If the command succeeds, it returns GL_TRUE.
If inFont is zero, the command iterates over the GLC_CURRENT_FONT_LIST. For each of the fonts named therein, the command attempts to set the font's current face to the face in that font that is identified by inFace. In this case, the command returns GL_TRUE if GLC_CURRENT_FONT_LIST contains one or more elements and the command successfully sets the current face of each of the fonts named in the list.
The command raises GLC_PARAMETER_ERROR if inFont is not an element in the list GLC_FONT_LIST.
- Parameters
-
| inFont | The ID of the font to be changed |
| inFace | The face for inFont |
- Returns
- GL_TRUE if the command succeeded to set the face inFace to the font inFont. GL_FALSE is returned otherwise.
- See also
- glcGetFontFace()
| const GLCchar * glcGetFontListc |
( |
GLint | inFont, |
|
|
GLCenum | inAttrib, |
|
|
GLint | inIndex ) |
This command returns an attribute of the font identified by inFont that is a string from a string list identified by inAttrib.
The command returns the string at offset inIndex from the first element in inAttrib. For example, if inFont has a face list (Regular, Bold, Italic ) and inIndex is 2, then the command returns Italic if you query GLC_FACE_LIST.
Every GLC state variable that is a list has an associated integer element count whose value is the number of elements in the list.
Below are the string list attributes associated with each GLC master and font and their element count attributes :
Master/font string list attributes
| Name | Enumerant | Element count attribute |
| GLC_CHAR_LIST | 0x0050 | GLC_CHAR_COUNT |
| GLC_FACE_LIST | 0x0051 | GLC_FACE_COUNT |
The command raises GLC_PARAMETER_ERROR if inIndex is less than zero or is greater than or equal to the value of the list element count attribute.
- Parameters
-
| inFont | The font ID |
| inAttrib | The string list from which a string is requested |
| inIndex | The offset from the first element of the list associated with inAttrib |
- Returns
- A string attribute of inFont identified by inAttrib
- See also
- glcGetMasterListc()
-
glcGetFontc()
-
glcGetFonti()