pdfmm 0.9.20
Public Member Functions | List of all members
mm::PdfCharCodeMap Class Reference

#include <PdfCharCodeMap.h>

Public Member Functions

void PushMapping (const PdfCharCode &codeUnit, const cspan< char32_t > &codePoints)
 
void PushMapping (const PdfCharCode &codeUnit, char32_t codePoint)
 
bool TryGetCodePoints (const PdfCharCode &codeUnit, std::vector< char32_t > &codePoints) const
 
bool TryGetNextCharCode (std::string_view::iterator &it, const std::string_view::iterator &end, PdfCharCode &code) const
 
bool TryGetCharCode (const cspan< char32_t > &codePoints, PdfCharCode &code) const
 
bool TryGetCharCode (char32_t codePoint, PdfCharCode &code) const
 

Detailed Description

A bidirectional map from character code units to generic code points

Remarks
Code points actual encoding is unspecified, but it can be unicode code points or CID(s) as for CID keyed fonts For generic terminology see https://en.wikipedia.org/wiki/Character_encoding#Terminology See also 5014.CIDFont_Spec, 2.1 Terminology

Member Function Documentation

◆ PushMapping() [1/2]

void PdfCharCodeMap::PushMapping ( const PdfCharCode codeUnit,
char32_t  codePoint 
)

Convenience method to push a single code point mapping

◆ PushMapping() [2/2]

void PdfCharCodeMap::PushMapping ( const PdfCharCode codeUnit,
const cspan< char32_t > &  codePoints 
)

Method to push a mapping. Given string can be a ligature, es "ffi"

◆ TryGetCharCode() [1/2]

bool PdfCharCodeMap::TryGetCharCode ( char32_t  codePoint,
PdfCharCode code 
) const

Try get char code from unicode code point

◆ TryGetCharCode() [2/2]

bool PdfCharCodeMap::TryGetCharCode ( const cspan< char32_t > &  codePoints,
PdfCharCode code 
) const

Try get char code from unicode code points

Parameters
codePointssequence of unicode code points. All the sequence must match

◆ TryGetCodePoints()

bool PdfCharCodeMap::TryGetCodePoints ( const PdfCharCode codeUnit,
std::vector< char32_t > &  codePoints 
) const

Returns false when no mapped identifiers are not found in the map

◆ TryGetNextCharCode()

bool PdfCharCodeMap::TryGetNextCharCode ( std::string_view::iterator &  it,
const std::string_view::iterator &  end,
PdfCharCode code 
) const

Try get char code from utf8 encoded range

Remarks
It assumes it != and it will consumes the interator also when returning false