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_FXGE_INCLUDE_FX_FONT_H_ | 7 #ifndef CORE_FXGE_INCLUDE_FX_FONT_H_ |
8 #define CORE_FXGE_INCLUDE_FX_FONT_H_ | 8 #define CORE_FXGE_INCLUDE_FX_FONT_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 uint8_t* m_pFontData; | 149 uint8_t* m_pFontData; |
150 uint8_t* m_pGsubData; | 150 uint8_t* m_pGsubData; |
151 uint32_t m_dwSize; | 151 uint32_t m_dwSize; |
152 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 152 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
153 void* m_pPlatformFont; | 153 void* m_pPlatformFont; |
154 #endif | 154 #endif |
155 FX_BOOL m_bEmbedded; | 155 FX_BOOL m_bEmbedded; |
156 FX_BOOL m_bVertical; | 156 FX_BOOL m_bVertical; |
157 }; | 157 }; |
158 | 158 |
159 #define ENCODING_INTERNAL 0 | |
160 #define ENCODING_UNICODE 1 | |
161 | |
162 #ifdef PDF_ENABLE_XFA | |
163 #define FXFM_ENC_TAG(a, b, c, d) \ | |
164 (((uint32_t)(a) << 24) | ((uint32_t)(b) << 16) | ((uint32_t)(c) << 8) | \ | |
165 (uint32_t)(d)) | |
166 #define FXFM_ENCODING_NONE FXFM_ENC_TAG(0, 0, 0, 0) | |
167 #define FXFM_ENCODING_MS_SYMBOL FXFM_ENC_TAG('s', 'y', 'm', 'b') | |
168 #define FXFM_ENCODING_UNICODE FXFM_ENC_TAG('u', 'n', 'i', 'c') | |
169 #define FXFM_ENCODING_MS_SJIS FXFM_ENC_TAG('s', 'j', 'i', 's') | |
170 #define FXFM_ENCODING_MS_GB2312 FXFM_ENC_TAG('g', 'b', ' ', ' ') | |
171 #define FXFM_ENCODING_MS_BIG5 FXFM_ENC_TAG('b', 'i', 'g', '5') | |
172 #define FXFM_ENCODING_MS_WANSUNG FXFM_ENC_TAG('w', 'a', 'n', 's') | |
173 #define FXFM_ENCODING_MS_JOHAB FXFM_ENC_TAG('j', 'o', 'h', 'a') | |
174 #define FXFM_ENCODING_ADOBE_STANDARD FXFM_ENC_TAG('A', 'D', 'O', 'B') | |
175 #define FXFM_ENCODING_ADOBE_EXPERT FXFM_ENC_TAG('A', 'D', 'B', 'E') | |
176 #define FXFM_ENCODING_ADOBE_CUSTOM FXFM_ENC_TAG('A', 'D', 'B', 'C') | |
177 #define FXFM_ENCODING_ADOBE_LATIN_1 FXFM_ENC_TAG('l', 'a', 't', '1') | |
178 #define FXFM_ENCODING_OLD_LATIN_2 FXFM_ENC_TAG('l', 'a', 't', '2') | |
179 #define FXFM_ENCODING_APPLE_ROMAN FXFM_ENC_TAG('a', 'r', 'm', 'n') | |
180 #endif // PDF_ENABLE_XFA | |
181 | |
182 class CFX_UnicodeEncoding { | |
183 public: | |
184 explicit CFX_UnicodeEncoding(CFX_Font* pFont); | |
185 virtual ~CFX_UnicodeEncoding(); | |
186 | |
187 virtual uint32_t GlyphFromCharCode(uint32_t charcode); | |
188 | |
189 protected: | |
190 // Unowned, not nullptr. | |
191 CFX_Font* m_pFont; | |
192 }; | |
193 | |
194 #ifdef PDF_ENABLE_XFA | |
195 class CFX_UnicodeEncodingEx : public CFX_UnicodeEncoding { | |
196 public: | |
197 CFX_UnicodeEncodingEx(CFX_Font* pFont, uint32_t EncodingID); | |
198 ~CFX_UnicodeEncodingEx() override; | |
199 | |
200 // CFX_UnicodeEncoding: | |
201 uint32_t GlyphFromCharCode(uint32_t charcode) override; | |
202 | |
203 uint32_t CharCodeFromUnicode(FX_WCHAR Unicode) const; | |
204 | |
205 private: | |
206 uint32_t m_nEncodingID; | |
207 }; | |
208 CFX_UnicodeEncodingEx* FX_CreateFontEncodingEx( | |
209 CFX_Font* pFont, | |
210 uint32_t nEncodingID = FXFM_ENCODING_NONE); | |
211 #endif // PDF_ENABLE_XFA | |
212 | |
213 #define FXFONT_SUBST_MM 0x01 | 159 #define FXFONT_SUBST_MM 0x01 |
214 #define FXFONT_SUBST_GLYPHPATH 0x04 | 160 #define FXFONT_SUBST_GLYPHPATH 0x04 |
215 #define FXFONT_SUBST_CLEARTYPE 0x08 | 161 #define FXFONT_SUBST_CLEARTYPE 0x08 |
216 #define FXFONT_SUBST_TRANSFORM 0x10 | 162 #define FXFONT_SUBST_TRANSFORM 0x10 |
217 #define FXFONT_SUBST_NONSYMBOL 0x20 | 163 #define FXFONT_SUBST_NONSYMBOL 0x20 |
218 #define FXFONT_SUBST_EXACT 0x40 | 164 #define FXFONT_SUBST_EXACT 0x40 |
219 #define FXFONT_SUBST_STANDARD 0x80 | 165 #define FXFONT_SUBST_STANDARD 0x80 |
220 | 166 |
221 class CFX_SubstFont { | 167 class CFX_SubstFont { |
222 public: | 168 public: |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 FX_FLOAT retinaScaleX = 1.0f, | 306 FX_FLOAT retinaScaleX = 1.0f, |
361 FX_FLOAT retinaScaleY = 1.0f); | 307 FX_FLOAT retinaScaleY = 1.0f); |
362 | 308 |
363 CFX_ByteString GetNameFromTT(const uint8_t* name_table, | 309 CFX_ByteString GetNameFromTT(const uint8_t* name_table, |
364 uint32_t name_table_size, | 310 uint32_t name_table_size, |
365 uint32_t name); | 311 uint32_t name); |
366 | 312 |
367 int PDF_GetStandardFontName(CFX_ByteString* name); | 313 int PDF_GetStandardFontName(CFX_ByteString* name); |
368 | 314 |
369 #endif // CORE_FXGE_INCLUDE_FX_FONT_H_ | 315 #endif // CORE_FXGE_INCLUDE_FX_FONT_H_ |
OLD | NEW |