This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Set the text font
void PgSetFont( char const *ff ); void PgSetFontCx( PhGC_t *gc, char const *ff );
ph
These functions set the font for text subsequently drawn with PgDrawText*() or PgDrawString*(). The ff argument is a pointer to a font identifier, which you should create by calling PfGenerateFontName().
PgSetFont() works on the current graphics context, while you can specify the graphics context gc for PgSetFontCx().
char font_name[MAX_FONT_TAG]; // Use Helvetica, 12p, Normal: if (PfGenerateFontName( "Helvetica", 0, 12, font_name ) != NULL) { PgSetFont( font_name ); } // Use Helvetica, 14p, Bold Italic: if (PfGenerateFontName( "Helvetica", PF_STYLE_BOLD | PF_STYLE_ITALIC, 14, font_name ) != NULL ) { PgSetFont( font_name ); }
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PfGenerateFontName(), PgDrawString*(), PgDrawText*(), PgSetFillColor*(), PgSetFillDither*(), PgSetFillTransPat*(), PgSetUnderline*()
"Drawing attributes" in the Raw Drawing and Animation chapter of the Photon Programmer's Guide