PDF SDK Documentation

Comprehensive Guide for Developers: Features, Integration, and API Reference

Loading...
Searching...
No Matches
PDF::Font Class Reference

Represents a font in a PDF document. More...

#include <pdfsdk/cxx/font.h>

Inheritance diagram for PDF::Font:

Public Member Functions

Object GetPdfObject () const
 
PDEFontSubtype GetSubtype () const
 
PDAtom GetName () const
 
PDEFontMetrics GetMetrics () const
 
Matrix GetFontMatrix () const
 
RectF GetFontBBox () const
 
bool IsEmbedded () const
 
PDEWritingMode GetWritingMode () const
 
Content GetCharProc (const char *codepoint, size_t codepointLen) const
 
Content GetCharProc (const std::string &codepoint) const
 
void EnumCharOutline (const char *codepoint, size_t codepointLen, OutlineEnumMonitor &mon) const
 
void EnumCharOutline (const std::string &codepoint, OutlineEnumMonitor &mon) const
 
int16_t GetCharWidth (const char *codepoint, size_t codepointLen) const
 
int16_t GetCharWidth (const std::string &codepoint) const
 
PDEGlyphVertMetric GetCharVertMetric (const char *codepoint, size_t codepointLen) const
 
PDEGlyphVertMetric GetCharVertMetric (const std::string &codepoint) const
 
PDFontStyle GetStyle () const
 
PDFontInfo GetFontInfo () const
 
PDAtom GetEncodingName () const
 
bool CanTypeUnicode (const std::wstring &unicode) const
 
bool IsFauxed () const
 
PDFontInfo GetFauxFontInfo () const
 
ReadStream OpenFontFileStream () const
 
std::wstring CharToUnicode (const char *codepoint, size_t codepointLen) const
 
std::wstring CharToUnicode (const std::string &codepoint) const
 
std::string UnicodeToChar (const UnicodeChar *unicode, size_t unicodeLen) const
 
std::string UnicodeToChar (const std::wstring &unicode) const
 
RectF GetType3GlyphsBBox () const
 
 Font (PDEFont handle, bool adopt=false) noexcept
 
 Font (const Font &rhs) noexcept
 
Fontoperator= (const Font &rhs) noexcept
 
 Font (Font &&rhs) noexcept
 
Fontoperator= (Font &&rhs) noexcept
 

Static Public Member Functions

static Font CreateFromPdfObject (const Object &object)
 

Detailed Description

Represents a font in a PDF document.

ISO 32000-2:2020 - 9.2 Organization and use of fonts

Member Function Documentation

◆ CanTypeUnicode()

bool PDF::Font::CanTypeUnicode ( const std::wstring & unicode) const

Check if the font can type the specified Unicode string.

Parameters
unicodeThe Unicode string.
Returns
True if the font can type the Unicode string, false otherwise.

◆ CharToUnicode() [1/2]

std::wstring PDF::Font::CharToUnicode ( const char * codepoint,
size_t codepointLen ) const

Convert the specified codepoint to Unicode.

Parameters
codepointThe codepoint.
codepointLenThe length of the codepoint.
Returns
The Unicode string.

◆ CharToUnicode() [2/2]

std::wstring PDF::Font::CharToUnicode ( const std::string & codepoint) const

Convert the specified codepoint to Unicode.

Parameters
codepointThe codepoint.
Returns
The Unicode string.

◆ CreateFromPdfObject()

static Font PDF::Font::CreateFromPdfObject ( const Object & object)
static

Creates a font from the specified PDF object.

Parameters
objectThe PDF object.
Returns
The font.

◆ EnumCharOutline() [1/2]

void PDF::Font::EnumCharOutline ( const char * codepoint,
size_t codepointLen,
OutlineEnumMonitor & mon ) const

Enumerate the outline of the character for the specified codepoint.

Parameters
codepointThe codepoint.
codepointLenThe length of the codepoint.
monThe outline enumeration monitor.

◆ EnumCharOutline() [2/2]

void PDF::Font::EnumCharOutline ( const std::string & codepoint,
OutlineEnumMonitor & mon ) const

Enumerate the outline of the character for the specified codepoint.

Parameters
codepointThe codepoint.
monThe outline enumeration monitor.

◆ GetCharProc() [1/2]

Content PDF::Font::GetCharProc ( const char * codepoint,
size_t codepointLen ) const

Get the character procedure for the specified codepoint.

Parameters
codepointThe codepoint.
codepointLenThe length of the codepoint.
Returns
The character procedure.

◆ GetCharProc() [2/2]

Content PDF::Font::GetCharProc ( const std::string & codepoint) const

Get the character procedure for the specified codepoint.

Parameters
codepointThe codepoint.
Returns
The character procedure.

◆ GetCharVertMetric() [1/2]

PDEGlyphVertMetric PDF::Font::GetCharVertMetric ( const char * codepoint,
size_t codepointLen ) const

Get the vertical metrics of the character for the specified codepoint.

Parameters
codepointThe codepoint.
codepointLenThe length of the codepoint.
Returns
The vertical metrics of the character.

◆ GetCharVertMetric() [2/2]

PDEGlyphVertMetric PDF::Font::GetCharVertMetric ( const std::string & codepoint) const

Get the vertical metrics of the character for the specified codepoint.

Parameters
codepointThe codepoint.
Returns
The vertical metrics of the character.

◆ GetCharWidth() [1/2]

int16_t PDF::Font::GetCharWidth ( const char * codepoint,
size_t codepointLen ) const

Get the width of the character for the specified codepoint.

Parameters
codepointThe codepoint.
codepointLenThe length of the codepoint.
Returns
The width of the character.

◆ GetCharWidth() [2/2]

int16_t PDF::Font::GetCharWidth ( const std::string & codepoint) const

Get the width of the character for the specified codepoint.

Parameters
codepointThe codepoint.
Returns
The width of the character.

◆ GetEncodingName()

PDAtom PDF::Font::GetEncodingName ( ) const

Get the encoding name of the font.

Returns
The encoding name of the font.

◆ GetFauxFontInfo()

PDFontInfo PDF::Font::GetFauxFontInfo ( ) const

Get the faux font info.

Returns
The faux font info.

◆ GetFontBBox()

RectF PDF::Font::GetFontBBox ( ) const

Get the font bounding box.

Returns
The font bounding box.

◆ GetFontInfo()

PDFontInfo PDF::Font::GetFontInfo ( ) const

Get the font info.

Returns
The font info.

◆ GetFontMatrix()

Matrix PDF::Font::GetFontMatrix ( ) const

Get the font matrix.

Returns
The font matrix.

◆ GetMetrics()

PDEFontMetrics PDF::Font::GetMetrics ( ) const

Get the metrics of the font.

Returns
The metrics of the font.

◆ GetName()

PDAtom PDF::Font::GetName ( ) const

Get the name of the font.

Returns
The name of the font.

◆ GetPdfObject()

Object PDF::Font::GetPdfObject ( ) const

Get the PDF object associated with this XObject.

Returns
The PDF object.

◆ GetStyle()

PDFontStyle PDF::Font::GetStyle ( ) const

Get the style of the font.

Returns
The style of the font.

◆ GetSubtype()

PDEFontSubtype PDF::Font::GetSubtype ( ) const

Get the subtype of the font.

Returns
The subtype of the font.

◆ GetType3GlyphsBBox()

RectF PDF::Font::GetType3GlyphsBBox ( ) const

Get the bounding box of the Type 3 glyphs.

Returns
The bounding box of the Type 3 glyphs.

◆ GetWritingMode()

PDEWritingMode PDF::Font::GetWritingMode ( ) const

Get the writing mode of the font.

Returns
The writing mode of the font.

◆ IsEmbedded()

bool PDF::Font::IsEmbedded ( ) const

Check if the font is embedded.

Returns
True if the font is embedded, false otherwise.

◆ IsFauxed()

bool PDF::Font::IsFauxed ( ) const

Check if the font is fauxed.

Returns
True if the font is fauxed, false otherwise.

◆ OpenFontFileStream()

ReadStream PDF::Font::OpenFontFileStream ( ) const

Open the font file stream.

Returns
The font file stream.

◆ UnicodeToChar() [1/2]

std::string PDF::Font::UnicodeToChar ( const std::wstring & unicode) const

Convert the specified Unicode string to codepoint.

Parameters
unicodeThe Unicode string.
Returns
The codepoint.

◆ UnicodeToChar() [2/2]

std::string PDF::Font::UnicodeToChar ( const UnicodeChar * unicode,
size_t unicodeLen ) const

Convert the specified Unicode string to codepoint.

Parameters
unicodeThe Unicode string.
unicodeLenThe length of the Unicode string.
Returns
The codepoint.

The documentation for this class was generated from the following file: