7#ifndef PDF_ENCODING_MAP_H
8#define PDF_ENCODING_MAP_H
12#include "PdfCharCodeMap.h"
16class PdfIndirectObjectList;
45 bool TryGetNextCharCode(std::string_view::iterator&
it,
67 bool TryGetNextCID(std::string_view::iterator&
it,
68 const std::string_view::iterator& end,
PdfCID&
cid)
const;
72 bool TryGetNextCodePoints(std::string_view::iterator&
it,
81 virtual const PdfEncodingLimits& GetLimits()
const = 0;
103 virtual bool HasLigaturesSupport()
const;
114 virtual bool tryGetNextCharCode(std::string_view::iterator&
it,
146 virtual int GetWModeRaw()
const;
191 bool tryGetNextCodePoints(std::string_view::iterator&
it,
const std::string_view::iterator& end,
199 PdfWModeKind GetWModeSafe()
const;
210 friend class PdfDynamicEncodingMap;
216 bool tryGetNextCharCode(std::string_view::iterator&
it,
232 inline const PdfCharCodeMap& GetCharMap()
const {
return *m_charMap; }
234 const PdfEncodingLimits& GetLimits()
const override;
240 std::shared_ptr<PdfCharCodeMap> m_charMap;
261 const PdfEncodingLimits& GetLimits()
const override;
264 PdfEncodingLimits m_Limits;
273 friend class PdfFontMetricsFreetype;
278 friend class AppleLatin1Encoding;
307 void CreateUnicodeToGIDMap(
const std::unordered_map<unsigned, unsigned>&
codeToGidMap,
308 std::unordered_map<uint32_t, unsigned>&
unicodeMap)
const;
314 void initEncodingTable();
318 std::unordered_map<char32_t, char> m_EncodingTable;
331 const PdfEncodingLimits& GetLimits()
const override;
SPDX-FileCopyrightText: (C) 2005 Dominik Seichter domseichter@web.de SPDX-FileCopyrightText: (C) 2020...
A memory owning immutable block of code points, optimized for small segments as up to 3 elements can ...
Definition PdfCharCodeMap.h:29
An interface for writing blocks of data to a data source.
Definition OutputStream.h:18
A common base class for built-in encodings which are known by name.
Definition PdfEncodingMap.h:272
virtual const char32_t * GetToUnicodeTable() const =0
Gets a table of 256 short values which are the big endian Unicode code points that are assigned to th...
const PdfName & GetName() const
Get the name of this encoding.
Definition PdfEncodingMap.h:288
A bidirectional map from character code units to unspecified code points.
Definition PdfCharCodeMap.h:132
PdfDifferenceEncoding is an encoding, which is based on either the fonts encoding or a predefined enc...
Definition PdfDifferenceEncoding.h:108
Basic PdfEncodingMap implementation using a PdfCharCodeMap.
Definition PdfEncodingMap.h:209
This factory creates a PdfEncodingMap.
Definition PdfEncodingMapFactory.h:18
PdfEncodingMap used by encodings like PdfBuiltInEncoding or PdfDifferenceEncoding that can define all...
Definition PdfEncodingMap.h:249
A PdfEncodingMap is a low level interface to convert between utf8 and encoded strings in and to deter...
Definition PdfEncodingMap.h:28
virtual bool tryGetCodePoints(const PdfCharCode &codeUnit, const unsigned *cidId, CodePointSpan &codePoints) const =0
Get code points from a code unit.
virtual void AppendToUnicodeEntries(OutputStream &stream, charbuff &temp) const =0
During a WriteToUnicodeCMap append "beginbfchar" and "beginbfrange" entries.
virtual void AppendCIDMappingEntries(OutputStream &stream, const PdfFont &font, charbuff &temp) const =0
During a PdfEncoding::ExportToFont() append "begincidchar" and/or "begincidrange" entries.
PdfEncodingMapType GetType() const
Type of encoding, may be Simple or CMap.
Definition PdfEncodingMap.h:93
virtual bool tryGetCharCode(char32_t codePoint, PdfCharCode &codeUnit) const =0
Try get char code unit from unicode code point.
A PdfEncoding is in PdfFont to transform a text string into a representation so that it can be displa...
Definition PdfEncoding.h:55
Before you can draw text on a PDF document, you have to create a font object first.
Definition PdfFont.h:45
PdfIdentityEncoding is a two-byte encoding which can be used with TrueType fonts to represent all cha...
Definition PdfIdentityEncoding.h:31
A list of PdfObjects that constitutes the indirect object list of the document The PdfParser will rea...
Definition PdfIndirectObjectList.h:30
This class represents a PdfName.
Definition PdfName.h:24
Dummy encoding map that will just throw exception.
Definition PdfEncodingMap.h:324
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:35
A common base class for Pdf defined predefined encodings which are known by name.
Definition PdfPredefinedEncoding.h:27
Represents a predefined ToUnicode CMap as the ones described in ISO 32000-2:2020 "9....
Definition PdfPredefinedToUnicodeCMap.h:21
StandardEncoding.
Definition PdfPredefinedEncoding.h:107
A PDF string context to iteratively scan a string and collect both CID and unicode codepoints.
Definition PdfEncoding.h:24
Symbol Encoding.
Definition PdfPredefinedEncoding.h:124
ZapfDingbats encoding.
Definition PdfPredefinedEncoding.h:141
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
cspan< char32_t > unicodeview
Unicode code point view.
Definition basetypes.h:27
std::shared_ptr< const PdfEncodingMap > PdfToUnicodeMapConstPtr
Convenience alias for a const /ToUnicode CMap entry shared ptr.
Definition PdfEncodingMap.h:353
std::shared_ptr< const PdfBuiltInEncoding > PdfBuiltInEncodingConstPtr
Convenience typedef for a const /Encoding map entry shared ptr.
Definition PdfEncodingMap.h:349
PdfEncodingMapType
Definition PdfDeclarations.h:125
PdfPredefinedEncodingType
Definition PdfDeclarations.h:132
std::shared_ptr< const PdfEncodingMap > PdfEncodingMapConstPtr
Convenience typedef for a const /Encoding map entry shared ptr.
Definition PdfEncodingMap.h:345
Represent a CID (Character ID) with full code unit information.
Definition PdfEncodingCommon.h:52
A character code unit.
Definition PdfEncodingCommon.h:20