PoDoFo  1.0.0-dev
Public Member Functions | Static Public Member Functions | Friends | List of all members
PoDoFo::PdfFontManager Class Referencefinal

This class assists PdfDocument with caching font information. More...

#include <PdfFontManager.h>

Public Member Functions

PdfFontSearchFont (const std::string_view &fontPattern, const PdfFontSearchParams &searchParams={ }, const PdfFontCreateParams &createParams={ })
 Get a font from the cache. More...
 
PdfFontSearchFont (const std::string_view &fontPattern, const PdfFontCreateParams &createParams)
 
PdfFontGetStandard14Font (PdfStandard14FontType stdFont, const PdfFontCreateParams &params={ })
 
PdfFontGetOrCreateFont (const std::string_view &fontPath, unsigned faceIndex, const PdfFontCreateParams &params={ })
 
PdfFontGetOrCreateFontFromBuffer (const bufferview &buffer, unsigned faceIndex, const PdfFontCreateParams &params={ })
 
PdfFontGetOrCreateFont (const std::string_view &fontPath, const PdfFontCreateParams &params={ })
 
PdfFontGetOrCreateFontFromBuffer (const bufferview &buffer, const PdfFontCreateParams &params={ })
 
PdfFontGetOrCreateFont (const PdfFontMetricsConstPtr &metrics, const PdfFontCreateParams &params={ })
 
PdfFontGetCachedFont (const PdfReference &ref)
 Try getting the font from the cached font map Can return nullptr.
 
void EmbedFonts ()
 Called by PdfDocument before saving.
 

Static Public Member Functions

static PdfFontMetricsConstPtr SearchFontMetrics (const std::string_view &fontPattern, const PdfFontSearchParams &params={ })
 Try to search for fontmetrics from the given fontname and parameters. More...
 

Friends

class PdfDocument
 
class PdfMemDocument
 
class PdfStreamedDocument
 
class PdfFont
 
class PdfCommon
 
class PdfResources
 

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 information.

See also
PdfDocument

Member Function Documentation

◆ 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

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