DynaPDF Manual - Page 472

Previous Page 471   Index   Next Page 473

Function Reference
Page 472 of 787
GetTextScaling
Syntax:
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
SetTextScaling().
Default value = 100
Value = 100
Word
Value = 50
WordWord
GetTextWidth
Syntax:
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)

Start Chat