7#include "PdfEncodingMap.h"
10#include "PdfCIDToGIDMap.h"
28 bool IsEndOfString()
const;
37 std::string_view::iterator m_it;
38 std::string_view::iterator m_end;
40 PdfEncodingLimits m_limits;
84 static std::unique_ptr<PdfEncoding> CreateDynamicEncoding(std::shared_ptr<PdfCharCodeMap>&&
cidMap,
95 charbuff ConvertToEncoded(
const std::string_view&
str)
const;
116 char32_t GetCodePoint(
unsigned charCode)
const;
133 bool HasCIDMapping()
const;
137 bool IsSimpleEncoding()
const;
140 bool HasParsedLimits()
const;
143 bool IsDynamicEncoding()
const;
146 unsigned GetId()
const {
return m_Id; }
154 const PdfEncodingLimits& GetLimits()
const;
156 bool HasValidToUnicodeMap()
const;
173 const PdfEncodingMap& GetEncodingMap()
const {
return *m_Encoding; }
175 PdfEncodingMapConstPtr GetEncodingMapPtr()
const {
return m_Encoding; }
180 PdfEncoding& operator=(
const PdfEncoding&) =
default;
184 void ExportToFont(PdfFont& font,
const PdfCIDSystemInfo& cidInfo)
const;
185 void ExportToFont(PdfFont& font)
const;
186 bool TryGetCIDId(
const PdfCharCode& codeUnit,
unsigned& cid)
const;
187 const PdfCIDToGIDMap* GetCIDToGIDMap()
const {
return m_CIDToGIDMap.get(); }
189 static unsigned GetNextId();
192 void exportToFont(PdfFont& font,
const PdfCIDSystemInfo* cidInfo)
const;
193 bool tryExportEncodingTo(PdfDictionary& dictionary,
bool wantCidMapping)
const;
194 bool tryConvertEncodedToUtf8(
const std::string_view& encoded, std::string& str)
const;
195 bool tryConvertEncodedToCIDs(
const std::string_view& encoded, std::vector<PdfCID>& cids)
const;
196 void writeCIDMapping(PdfObject& cmapObj,
const PdfFont& font,
const PdfCIDSystemInfo& info)
const;
197 void writeToUnicodeCMap(PdfObject& cmapObj,
const PdfFont& font)
const;
198 bool tryGetCharCode(PdfFont& font,
unsigned gid,
const unicodeview& codePoints, PdfCharCode& unit)
const;
202 bool m_IsObjectLoaded;
203 PdfEncodingLimits m_ParsedLimits;
207 PdfCIDToGIDMapConstPtr m_CIDToGIDMap;
A memory owning immutable block of code points, optimized for small segments as up to 3 elements can ...
Definition PdfEncodingCommon.h:119
This factory creates a PdfEncoding from an existing object in the PDF.
Definition PdfEncodingFactory.h:16
A PdfEncodingMap is a low level interface to convert between utf8 and encoded strings in and to deter...
Definition PdfEncodingMap.h:28
A PdfEncoding is in PdfFont to transform a text string into a representation so that it can be displa...
Definition PdfEncoding.h:51
bool IsObjectLoaded() const
True if the encoding is constructed from object loaded information.
Definition PdfEncoding.h:149
unsigned GetId() const
Return an Id to be used in hashed containers.
Definition PdfEncoding.h:146
A PdfFont that represents a CID-keyed font that has a TrueType/OpenType font backend (aka "CIDFontTyp...
Definition PdfFontCIDTrueType.h:14
A PdfFont that represents a CID-keyed font.
Definition PdfFontCID.h:14
This is a common base class for simple, non CID-keyed fonts like Type1, TrueType and Type3.
Definition PdfFontSimple.h:17
Before you can draw text on a PDF document, you have to create a font object first.
Definition PdfFont.h:42
A PDF string context to iteratively scan a string and collect both CID and unicode codepoints.
Definition PdfEncoding.h:21
A string that can be written to a PDF document.
Definition PdfString.h:21
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:30
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13
std::shared_ptr< const PdfEncodingMap > PdfToUnicodeMapConstPtr
Convenience alias for a const /ToUnicode CMap entry shared ptr.
Definition PdfEncodingMap.h:317
@ Create
Create a new file or truncate existing one for writing/reading.
std::shared_ptr< const PdfEncodingMap > PdfEncodingMapConstPtr
Convenience typedef for a const /Encoding map entry shared ptr.
Definition PdfEncodingMap.h:311
Represent a CID (Character ID) with full code unit information.
Definition PdfEncodingCommon.h:43
A character code unit.
Definition PdfEncodingCommon.h:16