PoDoFo 1.1.0
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
50#if PODOFO_3RDPARTY_INTEROP_ENABLED
55
57#endif // PODOFO_3RDPARTY_INTEROP_ENABLED
58
60
72 std::string SearchFontPath(const std::string_view fontPattern, unsigned& faceIndex);
73 std::string SearchFontPath(const std::string_view fontPattern, const PdfFontConfigSearchParams& params,
74 unsigned& faceIndex);
75
76 void AddFontDirectory(const std::string_view& path);
77
78private:
80 const PdfFontConfigWrapper& operator=(const PdfFontConfigWrapper& rhs) = delete;
81
82 void createDefaultConfig();
83
84private:
85 FcConfig* m_FcConfig;
86};
87
88};
89
90ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontConfigSearchFlags);
91
92#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.