DynaPDF Manual - Page 410

Previous Page 409   Index   Next Page 411

Function Reference
Page 410 of 821
Font weights:
100 - 300
// Ultra light, Light
400 - 500
// Standard
600 - 1000 // Bold, Extra bold
GetFTextHeight
Syntax:
double pdfGetFTextHeight(
const PPDF* IPDF,
// Instance pointer
TTextAlign Align,
// Base text alignment
const char* AText) // Formatted text
typedef enum
{
taLeft,
taCenter,
taRight,
taJustify
}TTextAlign;
The function measures the height of a formatted text block. Before calling this function a font (see
SetFont()) and the output rectangle must be set with the function SetTextRect(). The parameter
Height of SetTextRect() should be set to -1 to avoid page breaks. Otherwise the height of the first text
block is returned that fits into the given height of the rectangle.
The parameter AText must contain the same text (incl. format tags if any) as which should be
printed later with WriteFText().
Remarks:
This function is implemented in an Ansi and Unicode compatible version.
Return values:
If the function succeeds the return value is the height of the formatted text block. If the function fails
the return value is a negative error code.
GetFTextHeightEx
Syntax:
double pdfGetFTextHeightEx(
const PPDF* IPDF,
// Instance pointer
double Width,
// Width of output rectangle
TTextAlign Align,
// Base text alignment
const char* AText) // Formatted text
The function measures the height of a formatted text block. The function works in the same way as
GetFTextHeight() but the output rectangle must not be set manually beforehand.
The height of the output rectangle is set to -1 to avoid a page break during measuring.
 

Previous topic: GetFontSearchOrder, GetFontSelMode, GetFontSize, GetFontWeight

Next topic: GetGlyphIndex, GetGlyphOutline


Start Chat