Render a string via a user callback function
int PfRenderCtx( void *ctx,
const char *font,
long adata,
long bdata,
const char *str,
int len,
int flags,
PhPoint_t const *pos,
PhRect_t const *clip,
void (*func) (
void *, const PhPoint_t *pos,
const FontRender *));
int PfRenderCx( struct _Pf_ctrl *context,
void *ctx,
const char *font,
long adata,
long bdata,
const char *str,
int len,
int flags,
PhPoint_t const *pos,
PhRect_t const *clip,
void (*func) (
void *, const PhPoint_t *pos,
const FontRender *));
You can set up to one of the following to indicate the format of the string:
| Although this flag allows for 32-bit wide characters, the underlying font system currently supports only characters up to Unicode U+FFFE. |
If you don't set either of the above, the function assumes that the string is composed of UTF-8 multibyte characters.
You can OR in:
ph
These functions render the given string via a user callback function. The difference between PfRenderCtx() and PfRenderCx() is that PfRenderCx() lets you specify the font context to use.
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().
Normally, only the graphics drivers use these functions, but they may be useful for application programs that have to obtain text bitmap data directly.
The generic design of these routines allows future expansion.
The FontRender metrics structure contains at least the following members:
Photon
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | No |
| Thread | No |
PfAttach(), PfDetach(), PfGenerateFontName(), PfRenderText(), PfRenderWideText(), PhPoint_t, PhRect_t