[Previous] [Contents] [Index] [Next]

PfFractionalExtentText()

Calculate the extent rectangle of a text string, using fractional scaling

Synopsis:

#include <photon/Pf.h>

PhRect_t *PfFractionalExtentText( 
             PhRect_t *extent, 
             PhPoint_t const *pos, 
             const char *font,
             long xsize,
             long ysize,
             const char *str, 
             int len);

Description:

This function calculates the extent rectangle of a text string. The base font is given by font; this determines the ascender/descender values of the extent. The xsize and ysize arguments define the size of the font in 16.16 fixed-point format.


Note: This function is valid only for scalable fonts. No font mappings are performed.

The string str is a Unicode, multibyte string of len bytes. If len is 0, strlen(str) is assumed.

The text extent is returned in a rectangle, with ul.x being the left bearing, lr.x-min(ul.x,0)+1 the right, ul.y the ascender, and lr.y the descender. The baseline of the font is at position y=0; the width of the string.

The resulting extent is offset by the point passed in pos. If this is NULL, no offset is applied.

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 (extent) if successful, NULL otherwise.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PfExtentText(), PfFractionalRenderText(), PfLoadMetrics(), PgExtentText()


[Previous] [Contents] [Index] [Next]