PoDoFo
1.0.0-dev
|
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 ¶ms, unsigned &faceIndex) |
void | AddFontDirectory (const std::string_view &path) |
FcConfig * | GetFcConfig () |
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!)
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!
fontPattern | search pattern of the requested font |
style | font style |
faceIndex | index of the face |