PoDoFo 1.0.0-dev
Loading...
Searching...
No Matches
PdfFontConfigWrapper.h
1
7#ifndef PDF_FONT_CONFIG_WRAPPER_H
8#define PDF_FONT_CONFIG_WRAPPER_H
9
10#include "PdfDeclarations.h"
11
12FORWARD_DECLARE_FCONFIG();
13
14namespace PoDoFo {
15
17{
18 None = 0,
20};
21
22struct PODOFO_API PdfFontConfigSearchParams final
23{
24 nullable<PdfFontStyle> Style;
25 PdfFontConfigSearchFlags Flags = PdfFontConfigSearchFlags::None;
27 std::string FontFamilyPattern;
28};
29
43{
44public:
48 PdfFontConfigWrapper(const std::string_view& configStr);
49
54
56
68 std::string SearchFontPath(const std::string_view fontPattern, unsigned& faceIndex);
69 std::string SearchFontPath(const std::string_view fontPattern, const PdfFontConfigSearchParams& params,
70 unsigned& faceIndex);
71
72 void AddFontDirectory(const std::string_view& path);
73
74 FcConfig* GetFcConfig();
75
76private:
78 const PdfFontConfigWrapper& operator=(const PdfFontConfigWrapper& rhs) = delete;
79
80 void createDefaultConfig();
81
82private:
83 FcConfig* m_FcConfig;
84};
85
86};
87
88ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontConfigSearchFlags);
89
90#endif // PDF_FONT_CONFIG_WRAPPER_H
SPDX-FileCopyrightText: (C) 2005 Dominik Seichter domseichter@web.de SPDX-FileCopyrightText: (C) 2020...
This class initializes and destroys the FontConfig library.
Definition PdfFontConfigWrapper.h:43
std::string SearchFontPath(const std::string_view fontPattern, unsigned &faceIndex)
Get the path of a font file on a Unix system using fontconfig.
PdfFontConfigWrapper(const std::string_view &configStr)
Create a new FontConfigWrapper from a XML config string.
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:38
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition basetypes.h:16
PdfFontConfigSearchFlags
Definition PdfFontConfigWrapper.h:17
@ None
Do not add a default appearrance.
@ SkipMatchPostScriptName
Skip matching postscript font name.