PoDoFo 1.0.0-dev
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Friends | List of all members
PoDoFo::PdfFontCIDCFF Class Referencefinal

A PdfFont that represents a CID-keyed font that has a CFF font backend (aka "CIDFontType0") More...

#include <PdfFontCIDCFF.h>

Inheritance diagram for PoDoFo::PdfFontCIDCFF:
PoDoFo::PdfFontCID PoDoFo::PdfFont

Public Member Functions

bool SupportsSubsetting () const override
 
PdfFontType GetType () const override
 
- Public Member Functions inherited from PoDoFo::PdfFont
bool TryCreateProxyFont (PdfFont *&proxyFont) const
 Try create a replacement font that can be used for rendering or font program embedding based on this font characteristics.
 
bool TryCreateProxyFont (PdfFontCreateFlags initFlags, PdfFont *&proxyFont) const
 
void WriteStringToStream (OutputStream &stream, const std::string_view &str) const
 Write a string to a PdfObjectStream in a format so that it can be used with this font.
 
unsigned GetGID (char32_t codePoint, PdfGlyphAccess access) const
 Get the GID by the codePoint.
 
bool TryGetGID (char32_t codePoint, PdfGlyphAccess access, unsigned &gid) const
 
double GetStringLength (const std::string_view &str, const PdfTextState &state) const
 Retrieve the width of a given text string in PDF units when drawn with the current font.
 
bool TryGetStringLength (const std::string_view &str, const PdfTextState &state, double &width) const
 
double GetEncodedStringLength (const PdfString &encodedStr, const PdfTextState &state) const
 Retrieve the width of a given encoded PdfString in PDF units when drawn with the current font.
 
bool TryGetEncodedStringLength (const PdfString &encodedStr, const PdfTextState &state, double &length) const
 
bool TryScanEncodedString (const PdfString &encodedStr, const PdfTextState &state, std::string &utf8str, std::vector< double > &lengths, std::vector< unsigned > &positions) const
 Scan string decoding unicode codepoints and obtaining glyphs lengths.
 
double GetWordSpacingLength (const PdfTextState &state) const
 
double GetSpaceCharLength (const PdfTextState &state) const
 
double GetCharLength (char32_t codePoint, const PdfTextState &state, bool ignoreCharSpacing=false) const
 
bool TryGetCharLength (char32_t codePoint, const PdfTextState &state, bool ignoreCharSpacing, double &width) const
 
bool TryGetCharLength (char32_t codePoint, const PdfTextState &state, double &width) const
 
double GetDefaultCharLength (const PdfTextState &state, bool ignoreCharSpacing=false) const
 
void AddSubsetCIDs (const PdfString &encodedStr)
 Split the given string by white spaces.
 
bool HasCIDSubset () const
 True if the font has defines a custom subset and needs CID /Encoding writing.
 
double GetCIDWidth (unsigned cid) const
 Get the final unscaled width of a CID identifier from the provided /Widths, /W arrays.
 
double GetLineSpacing (const PdfTextState &state) const
 Retrieve the line spacing for this font.
 
double GetUnderlineThickness (const PdfTextState &state) const
 Get the width of the underline for the current font size in PDF units.
 
double GetUnderlinePosition (const PdfTextState &state) const
 Return the position of the underline for the current font size in PDF units.
 
double GetStrikeThroughPosition (const PdfTextState &state) const
 Return the position of the strikethrough for the current font size in PDF units.
 
double GetStrikeThroughThickness (const PdfTextState &state) const
 Get the width of the strikethrough for the current font size in PDF units.
 
double GetAscent (const PdfTextState &state) const
 Get the ascent of this font in PDF units for the current font size.
 
double GetDescent (const PdfTextState &state) const
 Get the descent of this font in PDF units for the current font size.
 
bool IsStandard14Font () const
 
bool IsStandard14Font (PdfStandard14FontType &std14Font) const
 
bool IsCIDFont () const
 True if the font is a composite CIDFont.
 
virtual bool IsObjectLoaded () const
 True if the font is loaded from a PdfObject.
 
bool IsSubsettingEnabled () const
 Check if this is a subsetting font.
 
bool IsEmbeddingEnabled () const
 
std::string_view GetSubsetPrefix () const
 
const PdfEncodingGetEncoding () const
 Returns a reference to the fonts encoding.
 
const PdfFontMetricsGetMetrics () const
 Returns a handle to the fontmetrics object of this font.
 
const std::string & GetName () const
 Get the base font name of this font.
 
bool IsProxy () const
 True if the font is substitute for embedding.
 
PdfObjectGetDescendantFontObject ()
 

Protected Member Functions

void embedFontFileSubset (const std::vector< PdfCharGIDInfo > &infos, const PdfCIDSystemInfo &cidInfo) override
 
- Protected Member Functions inherited from PoDoFo::PdfFontCID
void embedFont () override
 
void embedFontSubset () override
 
PdfObjectgetDescendantFontObject () override
 
void createWidths (PdfDictionary &fontDict, const cspan< PdfCharGIDInfo > &infos)
 
void initImported () override
 Initialization tasks for imported/created from scratch fonts.
 
PdfObjectGetDescendantFont ()
 
PdfObjectGetDescriptor ()
 
- Protected Member Functions inherited from PoDoFo::PdfFont
void EmbedFontFile (PdfObject &descriptor)
 
void EmbedFontFileType1 (PdfObject &descriptor, const bufferview &data, unsigned length1, unsigned length2, unsigned length3)
 
void EmbedFontFileCFF (PdfObject &descriptor, const bufferview &data, bool cidKeyed)
 
void EmbedFontFileTrueType (PdfObject &descriptor, const bufferview &data)
 
void EmbedFontFileOpenType (PdfObject &descriptor, const bufferview &data)
 
bool tryMapCIDToGIDLoadedMetrics (unsigned cid, unsigned &gid) const
 Try to map the CID to a glyph ID using the /FirstChar, /LastChar limits.
 
bool tryMapCIDToGIDUnicode (unsigned cid, unsigned &gid) const
 Map the CID to a glyph ID in the font metrics using an Unicode map.
 
void GetBoundingBox (PdfArray &arr) const
 
void FillDescriptor (PdfDictionary &dict) const
 Fill the /FontDescriptor object dictionary.
 
bool TryGetSubstituteCIDEncoding (std::unique_ptr< PdfEncodingMap > &cidEncodingMap) const
 Try getting a map that can be used to produce a replacement CID /Encoding object.
 
PdfCIDSystemInfo GetCIDSystemInfo () const
 
std::vector< PdfCharGIDInfoGetCharGIDInfos ()
 Get an ordered list of CID/GID info entries.
 

Friends

class PdfFont
 

Additional Inherited Members

- Static Public Member Functions inherited from PoDoFo::PdfFont
static bool TryCreateFromObject (PdfObject &obj, std::unique_ptr< PdfFont > &font)
 Create a new PdfFont from an existing font in a PDF file.
 
static bool TryCreateFromObject (const PdfObject &obj, std::unique_ptr< const PdfFont > &font)
 
static std::string_view GetStandard14FontName (PdfStandard14FontType stdFont)
 
static bool IsStandard14Font (const std::string_view &fontName, PdfStandard14FontType &stdFont)
 Determine if font name is a Standard14 font.
 
static bool IsStandard14Font (const std::string_view &fontName, bool useAltNames, PdfStandard14FontType &stdFont)
 Determine if font name is a Standard14 font.
 
- Protected Attributes inherited from PoDoFo::PdfFont
PdfFontMetricsConstPtr m_Metrics
 
std::unique_ptr< PdfEncodingm_Encoding
 
std::shared_ptr< PdfCharCodeMapm_DynamicCIDMap
 
std::shared_ptr< PdfCharCodeMapm_DynamicToUnicodeMap
 

Detailed Description

A PdfFont that represents a CID-keyed font that has a CFF font backend (aka "CIDFontType0")

Member Function Documentation

◆ embedFontFileSubset()

void PdfFontCIDCFF::embedFontFileSubset ( const std::vector< PdfCharGIDInfo > &  infos,
const PdfCIDSystemInfo &  cidInfo 
)
overrideprotectedvirtual

Implements PoDoFo::PdfFontCID.

◆ GetType()

PdfFontType PdfFontCIDCFF::GetType ( ) const
overridevirtual

Implements PoDoFo::PdfFont.

◆ SupportsSubsetting()

bool PdfFontCIDCFF::SupportsSubsetting ( ) const
overridevirtual

Reimplemented from PoDoFo::PdfFontCID.


The documentation for this class was generated from the following files: