PfExtentWideText()

Calculate the extent rectangle of a wide-character string

Synopsis:

#include <photon/Pf.h>
PhRect_t *PfExtentWideText( PhRect_t *extent,
                            PhPoint_t const *pos,
                            const char *font,
                            const uint16_t *str,
                            int len);

Arguments:

extent
A pointer to a PhRect_t structure where the function can store the text extent. The members are:
pos
A pointer to a PhPoint_t structure that specifies an offset that you want the function to apply to the resulting extent. If pos is NULL, no offset is applied.
font
The name of the base font. Create this name by calling PfGenerateFontName().
str
A wide-character string.
len
The length of the string, in bytes. If len is 0, the function assumes the string is null-terminated.

Library:

ph

Description:

This function calculates the extent rectangle of a text string of wide characters.


Note: This function assumes each character is represented by 2 bytes that conform to the ISO/IEC 10646-1 UCS-2 double-byte format.

The font determines the ascender and descender values of the extent. The width is dependent on the string — the actual font used by characters within the string may be different than this base font (as specified in the fontext and fontmap files).

If metrics for the base font have been loaded locally (see PfLoadMetrics()) then this extent may be calculated internally; otherwise a request is sent to the font server.

Returns:

A pointer to the extent rectangle (i.e the same pointer as extent), or NULL if an error occurred.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PfExtent(), PfExtentCx(), PfExtentText(), PfExtentTextToRect(), PfFractionalExtentText(), PfGenerateFontName(), PfLoadMetrics(), PfWideTextWidthBytes(), PfWideTextWidthChars(), PgExtentText(), PhPoint_t, PhRect_t

Fonts chapter of the Photon Programmer's Guide