PoDoFo
1.0.0-dev
|
A PdfEncoding is in PdfFont to transform a text string into a representation so that it can be displayed in a PDF file. More...
#include <PdfEncoding.h>
Public Member Functions | |
PdfEncoding () | |
Null encoding, when used as an actual encoding a dynamic encoding will be constructed instead. | |
PdfEncoding (const PdfEncodingMapConstPtr &encoding, const PdfToUnicodeMapConstPtr &toUnicode=nullptr) | |
PdfEncoding (const PdfEncoding &)=default | |
std::string | ConvertToUtf8 (const PdfString &encodedStr) const |
bool | TryConvertToUtf8 (const PdfString &encodedStr, std::string &str) const |
charbuff | ConvertToEncoded (const std::string_view &str) const |
bool | TryConvertToEncoded (const std::string_view &str, charbuff &encoded) const |
std::vector< PdfCID > | ConvertToCIDs (const PdfString &encodedStr) const |
bool | TryConvertToCIDs (const PdfString &encodedStr, std::vector< PdfCID > &cids) const |
char32_t | GetCodePoint (const PdfCharCode &codeUnit) const |
Get code point from char code unit. More... | |
char32_t | GetCodePoint (unsigned charCode) const |
Get code point from char code. More... | |
PdfStringScanContext | StartStringScan (const PdfString &encodedStr) |
const PdfCharCode & | GetFirstChar () const |
This return the first char code used in the encoding. More... | |
const PdfCharCode & | GetLastChar () const |
This return the last char code used in the encoding. More... | |
bool | IsNull () const |
Return true if the encoding is a dummy null encoding. | |
bool | HasCIDMapping () const |
Return true if the encoding does CID mapping. | |
bool | IsSimpleEncoding () const |
Return true if the encoding is simple and has a non-CID mapping /Encoding entry. | |
bool | HasParsedLimits () const |
Returns true if /FirstChar and /LastChar were parsed from object. | |
bool | IsDynamicEncoding () const |
Return true if the encoding is a dynamic CID mapping. | |
unsigned | GetId () const |
Return an Id to be used in hashed containers. | |
const PdfEncodingLimits & | GetLimits () const |
Get actual limits of the encoding. More... | |
bool | HasValidToUnicodeMap () const |
const PdfEncodingMap & | GetToUnicodeMap () const |
Get the ToUnicode map, throws if missing. | |
bool | GetToUnicodeMapSafe (const PdfEncodingMap *&toUnicode) const |
Get the ToUnicode map, fallback to the normal encoding if missing. More... | |
const PdfEncodingMap & | GetToUnicodeMapSafe () const |
Get the ToUnicode map, fallback to the normal encoding if missing. More... | |
const PdfEncodingMap & | GetEncodingMap () const |
const PdfEncodingMapConstPtr | GetEncodingMapPtr () const |
const PdfEncodingMapConstPtr | GetToUnicodeMapPtr () const |
PdfEncoding & | operator= (const PdfEncoding &)=default |
Friends | |
class | PdfEncodingFactory |
class | PdfFont |
class | PdfFontCID |
class | PdfFontCIDTrueType |
class | PdfFontSimple |
A PdfEncoding is in PdfFont to transform a text string into a representation so that it can be displayed in a PDF file.
PdfEncoding can also be used to convert strings from a PDF file back into a PdfString.
charbuff PdfEncoding::ConvertToEncoded | ( | const std::string_view & | str | ) | const |
string PdfEncoding::ConvertToUtf8 | ( | const PdfString & | encodedStr | ) | const |
char32_t PdfEncoding::GetCodePoint | ( | const PdfCharCode & | codeUnit | ) | const |
Get code point from char code unit.
char32_t PdfEncoding::GetCodePoint | ( | unsigned | charCode | ) | const |
Get code point from char code.
const PdfCharCode & PdfEncoding::GetFirstChar | ( | ) | const |
This return the first char code used in the encoding.
const PdfCharCode & PdfEncoding::GetLastChar | ( | ) | const |
This return the last char code used in the encoding.
const PdfEncodingLimits & PdfEncoding::GetLimits | ( | ) | const |
Get actual limits of the encoding.
May be the limits inferred from /Encoding or the limits inferred by /FirstChar, /LastChar
const PdfEncodingMap & PdfEncoding::GetToUnicodeMapSafe | ( | ) | const |
Get the ToUnicode map, fallback to the normal encoding if missing.
bool PdfEncoding::GetToUnicodeMapSafe | ( | const PdfEncodingMap *& | toUnicode | ) | const |
Get the ToUnicode map, fallback to the normal encoding if missing.
toUnicode | the retrieved map |
bool PdfEncoding::TryConvertToCIDs | ( | const PdfString & | encodedStr, |
std::vector< PdfCID > & | cids | ||
) | const |
bool PdfEncoding::TryConvertToUtf8 | ( | const PdfString & | encodedStr, |
std::string & | str | ||
) | const |