PoDoFo 0.9.20
PoDoFo::PdfFontManager Class Referencefinal

#include <PdfFontManager.h>

Public Member Functions

PdfFontSearchFont (const std::string_view &fontPattern, const PdfFontSearchParams &searchParams={ }, const PdfFontCreateParams &createParams={ })
 
PdfFontGetOrCreateFont (FT_Face face, const PdfFontCreateParams &params={ })
 
void EmbedFonts ()
 

Static Public Member Functions

static PdfFontMetricsConstPtr SearchFontMetrics (const std::string_view &fontPattern, const PdfFontSearchParams &params={ })
 

Detailed Description

This class assists PdfDocument with caching font information.

Additional to font caching, this class is also responsible for font matching.

PdfFont is an actual font that can be used in a PDF file (i.e. it does also font embedding) and PdfFontMetrics provides only metrics informations.

See also
PdfDocument

Member Function Documentation

◆ EmbedFonts()

void PdfFontManager::EmbedFonts ( )

Called by PdfDocument before saving

◆ GetOrCreateFont()

PdfFont & PdfFontManager::GetOrCreateFont ( FT_Face face,
const PdfFontCreateParams & params = { } )
Parameters
facea valid freetype font face. The face is referenced and the font data is copied
paramsfont creation params
Returns
a PdfFont object or nullptr if the font could not be created or found.

◆ SearchFont()

PdfFont * PoDoFo::PdfFontManager::SearchFont ( const std::string_view & fontPattern,
const PdfFontSearchParams & searchParams = { },
const PdfFontCreateParams & createParams = { } )

Get a font from the cache. If the font does not yet exist, add it to the cache.

Parameters
fontPatterna search font pattern
paramsfont creation params
Returns
a PdfFont object or nullptr if the font could not be created or found.

◆ SearchFontMetrics()

PdfFontMetricsConstPtr PdfFontManager::SearchFontMetrics ( const std::string_view & fontPattern,
const PdfFontSearchParams & params = { } )
static

Try to search for fontmetrics from the given fontname and parameters

Returns
the found metrics. Null if not found