| 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_GE_FX_TEXT_INT_H_ | 7 #ifndef CORE_FXGE_GE_FX_TEXT_INT_H_ |
| 8 #define CORE_FXGE_GE_FX_TEXT_INT_H_ | 8 #define CORE_FXGE_GE_FX_TEXT_INT_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 | 11 |
| 12 #include "core/fxge/include/fx_font.h" | 12 #include "core/fxge/include/fx_font.h" |
| 13 #include "core/fxge/include/fx_freetype.h" | 13 #include "core/fxge/include/fx_freetype.h" |
| 14 | 14 |
| 15 struct _CFX_UniqueKeyGen { | 15 struct _CFX_UniqueKeyGen { |
| 16 void Generate(int count, ...); | 16 void Generate(int count, ...); |
| 17 FX_CHAR m_Key[128]; | 17 FX_CHAR m_Key[128]; |
| 18 int m_KeyLen; | 18 int m_KeyLen; |
| 19 }; | 19 }; |
| 20 |
| 20 class CFX_SizeGlyphCache { | 21 class CFX_SizeGlyphCache { |
| 21 public: | 22 public: |
| 22 CFX_SizeGlyphCache() {} | 23 CFX_SizeGlyphCache(); |
| 23 ~CFX_SizeGlyphCache(); | 24 ~CFX_SizeGlyphCache(); |
| 24 std::map<uint32_t, CFX_GlyphBitmap*> m_GlyphMap; | 25 std::map<uint32_t, CFX_GlyphBitmap*> m_GlyphMap; |
| 25 }; | 26 }; |
| 26 class CTTFontDesc { | |
| 27 public: | |
| 28 CTTFontDesc() { | |
| 29 m_Type = 0; | |
| 30 m_pFontData = nullptr; | |
| 31 m_RefCount = 0; | |
| 32 } | |
| 33 ~CTTFontDesc(); | |
| 34 // ret < 0, releaseface not appropriate for this object. | |
| 35 // ret == 0, object released | |
| 36 // ret > 0, object still alive, other referrers. | |
| 37 int ReleaseFace(FXFT_Face face); | |
| 38 int m_Type; | |
| 39 union { | |
| 40 struct { | |
| 41 FX_BOOL m_bItalic; | |
| 42 FX_BOOL m_bBold; | |
| 43 FXFT_Face m_pFace; | |
| 44 } m_SingleFace; | |
| 45 struct { | |
| 46 FXFT_Face m_pFaces[16]; | |
| 47 } m_TTCFace; | |
| 48 }; | |
| 49 uint8_t* m_pFontData; | |
| 50 int m_RefCount; | |
| 51 }; | |
| 52 | |
| 53 #define CHARSET_FLAG_ANSI 1 | |
| 54 #define CHARSET_FLAG_SYMBOL 2 | |
| 55 #define CHARSET_FLAG_SHIFTJIS 4 | |
| 56 #define CHARSET_FLAG_BIG5 8 | |
| 57 #define CHARSET_FLAG_GB 16 | |
| 58 #define CHARSET_FLAG_KOREAN 32 | |
| 59 | |
| 60 class CFX_FontFaceInfo { | |
| 61 public: | |
| 62 CFX_FontFaceInfo(CFX_ByteString filePath, | |
| 63 CFX_ByteString faceName, | |
| 64 CFX_ByteString fontTables, | |
| 65 uint32_t fontOffset, | |
| 66 uint32_t fileSize) | |
| 67 : m_FilePath(filePath), | |
| 68 m_FaceName(faceName), | |
| 69 m_FontTables(fontTables), | |
| 70 m_FontOffset(fontOffset), | |
| 71 m_FileSize(fileSize), | |
| 72 m_Styles(0), | |
| 73 m_Charsets(0) {} | |
| 74 | |
| 75 const CFX_ByteString m_FilePath; | |
| 76 const CFX_ByteString m_FaceName; | |
| 77 const CFX_ByteString m_FontTables; | |
| 78 const uint32_t m_FontOffset; | |
| 79 const uint32_t m_FileSize; | |
| 80 uint32_t m_Styles; | |
| 81 uint32_t m_Charsets; | |
| 82 }; | |
| 83 | 27 |
| 84 #endif // CORE_FXGE_GE_FX_TEXT_INT_H_ | 28 #endif // CORE_FXGE_GE_FX_TEXT_INT_H_ |
| OLD | NEW |