Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

PfExtent16dot16()

Calculate the 16.16 fixed point extent rectangle of a text string

Synopsis:

#include <photon/Pf.h>

int PfExtent16dot16( PhRect16dot16_t *extent,
                PhPoint16dot16_t const *pos,
                const char *font,
                long adata,
                long bdata,
                const char *str,
                int len,
                int flags,
                PhRect_t const *clip );

Arguments:

extent
A pointer to a PhRect16dot16_t structure where the function stores the calculated 16.16 fixed point extent. The members are:
ul.x_16dot16
the left bearing.
lr.x_16dot16
the maximum x distance.
ul.y_16dot16
the ascender.
lr.y_16dot16
the descender.

pos
A pointer to a PhPoint16dot16_t structure that specifies an offset to apply to the extent. If pos is NULL, no offset is applied.
font
The base font, which you should create by calling PfGenerateFontName().
adata
The horizontal fractional point size, if you set PF_FRACTIONAL in the flags argument.
bdata
The vertical fractional point size, if you set PF_FRACTIONAL in the flags argument.
str
The string whose extent you want to calculate. The string is UTF-8 multibyte by default.
len
The length of the string, str, in bytes. If len is 0, the function uses strlen(str).
flags
Flags that affect the behavior of the function. You can set up to one of the following to indicate the format of the string:

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:

clip
A pointer to a PhRect_t structure that's a suggested clipping rectangle for the font manager to abide by.

Library:

PfExtent16dot16()
ph

Description:

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.

Returns:

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.

Classification:

Photon

PfExtent16dot16()

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PfAttach(), PfAttachCx(), PfDetach(), PfDetachCx(), PfExtentComponents(), PfExtentComponentsCx(), PfExtentFractTextCharPositions(), PfExtentText(), PfExtentTextCharPositions(), PfExtentTextCharPositionsCx(), PfExtentTextToRect(), PfExtentWideText(), PfFractionalExtentText(), PfGenerateFontName(), PfGenerateFontNameCx(), PfLoadMetrics(), PfLoadMetricsCx(), PhPoint_t, PhRect_t