DynaPDF Manual - Page 502

Previous Page 501   Index   Next Page 503

Function Reference
Page 502 of 839
double pdfGetTextScaling(
const PPDF* IPDF) // Instance pointer
The function returns the current value of horizontal text scaling. The scaling value adjusts the width
of glyphs by stretching or compressing them in the horizontal direction. Its value is specified as a
percentage of the normal width of the glyphs, with 100 being the normal width. See also
Default value = 100
Value = 100
Value = 50
double pdfGetTextWidth(
const PPDF* IPDF,
// Instance pointer
const char* AText) // Null-terminated text string
The function computes the width of a text string in horizontal writing mode and the height in
vertical writing mode. 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() must use the real bounding box of the 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

Previous topic: GetTextFieldValue, GetTextRect, GetTextRise

Next topic: GetTextWidth (Font API)