4#ifndef PDF_ENCODING_COMMON_H
5#define PDF_ENCODING_COMMON_H
15 struct PODOFO_API PdfCharCode final
20 unsigned char CodeSpaceSize;
25 explicit PdfCharCode(
unsigned code);
27 PdfCharCode(
unsigned code,
unsigned char codeSpaceSize);
29 bool operator<(
const PdfCharCode& rhs)
const;
31 bool operator==(
const PdfCharCode& rhs)
const;
33 bool operator!=(
const PdfCharCode& rhs)
const;
36 unsigned GetByteCode(
unsigned char byteIdx)
const;
37 void AppendTo(std::string& str)
const;
38 void WriteHexTo(std::string& str,
bool wrap =
true)
const;
42 struct PODOFO_API PdfCID final
50 explicit PdfCID(
unsigned id);
59 struct PODOFO_API PdfGID final
68 PdfGID(
unsigned id,
unsigned metricsId);
79 struct PODOFO_API PdfEncodingLimits final
82 PdfEncodingLimits(
unsigned char minCodeSize,
unsigned char maxCodeSize,
90 bool AreValid()
const;
94 bool HaveValidCodeSizeRange()
const;
98 unsigned char MinCodeSize;
99 unsigned char MaxCodeSize;
102 struct PODOFO_API PdfCIDSystemInfo final
118 class PODOFO_API CodePointSpan final
124 CodePointSpan(std::initializer_list<codepoint> codepoints);
125 CodePointSpan(
const codepointview& view);
127 CodePointSpan(
const CodePointSpan&);
128 void CopyTo(std::vector<codepoint>& codePoints)
const;
129 codepointview view()
const;
130 unsigned GetSize()
const;
131 CodePointSpan& operator=(
const CodePointSpan&);
135 operator codepointview()
const;
147 std::array<codepoint, 3> Data;
153 std::unique_ptr<codepoint[]> Data;
160 using CodeUnitMap = std::unordered_map<PdfCharCode, CodePointSpan>;
171 return code.CodeSpaceSize << 24 | code.Code;
codepoint operator*() const
Return the first element in the block.
Definition PdfEncodingCommon.cpp:283
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13
char32_t codepoint
A convenient typedef for an unspecified codepoint The underlying type is conveniently char32_t so it'...
Definition PdfEncodingCommon.h:113
tcb::span< const T, Extent > cspan
Constant span.
Definition span.h:18
A character code unit.
Definition PdfEncodingCommon.h:16
Represents a bundle of a CID and GID information.
Definition PdfEncodingCommon.h:73
PdfGID Gid
The identifier of the glyph in font program and PDF metrics.
Definition PdfEncodingCommon.h:76
unsigned Cid
The new assigned identifier of the character.
Definition PdfEncodingCommon.h:74
unsigned OrigCid
The original identifier of the character.
Definition PdfEncodingCommon.h:75
Represents a GID (Glyph ID) with PDF metrics identifier.
Definition PdfEncodingCommon.h:60
unsigned MetricsId
The id of the glyph in the PDF metrics (/Widths, /W arrays). In case of Type 0 CIDFonts this effectiv...
Definition PdfEncodingCommon.h:62
unsigned Id
The id of the glyph in the font program.
Definition PdfEncodingCommon.h:61