PoDoFo  1.0.0-dev
PdfEncodingMapFactory.h
1 
7 #ifndef PDF_ENCODING_MAP_FACTORY_H
8 #define PDF_ENCODING_MAP_FACTORY_H
9 
10 #include "PdfEncodingMap.h"
11 #include "PdfCMapEncoding.h"
12 
13 namespace PoDoFo {
14 
17 class PODOFO_API PdfEncodingMapFactory final
18 {
19  friend class PdfEncoding;
20  friend class PdfEncodingFactory;
21  friend class PdfDifferenceEncoding;
22  friend class PdfFontMetricsFreetype;
23 
24 public:
28  static bool TryParseCMapEncoding(const PdfObject& cmapObj, std::unique_ptr<PdfEncodingMap>& encoding);
29 
34  static std::unique_ptr<PdfEncodingMap> ParseCMapEncoding(const PdfObject& cmapObj);
35 
43  static PdfBuiltInEncodingConstPtr WinAnsiEncodingInstance();
44 
50  static PdfBuiltInEncodingConstPtr MacRomanEncodingInstance();
51 
57  static PdfBuiltInEncodingConstPtr MacExpertEncodingInstance();
58 
64  static PdfEncodingMapConstPtr TwoBytesHorizontalIdentityEncodingInstance();
65 
71  static PdfEncodingMapConstPtr TwoBytesVerticalIdentityEncodingInstance();
72 
75  static PdfEncodingMapConstPtr GetStandard14FontEncodingMap(PdfStandard14FontType stdFont);
76 
80  static PdfCMapEncodingConstPtr GetPredefinedCMap(const std::string_view& cmapName);
81 
82 private:
83  PdfEncodingMapFactory() = delete;
84 
85  // The following encodings are for internal use only
86 
87  static PdfBuiltInEncodingConstPtr StandardEncodingInstance();
88 
89  static PdfBuiltInEncodingConstPtr SymbolEncodingInstance();
90 
91  static PdfBuiltInEncodingConstPtr ZapfDingbatsEncodingInstance();
92 
93  static PdfBuiltInEncodingConstPtr AppleLatin1EncodingInstance();
94 
95  static PdfEncodingMapConstPtr GetNullEncodingMap();
96 };
97 
98 }
99 
100 #endif // PDF_ENCODING_MAP_FACTORY_H
PdfDifferenceEncoding is an encoding, which is based on either the fonts encoding or a predefined enc...
Definition: PdfDifferenceEncoding.h:108
This factory creates a PdfEncoding from an existing object in the PDF.
Definition: PdfEncodingFactory.h:20
This factory creates a PdfEncodingMap.
Definition: PdfEncodingMapFactory.h:18
A PdfEncoding is in PdfFont to transform a text string into a representation so that it can be displa...
Definition: PdfEncoding.h:55
This class represents a PDF indirect Object in memory.
Definition: PdfObject.h:35
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition: basetypes.h:16
std::shared_ptr< const PdfCMapEncoding > PdfCMapEncodingConstPtr
Convenience typedef for a const CMap encoding shared ptr.
Definition: PdfCMapEncoding.h:25
std::shared_ptr< const PdfBuiltInEncoding > PdfBuiltInEncodingConstPtr
Convenience typedef for a const /Encoding map entry shared ptr.
Definition: PdfEncodingMap.h:347
std::shared_ptr< const PdfEncodingMap > PdfEncodingMapConstPtr
Convenience typedef for a const /Encoding map entry shared ptr.
Definition: PdfEncodingMap.h:343