PoDoFo 0.9.6
|
#include <PdfFont.h>
Public Member Functions | |
PdfFont (PdfFontMetrics *pMetrics, const PdfEncoding *const pEncoding, PdfVecObjects *pParent) | |
PdfFont (PdfFontMetrics *pMetrics, const PdfEncoding *const pEncoding, PdfObject *pObject) | |
void | SetFontSize (float fSize) |
float | GetFontSize () const |
void | SetFontScale (float fScale) |
float | GetFontScale () const |
void | SetFontCharSpace (float fCharSpace) |
float | GetFontCharSpace () const |
void | SetWordSpace (float fWordSpace) |
float | GetWordSpace () const |
void | SetUnderlined (bool bUnder) |
bool | IsUnderlined () const |
bool | IsBold () const |
bool | IsItalic () const |
void | SetStrikeOut (bool bStrikeOut) |
bool | IsStrikeOut () const |
const PdfName & | GetIdentifier () const |
const PdfEncoding * | GetEncoding () const |
const PdfFontMetrics * | GetFontMetrics () const |
PdfFontMetrics * | GetFontMetrics2 () |
virtual void | WriteStringToStream (const PdfString &rsString, PdfStream *pStream) |
virtual void | EmbedFont () |
virtual void | AddUsedSubsettingGlyphs (const PdfString &sText, long lStringLen) |
virtual void | AddUsedGlyphname (const char *pszGlyphName) |
virtual void | EmbedSubsetFont () |
bool | IsSubsetting () const |
![]() | |
PdfObject * | GetObject () |
const PdfObject * | GetObject () const |
Protected Member Functions | |
const PdfName & | GetBaseFont () const |
virtual void | SetBold (bool bBold) |
virtual void | SetItalic (bool bItalic) |
![]() | |
PdfElement (const char *pszType, PdfVecObjects *pParent) | |
PdfElement (const char *pszType, PdfDocument *pParent) | |
PdfElement (const char *pszType, PdfObject *pObject) | |
PdfElement (EPdfDataType eExpectedDataType, PdfObject *pObject) | |
const char * | TypeNameForIndex (int i, const char **ppTypes, long lLen) const |
int | TypeNameToIndex (const char *pszType, const char **ppTypes, long lLen, int nUnknownValue) const |
PdfObject * | CreateObject (const char *pszType=NULL) |
PdfObject * | GetNonConstObject () const |
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.
PoDoFo::PdfFont::PdfFont | ( | PdfFontMetrics * | pMetrics, |
const PdfEncoding *const | pEncoding, | ||
PdfVecObjects * | pParent | ||
) |
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.
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 take ownership of this object depending on pEncoding->IsAutoDelete() |
pParent | parent of the font object |
PoDoFo::PdfFont::PdfFont | ( | PdfFontMetrics * | pMetrics, |
const PdfEncoding *const | pEncoding, | ||
PdfObject * | pObject | ||
) |
Create a PdfFont based on an existing PdfObject
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 take ownership of this object depending on pEncoding->IsAutoDelete() |
pObject | an existing PdfObject |
|
virtual |
Remember the glyphname in case of subsetting
pszGlyphName | Name of the glyph to remember |
Reimplemented in PoDoFo::PdfFontType1.
|
virtual |
Remember the glyphs used in the string in case of subsetting
sText | the text string which should be printed (is not allowed to be NULL!) |
lStringLen | draw only lLen characters of pszText |
Only call if IsSubsetting() returns true. Might throw an exception otherwise.
Reimplemented in PoDoFo::PdfFontCID, and PoDoFo::PdfFontType1.
|
virtual |
Embeds the font into PDF page
Reimplemented in PoDoFo::PdfFontCID, and PoDoFo::PdfFontSimple.
|
virtual |
Embeds pending subset-font into PDF page Only call if IsSubsetting() returns true. Might throw an exception otherwise.
Reimplemented in PoDoFo::PdfFontCID, and PoDoFo::PdfFontType1.
|
inlineprotected |
Get the base font name of this font
|
inline |
Returns a reference to the fonts encoding
|
inline |
Retrieve the current character spacing of this font object
|
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.
|
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.
|
inline |
Retrieve the current horizontal scaling of this font object
|
inline |
Retrieve the current font size of this font object
|
inline |
Returns the identifier of this font how it is known in the pages resource dictionary.
|
inline |
Retrieve the current word spacing of this font object
|
inline |
|
inline |
|
inline |
|
inline |
Check if this is a subsetting font.
|
inline |
|
protectedvirtual |
Used to specify if this represents a bold font
bBold | if true this is a bold font. |
This can be called by PdfFontFactory to tell this font object that it belongs to a bold font.
Reimplemented in PoDoFo::PdfFontCID.
|
inline |
Set the character spacing of the font
fCharSpace | character spacing in percent |
|
inline |
Set the horizontal scaling of the font for compressing (< 100) and expanding (>100)
fScale | scaling in percent |
|
inline |
Set the font size before drawing with this font.
fSize | font size in points |
|
protectedvirtual |
Used to specify if this represents an italic font
bItalic | if true this is an italic font. |
This can be called by PdfFontFactory to tell this font object that it belongs to an italic font.
Reimplemented in PoDoFo::PdfFontCID.
|
inline |
Set the strikeout property of the font
bStrikeOut | if true any text drawn with this font by a PdfPainter will be strikedout. Default is false |
|
inline |
Set the underlined property of the font
bUnder | if true any text drawn with this font by a PdfPainter will be underlined. Default is false |
|
inline |
Set the word spacing of the font
fWordSpace | word spacing in PDF units |
|
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
rsString | a unicode or ansi string which will be displayed |
pStream | the string will be appended to pStream without any leading or following whitespaces. |