Font Management
MGUI library provides ten preallocated (static) fonts in any platform which
are referenced in the source code via macros. There are four fixed picth
fonts:
DEFAULT_FONT
FIXED_SMALL
FIXED_MEDIUM
FIXED_LARGE
The others are proportional Times ed Helvetica (arial):
TIMES_SMALL
TIMES_MEDIUM
TIMES_LARGE,
HELV_SMALL
HELV_MEDIUM
HELV_LARGE
It's possible to load additional fonts via the MLoadFont() function
call, specifying the font family, font size, bold and italic options. The
font family is a case unsensitive string which specifies the font name.
Since release 3.2 you can query MGUI to enumerate available font families
(including ALL DOS versions) and load the desired font at run time.
The font size specifies the desired font height. The returned font
can have an actual height smaller than the requested one if the system
doesn't support scaleable fonts or the font itself is fixed size. An application
can load up to 22 new fonts.
Note that, since any font loading request allocates an entry even if
the the requested font has already been loaded before, it's highly recommended
to unload unused font via the MUnloadFont() function call. If
the MLoadFont() request cannot be satisfied, the function returns
the predefined value DEFAULT_FONT as an error. This also offers
the application the opportunity to continue without testing the returned
font identifier since it's always valid.
Back