PoDoFo::PdfFont Class Reference
#include <PdfFont.h>
List of all members.
Detailed Description
Before you can draw text on a PDF document, you have to create a font object first. You can reuse this font object as often as you want.
Use PdfDocument::CreateFont to create a new font object. It will choose a correct subclass using PdfFontFactory.
This is only an abstract base class which is implemented for different font formats.
Constructor & Destructor Documentation
Create a new PdfFont object which will introduce itself automatically to every page object it is used on.
The font has a default font size of 12.0pt.
- Parameters:
-
| pMetrics | pointer to a font metrics object. The font in the PDF file will match this fontmetrics object. The metrics object is deleted along with the font. |
| pEncoding | the encoding of this font. The font will not take ownership of this object. |
| pParent | parent of the font object |
Create a PdfFont based on an existing PdfObject
- Parameters:
-
| pMetrics | pointer to a font metrics object. The font in the PDF file will match this fontmetrics object. The metrics object is deleted along with the font. |
| pEncoding | the encoding of this font. The font will not take ownership of this object. |
| pObject | an existing PdfObject |
Member Function Documentation
void PoDoFo::PdfFont::EmbedFont |
( |
|
) |
[virtual] |
const PdfName & PoDoFo::PdfFont::GetBaseFont |
( |
|
) |
const [inline, protected] |
Get the base font name of this font
- Returns:
- the base font name
const PdfEncoding * PoDoFo::PdfFont::GetEncoding |
( |
|
) |
const [inline] |
Returns a reference to the fonts encoding
- Returns:
- a PdfEncoding object.
float PoDoFo::PdfFont::GetFontCharSpace |
( |
|
) |
const [inline] |
Retrieve the current character spacing of this font object
- Returns:
- the current font character spacing
const PdfFontMetrics * PoDoFo::PdfFont::GetFontMetrics |
( |
|
) |
const [inline] |
Returns a handle to the fontmetrics object of this font. This can be used for size calculations of text strings when drawn using this font.
- Returns:
- a handle to the font metrics object
Returns a handle to the fontmetrics object of this font. This can be used for size calculations of text strings when drawn using this font.
- Returns:
- a handle to the font metrics object
float PoDoFo::PdfFont::GetFontScale |
( |
|
) |
const [inline] |
Retrieve the current horizontal scaling of this font object
- Returns:
- the current font scaling
float PoDoFo::PdfFont::GetFontSize |
( |
|
) |
const [inline] |
Retrieve the current font size of this font object
- Returns:
- the current font size
const PdfName & PoDoFo::PdfFont::GetIdentifier |
( |
|
) |
const [inline] |
Returns the identifier of this font how it is known in the pages resource dictionary.
- Returns:
- PdfName containing the identifier (e.g. /Ft13)
bool PoDoFo::PdfFont::IsBold |
( |
|
) |
const [inline] |
bool PoDoFo::PdfFont::IsItalic |
( |
|
) |
const [inline] |
bool PoDoFo::PdfFont::IsStrikeOut |
( |
|
) |
const [inline] |
- Returns:
- true if the font is striked out
bool PoDoFo::PdfFont::IsUnderlined |
( |
|
) |
const [inline] |
void PoDoFo::PdfFont::SetFontCharSpace |
( |
float |
fCharSpace |
) |
[inline] |
Set the character spacing of the font
- Parameters:
-
| fCharSpace | character spacing in percent |
void PoDoFo::PdfFont::SetFontScale |
( |
float |
fScale |
) |
[inline] |
Set the horizontal scaling of the font for compressing (< 100) and expanding (>100)
- Parameters:
-
| fScale | scaling in percent |
void PoDoFo::PdfFont::SetFontSize |
( |
float |
fSize |
) |
[inline] |
Set the font size before drawing with this font.
- Parameters:
-
| fSize | font size in points |
void PoDoFo::PdfFont::SetStrikeOut |
( |
bool |
bStrikeOut |
) |
[inline] |
Set the strikeout property of the font
- Parameters:
-
| bStrikeOut | if true any text drawn with this font by a PdfPainter will be strikedout. Default is false |
void PoDoFo::PdfFont::SetUnderlined |
( |
bool |
bUnder |
) |
[inline] |
Set the underlined property of the font
- Parameters:
-
| bUnder | if true any text drawn with this font by a PdfPainter will be underlined. Default is false |
void PoDoFo::PdfFont::WriteStringToStream |
( |
const PdfString & |
rsString, |
|
|
PdfStream * |
pStream | |
|
) |
| | [virtual] |
Write a PdfString to a PdfStream in a format so that it can be used with this font. This is used by PdfPainter::DrawText to display a text string. The following PDF operator will be Tj
- Parameters:
-
| rsString | a unicode or ansi string which will be displayed |
| pStream | the string will be appended to pStream without any leading or following whitespaces. |