Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
GpiQueryFontFileDescriptions (1.2)
◄Function Group► ◄Overview► ◄Changes► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_GPILCIDS
LONG GpiQueryFontFileDescriptions(hab, pszFileName, pcFonts, pffdescs)
HAB hab; /* anchor-block handle */
PSZ pszFileName; /* address of the font-resource filename */
PLONG pcFonts; /* address of variable with number of fonts */
PFFDESCS pffdescs; /* array of names */
The GpiQueryFontFileDescriptions function retrieves the typeface family and
names contained in the specified file if the file is a font-resource file.
The function copies the names to the array pointed to by the pffdescs
parameter. Each name is a null-terminated string up to 32 characters long.
The function copies all names in the file up to the number of names
specified by the pcFonts parameter.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hab Identifies the anchor block.
pszFileName Points to a null-terminated string. This string must be a valid
MS OS/2 filename. If it does not specify a path and the .fon
filename extension, the function appends the default extension
(.dll) and looks for the font-resource file in the directories
specified by the libpath command in the config.sys file.
pcFonts Points to a variable specifying the maximum number of typeface
family and name pairs to retrieve. The function copies the
actual number of descriptions it retrieved to this variable.
pffdescs Points to the array to receive the typeface family and names
for each font. Each array element is itself a two-element array
of type FFDESCS.
Return Value
The return value is the number of fonts for which details were not returned
if the function is successful or GPI_ALTERROR if an error occurred.
Example
This example uses the GpiQueryFontFileDescriptions to retrieve the typeface
family and names for the fonts in the helv.dll file. The function is called
twice, once to determine the actual number of fonts in the file, and again
to retrieve the descriptions.
PFFDESCS pffdescs;
SEL sel;
LONG cFonts = 0;
/* Retrieve a count of all fonts in the file. */
cFonts = GpiQueryFontFileDescriptions(hab, "helv", &cFonts,
(PFFDESCS) NULL);
/* Allocate space for the descriptions. */
DosAllocSeg((USHORT) (cFonts * sizeof(FFDESCS)), &sel, SEG_NONSHARED);
pffdescs = MAKEP(sel, 0);
/* Retrieve the descriptions. */
GpiQueryFontFileDescriptions(hab, "helv", &cFonts, pffdescs);
See Also
GpiQueryFonts
♦