Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pf/pfwidetextwidthchars.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pf/pfwidetextwidthchars.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pf/pfwidetextwidthchars.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pf/pfwidetextwidthchars.html on line 8

PfWideTextWidthChars()

Calculate the width of a uint16_t string of Unicode characters

Synopsis:

#include <photon/Pf.h>
int PfWideTextWidthChars( const char *font,
                          const uint16_t *str,
                          int len );

Arguments:

font
The name of the desired font. Use PfGenerateFontName() to create the name.
str
A uint16_t string of Unicode characters.
len
The number of characters in the string. If len is 0, strlen(str) is assumed.

Library:

ph

Description:

PfWideTextWidthChars() is a convenience function that calculates the width of the given string in the given font, using the formula:

extent.lr.x - min(extent.ul.x, 0) + 1

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

PfWideTextWidthBytes() is similar, but you pass it the number of bytes in the string, rather than the number of characters.

Returns:

The width of the string, or 0 if an error occurred.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PfTextWidthBytes() PfTextWidthChars() PfWideTextWidthBytes()

Fonts chapter of the Photon Programmer's Guide


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pf/pfwidetextwidthchars.html on line 138

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pf/pfwidetextwidthchars.html on line 138