• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 The PDFium Authors
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_CMAPS_FPDF_CMAPS_H_
8 #define CORE_FPDFAPI_CMAPS_FPDF_CMAPS_H_
9 
10 #include <stdint.h>
11 
12 namespace fxcmap {
13 
14 struct DWordCIDMap {
15   uint16_t m_HiWord;
16   uint16_t m_LoWordLow;
17   uint16_t m_LoWordHigh;
18   uint16_t m_CID;
19 };
20 
21 struct CMap {
22   enum class Type : bool { kSingle, kRange };
23 
24   const char* m_Name;              // Raw, POD struct.
25   const uint16_t* m_pWordMap;      // Raw, POD struct.
26   const DWordCIDMap* m_pDWordMap;  // Raw, POD struct.
27   uint16_t m_WordCount;
28   uint16_t m_DWordCount;
29   Type m_WordMapType;
30   int8_t m_UseOffset;
31 };
32 
33 uint16_t CIDFromCharCode(const CMap* pMap, uint32_t charcode);
34 uint32_t CharCodeFromCID(const CMap* pMap, uint16_t cid);
35 
36 }  // namespace fxcmap
37 
38 #endif  // CORE_FPDFAPI_CMAPS_FPDF_CMAPS_H_
39