Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pf/pfgeneratefontname.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pf/pfgeneratefontname.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pf/pfgeneratefontname.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pf/pfgeneratefontname.html on line 8
Generate a font name
#include <photon/Pf.h>
char * PfGenerateFontName(
char const * pkcDescription,
uint32_t kuiFlags,
uint32_t kuiSize,
char * pcBuff );
#include <font_api.h>
char * PfGenerateFontNameCx(
struct _Pf_ctrl *context,
char const * pkcDescription,
uint32_t kuiFlags,
uint32_t kuiSize,
char * pcBuff );
- context
- A pointer to the font context to use, returned by PfAttachCx() or PfAttachDllCx().
- pkcDescription
- The descriptive name of the font, usually the name
provided by the font foundry, e.g. Helvetica.
- kuiFlags
- The attributes to apply to the font. The following bits can be
ORed together:
- PF_STYLE_BOLD
- PF_STYLE_ITALIC
- PF_STYLE_ANTIALIAS
- PF_STYLE_ULINE
- PF_STYLE_DULINE
- kuiSize
- The requested point size, e.g. 12.
- pcBuff
- A buffer in which to store the resulting font identifier. This
must be of size MAX_FONT_TAG.
- PfGenerateFontName()
- ph
- PfGenerateFontNameCx()
- font
PfGenerateFontName() is a convenience function that generates proper font names from the given arguments. PfGenerateFontNameCx() is similar to PfGenerateFontName(), but lets you specify the font context.
|
PfGenerateFontName() uses a global context, so you must call PhAttach() or PhInit() first to set up the global context. If you don't, your application will crash. |
NULL on failure, pcBuff on success.
- ENOMEM
- Not enough memory to proceed with the request.
- EFAULT
- One of the required parameters is NULL.
- EINVAL
- The requested size is 0.
- ESRCH
- Unable to locate font.
PfGenerateFontNameCx(): See the examples for
PfConvertFontIDCx()
and PfExtentCx().
PfGenerateFontName():
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(),
PfExtentTextCx(),
PfGlyph(),
PfRenderCx()
or
PfRender().
Photon
PfGenerateFontName()
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
PfGenerateFontNameCx()
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
PfAttach(),
PfAttachCx(),
PfDecomposeStemToID(),
PfDecomposeStemToIDCx(),
PfQueryFontInfo(),
PfQueryFontInfoCx(),
PfQueryFonts(),
PfQueryFontsCx()
Fonts
chapter of the Photon Programmer's Guide
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pf/pfgeneratefontname.html on line 245
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pf/pfgeneratefontname.html on line 245