Calculate the 16.16 fixed point extent rectangle of a text string
#include <font_api.h> int PfExtent16dot16Cx( struct _Pf_ctrl *context, pf_rect_16dot16_t *extent, pf_point_16dot16_t const *pos, const char *font, long adata, long bdata, const char *str, int len, int flags, pf_rect_t const *clip );
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 any of these flags:
This function calculates the 16.16 fixed point extent rectangle of a text string. The 16.16 fixed point return value describes the extent with much greater accuracy than the extent pixel values. The base font determines the ascender and descender values of the extent. The width depends on the string; the actual font used by characters within the string may differ from this base font (as specified in the fontext and fontmap files).
The difference between PfExtent16dot16() and PfExtent16dot16Cx() is that PfExtent16dot16Cx() lets you specify the font context to use.
The PfExtent16dot16() and PfExtent16dot16Cx() functions never load metrics locally. A message is always sent to the server.
The generic design of this routine allows for future expansion.
If you set PF_RECT in the flags argument, PfExtent16dot16() and PfExtent16dot16Cx() return the number of characters that fit within the rectangle specified by clip, or -1 if an error occurred.
If you don't set PF_RECT in the flags argument, these functions return 0 on success, or -1 if an error occurred.
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
PfAttach(), PfAttachCx(), PfDetach(), PfDetachCx(), PfExtentComponents(), PfExtentComponentsCx(), PfExtentFractTextCharPositions(), PfExtentText(), PfExtentTextCharPositions(), PfExtentTextCharPositionsCx(), PfExtentTextToRect(), PfExtentWideText(), PfFractionalExtentText(), PfGenerateFontName(), PfGenerateFontNameCx(), PfLoadMetrics(), PfLoadMetricsCx(), PhPoint_t, PhRect_t