PoDoFo  1.0.0-dev
PdfCIDToGIDMap.h
1 
7 #ifndef PDF_CID_TO_GID_MAP_H
8 #define PDF_CID_TO_GID_MAP_H
9 
10 #include "PdfDeclarations.h"
11 #include "PdfObject.h"
12 
13 namespace PoDoFo
14 {
18  class PdfCIDToGIDMap final
19  {
20  public:
21  using iterator = CIDToGIDMap::const_iterator;
22 
23  public:
25  PdfCIDToGIDMap(const PdfCIDToGIDMap&) = default;
26  PdfCIDToGIDMap(PdfCIDToGIDMap&&) noexcept = default;
27 
28  static PdfCIDToGIDMap Create(const PdfObject& cidToGidMapObj, PdfGlyphAccess access);
29 
30  public:
31  bool TryMapCIDToGID(unsigned cid, unsigned& gid) const;
32  void ExportTo(PdfObject& descendantFont);
33 
36  bool HasGlyphAccess(PdfGlyphAccess access) const;
37 
38  public:
39  unsigned GetSize() const;
40  iterator begin() const;
41  iterator end() const;
42 
43  private:
44  CIDToGIDMap m_cidToGidMap;
45  PdfGlyphAccess m_access;
46  };
47 
48  using PdfCIDToGIDMapConstPtr = std::shared_ptr<const PdfCIDToGIDMap>;
49 }
50 
51 #endif // PDF_CID_TO_GID_MAP_H
SPDX-FileCopyrightText: (C) 2005 Dominik Seichter domseichter@web.de SPDX-FileCopyrightText: (C) 2020...
Helper class to handle the /CIDToGIDMap entry in a Type2 CID font or /TrueType fonts implicit CID to ...
Definition: PdfCIDToGIDMap.h:19
bool HasGlyphAccess(PdfGlyphAccess access) const
Determines if the current map provides the queried glyph access.
Definition: PdfCIDToGIDMap.cpp:72
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
PdfGlyphAccess
When accessing a glyph, there may be a difference in the glyph ID to retrieve the width or to index i...
Definition: PdfDeclarations.h:294
std::map< unsigned, unsigned > CIDToGIDMap
A backing storage for a CID to GID map.
Definition: PdfDeclarations.h:847