• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #ifndef CORE_FPDFAPI_FONT_CPDF_CMAPMANAGER_H_
8 #define CORE_FPDFAPI_FONT_CPDF_CMAPMANAGER_H_
9 
10 #include <map>
11 #include <memory>
12 
13 #include "core/fpdfapi/font/cpdf_cidfont.h"
14 #include "core/fxcrt/bytestring.h"
15 #include "core/fxcrt/retain_ptr.h"
16 
17 class CPDF_CMapManager {
18  public:
19   CPDF_CMapManager();
20   ~CPDF_CMapManager();
21 
22   RetainPtr<CPDF_CMap> GetPredefinedCMap(const ByteString& name,
23                                          bool bPromptCJK);
24   CPDF_CID2UnicodeMap* GetCID2UnicodeMap(CIDSet charset, bool bPromptCJK);
25 
26  private:
27   RetainPtr<CPDF_CMap> LoadPredefinedCMap(const ByteString& name,
28                                           bool bPromptCJK);
29   std::unique_ptr<CPDF_CID2UnicodeMap> LoadCID2UnicodeMap(CIDSet charset,
30                                                           bool bPromptCJK);
31 
32   std::map<ByteString, RetainPtr<CPDF_CMap>> m_CMaps;
33   std::unique_ptr<CPDF_CID2UnicodeMap> m_CID2UnicodeMaps[6];
34 };
35 
36 #endif  // CORE_FPDFAPI_FONT_CPDF_CMAPMANAGER_H_
37