![]() |
![]() |
![]() |
![]() |
Render a wide-character string via a callback function
#include <photon/Pf.h> int PfRenderWideText( const char *font, const wchar_t *str, int len, PhPoint_t const *pos, PhRect_t const *clip, void (*func)( const PhPoint_t *, const FontRender *));
ph
This function renders the given wide-character string via a user callback function.
![]() |
This function assumes each character is represented by 2 bytes that conform to the ISO/IEC 10646-1 UCS-2 double-byte format. |
The base font is given by font, which you should create by calling PfGenerateFontName(). The actual fonts used by the string depend on the characters in it and the information in the fontext and fontmap files. The string str is a wide-character string of len bytes. If len is 0, strlen(str) is assumed.
The text is to be rendered at the location specified by pos, and clipped to the rectangle specified by the PhRect_t structure pointed to by clip. If clip is NULL, it's ignored. The font server performs coarse character clipping only.
When a request to construct the bitmap is sent to the font server, the string bitmap is returned, for efficiency, in the shared-memory area created through the initial call to PfAttach().
This function is normally used only by graphics drivers, but may be useful for application programs that have to obtain text bitmap data directly.
The user callback function func() is called with the desired pen location and the metrics of the bitmap. If the entire bitmap doesn't fit in the allocated memory, multiple calls to the font server and the user function can be made, advancing the pen as appropriate between calls.
The FontRender metrics structure contains at least the following members:
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PfExtentWideText(), PfFractionalRenderText() PfRenderText(), PfGenerateFontName(), PfWideTextWidthBytes(), PfWideTextWidthChars(), PhPoint_t, PhRect_t
Fonts chapter of the Photon Programmer's Guide
![]() |
![]() |
![]() |
![]() |