Font.getUnicodeWidth

Gets the width of a Unicode character in a specific font.

Actual width of the character on the page can be calculated as follows:

class Font
int
getUnicodeWidth

Parameters

code HPDF_UNICODE

A Unicode character.

Return Value

Type: int

the character width on success. Otherwise, returns null.

Examples

char_width = font.getUnicodeWidth(UNICODE);
float actual_width = char_width * FONT_SIZE / 1000;

Meta