[Previous] [Contents] [Index] [Next]

PfGenerateFontName()

Generate a font name

Synopsis:

uchar_t * PfGenerateFontName(
             uchar_t const * pkucDescription,
             uint32_t const kuiFlags,
             uint32_t const kuiSize,
             uchar_t * pucBuff );

Library:

ph

Description:

PfGenerateFontName() is a convenience function that generates a proper font name from the arguments given:

pkucDescription
The descriptive name of the font, usually the name provided by the font foundry, e.g. Helvetica, Comic Sans MS.
kulFlags
The attributes to apply to the font. The following bits can be ORed together:
kulSize
The requested point size, e.g. 12.
pucBuff
A buffer in which to store the resulting font identifier. This must be of size MAX_FONT_TAG.

Returns:

NULL on failure, pucBuff on success.

Errors:

ENOMEM
Not enough memory to proceed with the request.
EFAULT
One of the required parameters is NULL.
EINVAL
The requested size is 0.

Examples:

char szHelvetica12[MAX_FONT_TAG];

if(PfGenerateFontName("Helvetica", PF_STYLE_BOLD,
                      12, szHelvetica12) == NULL) {
   perror("Unable to find font");
} else {
   PfExtentText(&tsExtent, NULL, szHelvetica12,
                "Hello", 0);
}

The szHelvetica12 variable can now be used with any function that takes a "font" pointer, such as PfExtentText(), PfGlyph(), or PfRenderText().

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PfQueryFontInfo(), PfQueryFonts()

Fonts chapter of the Photon Programmer's Guide


[Previous] [Contents] [Index] [Next]