IPC@CHIP® Graphics Library – API Documentation

Header image

Main page


Font Functions

Functions utilised to load and use different fonts. More...

Functions

GcErrorCode gcLoadFontFromFile (GcFont *font, const char *path)
 Load font from a file.
GcErrorCode gcDestroyFont (GcFont *font)
 Destroy a font.
unsigned short gcGetTextWidth (const char *text)
 Get width of a text in pixels.
unsigned short gcGetTextHeight (const char *text)
 Get height of a text in pixels.
unsigned short gcGetMaxTextLength (const char *text, unsigned short maxWidth)
 Get maximum length of a given text.
GcErrorCode gcSetFont (const GcFont *font)
 Set the current font.
GcErrorCode gcSetTextEncoding (GcTextEncoding encoding)
 Set text encoding.

Detailed Description

This section holds functions, which can be utilised to load new fonts from the file system, to select one of the loaded fonts and to determine the dimensions of a given string depending on the current font.

To use a font, you have to load it from the file system using the function gcLoadFontFromFile(). The file must be a Beck Graphics Font file (extension .bgf). The font data will be loaded into the video memory and the font will be inserted into the font table. After that you can select the font using gcSetFont(). Currently the IPC@CHIP® Graphics Library does not support font scaling. So you have to load a font in each size that you want to use. Use the GCLIB File Converter to convert font from standard formats (e.g. OpenType or TrueType) to the Beck Graphics Font format.

Before loading any font from the file system, you can only use the system font. It's a 9 pt, fixed width font based on the Frästø (aka Frasto) font. The system font has been included into the library to enable you to put out error messages if for example loading a font from a file fails.* The Frästø font is copyrighted by Goksel Goktas & Ozan Sener. See http://beskrajnost.com.

The functions in this section are defined in the header file gclib_font.h, which will be automatically included along with gclib.h.






Top of page | Main page

Copyright © 2017 Beck IPC GmbH
Generated on Tue Jun 27 14:21:34 2017 by Doxygen 1.6.1