OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_SRC_FXGE_GE_TEXT_INT_H_ | 7 #ifndef CORE_SRC_FXGE_GE_TEXT_INT_H_ |
8 #define CORE_SRC_FXGE_GE_TEXT_INT_H_ | 8 #define CORE_SRC_FXGE_GE_TEXT_INT_H_ |
9 | 9 |
10 struct _CFX_UniqueKeyGen { | 10 struct _CFX_UniqueKeyGen { |
(...skipping 23 matching lines...) Expand all Loading... |
34 FX_BOOL m_bBold; | 34 FX_BOOL m_bBold; |
35 FXFT_Face m_pFace; | 35 FXFT_Face m_pFace; |
36 } m_SingleFace; | 36 } m_SingleFace; |
37 struct { | 37 struct { |
38 FXFT_Face m_pFaces[16]; | 38 FXFT_Face m_pFaces[16]; |
39 } m_TTCFace; | 39 } m_TTCFace; |
40 }; | 40 }; |
41 uint8_t* m_pFontData; | 41 uint8_t* m_pFontData; |
42 int m_RefCount; | 42 int m_RefCount; |
43 }; | 43 }; |
44 class CFX_UnicodeEncoding : public IFX_FontEncoding { | |
45 public: | |
46 CFX_UnicodeEncoding(CFX_Font* pFont); | |
47 virtual FX_DWORD GlyphFromCharCodeEx(FX_DWORD charcode, | |
48 int encoding = ENCODING_UNICODE); | |
49 | 44 |
50 private: | |
51 CFX_Font* m_pFont; | |
52 virtual FX_DWORD GlyphFromCharCode(FX_DWORD charcode); | |
53 virtual CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const { | |
54 return CFX_WideString((FX_WCHAR)charcode); | |
55 } | |
56 virtual FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const { | |
57 return Unicode; | |
58 } | |
59 virtual FX_BOOL IsUnicodeCompatible() const { return TRUE; } | |
60 }; | |
61 #define CHARSET_FLAG_ANSI 1 | 45 #define CHARSET_FLAG_ANSI 1 |
62 #define CHARSET_FLAG_SYMBOL 2 | 46 #define CHARSET_FLAG_SYMBOL 2 |
63 #define CHARSET_FLAG_SHIFTJIS 4 | 47 #define CHARSET_FLAG_SHIFTJIS 4 |
64 #define CHARSET_FLAG_BIG5 8 | 48 #define CHARSET_FLAG_BIG5 8 |
65 #define CHARSET_FLAG_GB 16 | 49 #define CHARSET_FLAG_GB 16 |
66 #define CHARSET_FLAG_KOREAN 32 | 50 #define CHARSET_FLAG_KOREAN 32 |
67 | 51 |
68 class CFX_FontFaceInfo { | 52 class CFX_FontFaceInfo { |
69 public: | 53 public: |
70 CFX_FontFaceInfo(CFX_ByteString filePath, | 54 CFX_FontFaceInfo(CFX_ByteString filePath, |
(...skipping 27 matching lines...) Expand all Loading... |
98 FXFT_Face m_Face; | 82 FXFT_Face m_Face; |
99 CFX_ByteString m_FaceName; | 83 CFX_ByteString m_FaceName; |
100 FX_DWORD m_Charsets; | 84 FX_DWORD m_Charsets; |
101 FX_DWORD m_FileSize; | 85 FX_DWORD m_FileSize; |
102 FX_DWORD m_FontOffset; | 86 FX_DWORD m_FontOffset; |
103 int m_Weight; | 87 int m_Weight; |
104 FX_BOOL m_bItalic; | 88 FX_BOOL m_bItalic; |
105 int m_PitchFamily; | 89 int m_PitchFamily; |
106 CFX_ByteString m_FontTables; | 90 CFX_ByteString m_FontTables; |
107 }; | 91 }; |
108 class CFX_FontEncodingEX : public IFX_FontEncodingEx { | |
109 public: | |
110 CFX_FontEncodingEX(); | |
111 FX_BOOL Init(CFX_Font* pFont, FX_DWORD EncodingID); | |
112 virtual FX_DWORD GlyphIndexFromName(const FX_CHAR* pStrName); | |
113 virtual CFX_ByteString NameFromGlyphIndex(FX_DWORD dwGlyphIndex); | |
114 virtual FX_DWORD CharCodeFromGlyphIndex(FX_DWORD dwGlyphIndex); | |
115 virtual FX_DWORD GlyphFromCharCode(FX_DWORD charcode); | |
116 virtual CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const; | |
117 virtual FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const; | |
118 virtual FX_BOOL IsUnicodeCompatible() const; | |
119 virtual FX_DWORD GlyphFromCharCodeEx(FX_DWORD charcode, | |
120 int encoding = ENCODING_UNICODE) { | |
121 return GlyphFromCharCode(charcode); | |
122 } | |
123 | |
124 private: | |
125 CFX_Font* m_pFont; | |
126 FX_DWORD m_nEncodingID; | |
127 }; | |
128 | 92 |
129 #endif // CORE_SRC_FXGE_GE_TEXT_INT_H_ | 93 #endif // CORE_SRC_FXGE_GE_TEXT_INT_H_ |
OLD | NEW |