Calculate the extent of a text string and invoke a callback
#include <photon/Pf.h> PhRect_t *PfExtentComponents( PhRect_t *extent, PhPoint_t const *pos, const char *font, const char *str, int len, void (*func)(PhRect_t *, const char *, const char *, int) ); #include <font_api.h> pf_rect_t* PfExtentComponentsCx( struct _Pf_ctrl *context, pf_rect_t *extent, pf_point_t const *pos, const char *font, const char *string, int len, void(*func) (pf_rect_t const *, const char *, const char *, int) );
The callback function is passed an extent rectangle, the filename of the font required, and the string and length of the character run.
These functions calculate the extent of a text string as per PfExtentText(), and also invoke a user callback function func for each component of the string (a run of characters sourced from a single font).
This facility is used by phrelay (see the QNX Neutrino Utilities Reference) to determine which font files have to be downloaded to the remote system in order to correctly render a string.
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
PfExtent(), PfExtentCx(), PfExtentText(), PfExtentTextToRect(), PfGenerateFontName(), PfGenerateFontNameCx(), PhPoint_t, PhRect_t
Fonts chapter of the Photon Programmer's Guide