PoDoFo  1.0.0-dev
PdfFontCID.h
1 
7 #ifndef PDF_FONT_CID_H
8 #define PDF_FONT_CID_H
9 
10 #include "PdfFont.h"
11 
12 namespace PoDoFo {
13 
16 class PODOFO_API PdfFontCID : public PdfFont
17 {
18  friend class PdfFont;
19  friend class PdfFontCIDTrueType;
20  friend class PdfFontCIDCFF;
21 
22 private:
23  PdfFontCID(PdfDocument& doc, const PdfFontMetricsConstPtr& metrics,
24  const PdfEncoding& encoding);
25 
26 public:
27  bool SupportsSubsetting() const override;
28 
29 protected:
30  void embedFont() override;
31  PdfObject* getDescendantFontObject() override;
32  void createWidths(PdfDictionary& fontDict, const CIDToGIDMap& glyphWidths);
33  static CIDToGIDMap getCIDToGIDMapSubset(const UsedGIDsMap& usedGIDs);
34 
35 private:
36  CIDToGIDMap getIdentityCIDToGIDMap();
37 
38 protected:
39  void initImported() override;
40 
41 protected:
42  PdfObject& GetDescendantFont() { return *m_descendantFont; }
43  PdfObject& GetDescriptor() { return *m_descriptor; }
44 
45 private:
46  PdfObject* m_descendantFont;
47  PdfObject* m_descriptor;
48 };
49 
50 };
51 
52 #endif // PDF_FONT_CID_H
The PDF dictionary data type of PoDoFo (inherits from PdfDataContainer, the base class for such repre...
Definition: PdfDictionary.h:82
PdfDocument is the core interface for working with PDF documents.
Definition: PdfDocument.h:108
A PdfEncoding is in PdfFont to transform a text string into a representation so that it can be displa...
Definition: PdfEncoding.h:55
A PdfFont that represents a CID-keyed font that has a CFF font backend (aka "CIDFontType0")
Definition: PdfFontCIDCFF.h:17
A PdfFont that represents a CID-keyed font that has a TrueType/OpenType font backend (aka "CIDFontTyp...
Definition: PdfFontCIDTrueType.h:17
A PdfFont that represents a CID-keyed font.
Definition: PdfFontCID.h:17
Before you can draw text on a PDF document, you have to create a font object first.
Definition: PdfFont.h:49
This class represents a PDF indirect Object in memory.
Definition: PdfObject.h:35
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition: basetypes.h:16
std::shared_ptr< const PdfFontMetrics > PdfFontMetricsConstPtr
Convenience typedef for a const PdfEncoding shared ptr.
Definition: PdfFontMetrics.h:24
std::map< unsigned, unsigned > CIDToGIDMap
A backing storage for a CID to GID map.
Definition: PdfDeclarations.h:847