1 // Copyright 2016 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_FXGE_CFX_UNICODEENCODING_H_ 8 #define CORE_FXGE_CFX_UNICODEENCODING_H_ 9 10 #include <stdint.h> 11 12 #ifdef PDF_ENABLE_XFA 13 #define FXFM_ENC_TAG(a, b, c, d) \ 14 (((uint32_t)(a) << 24) | ((uint32_t)(b) << 16) | ((uint32_t)(c) << 8) | \ 15 (uint32_t)(d)) 16 #define FXFM_ENCODING_NONE FXFM_ENC_TAG(0, 0, 0, 0) 17 #define FXFM_ENCODING_MS_SYMBOL FXFM_ENC_TAG('s', 'y', 'm', 'b') 18 #define FXFM_ENCODING_UNICODE FXFM_ENC_TAG('u', 'n', 'i', 'c') 19 #define FXFM_ENCODING_MS_SJIS FXFM_ENC_TAG('s', 'j', 'i', 's') 20 #define FXFM_ENCODING_MS_GB2312 FXFM_ENC_TAG('g', 'b', ' ', ' ') 21 #define FXFM_ENCODING_MS_BIG5 FXFM_ENC_TAG('b', 'i', 'g', '5') 22 #define FXFM_ENCODING_MS_WANSUNG FXFM_ENC_TAG('w', 'a', 'n', 's') 23 #define FXFM_ENCODING_MS_JOHAB FXFM_ENC_TAG('j', 'o', 'h', 'a') 24 #define FXFM_ENCODING_ADOBE_STANDARD FXFM_ENC_TAG('A', 'D', 'O', 'B') 25 #define FXFM_ENCODING_ADOBE_EXPERT FXFM_ENC_TAG('A', 'D', 'B', 'E') 26 #define FXFM_ENCODING_ADOBE_CUSTOM FXFM_ENC_TAG('A', 'D', 'B', 'C') 27 #define FXFM_ENCODING_ADOBE_LATIN_1 FXFM_ENC_TAG('l', 'a', 't', '1') 28 #define FXFM_ENCODING_OLD_LATIN_2 FXFM_ENC_TAG('l', 'a', 't', '2') 29 #define FXFM_ENCODING_APPLE_ROMAN FXFM_ENC_TAG('a', 'r', 'm', 'n') 30 #endif // PDF_ENABLE_XFA 31 32 class CFX_Font; 33 34 class CFX_UnicodeEncoding { 35 public: 36 explicit CFX_UnicodeEncoding(CFX_Font* pFont); 37 virtual ~CFX_UnicodeEncoding(); 38 39 virtual uint32_t GlyphFromCharCode(uint32_t charcode); 40 41 protected: 42 CFX_Font* m_pFont; // Unowned, not nullptr. 43 }; 44 45 #endif // CORE_FXGE_CFX_UNICODEENCODING_H_ 46