PoDoFo  1.0.0-dev
Public Member Functions | List of all members
PoDoFo::PdfFontConfigWrapper Class Referencefinal

This class initializes and destroys the FontConfig library. More...

#include <PdfFontConfigWrapper.h>

Public Member Functions

 PdfFontConfigWrapper (const std::string_view &configStr)
 Create a new FontConfigWrapper from a XML config string.
 
 PdfFontConfigWrapper (FcConfig *fcConfig=nullptr)
 Create a new FontConfigWrapper and initialize the fontconfig library.
 
std::string SearchFontPath (const std::string_view fontPattern, unsigned &faceIndex)
 Get the path of a font file on a Unix system using fontconfig. More...
 
std::string SearchFontPath (const std::string_view fontPattern, const PdfFontConfigSearchParams &params, unsigned &faceIndex)
 
void AddFontDirectory (const std::string_view &path)
 
FcConfig * GetFcConfig ()
 

Detailed Description

This class initializes and destroys the FontConfig library.

As initializing fontconfig can take a long time, you can create a wrapper by yourself to cache initialization of fontconfig.

This class is reference counted. The last user of the fontconfig library will destroy the fontconfig handle.

The fontconfig library is initialized on first used (lazy loading!)

Member Function Documentation

◆ SearchFontPath()

std::string PoDoFo::PdfFontConfigWrapper::SearchFontPath ( const std::string_view  fontPattern,
unsigned &  faceIndex 
)

Get the path of a font file on a Unix system using fontconfig.

This method is only available if PoDoFo was compiled with fontconfig support. Make sure to lock any FontConfig mutexes before calling this method by yourself!

Parameters
fontPatternsearch pattern of the requested font
stylefont style
faceIndexindex of the face
Returns
the path to the fontfile or an empty string

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