DynaPDF Manual - Page 504

Previous Page 503   Index   Next Page 505

Function Reference
Page 504 of 839
GetTextWidthEx
Syntax:
double pdfGetTextWidthEx(
const PPDF* IPDF,
// Instance pointer
const char* AText, // Text string
UI32 Len)
// Length of the string in characters
The function computes the width of a text string. The graphics state parameters character spacing,
word spacing, text scaling, and the current font size are all considered. A font must be set before this
function can be used.
The function computes the visible width of the string. This is the width excluding the last character
spacing. The bounding box of the string is the text width plus the current character spacing. This
behaviour must be taken into account when writing right aligned text with WriteFText(). Due to
certain formatting rules WriteFText() uses the bounding box of a text string to output text.
Visible Text Width (character spacing = 5.0)
C h a r a c t e r S p a c i n g
Real Bounding Box (character spacing = 5.0)
C h a r a c t e r S p a c i n g
Remarks:
This function is implemented in an Ansi and Unicode compatible version.
CJK to Unicode code pages are supported by the Ansi version only because CJK strings must be
converted to Unicode beforehand. These conversion algorithms are available in the Ansi version
only. However, native CJK character sets are supported by the Unicode version in combination with
a CJK font. See SetFont() for further information.
Return values:
If the function succeeds the return value is the string width in un-scaled units. If the function fails
the return value is a negative error code.
GetTransparentColor
Syntax:
UI32 pdfGetTransparentColor(
const PPDF* IPDF) // Instance pointer
The function returns the transparent color value that is used for newly inserted images.
Default value = 0xFFFFFF (RGB White)
 

Previous topic: GetTextWidth (Font API)

Next topic: GetTrapped, GetTypoLeading, GetURIAction