1 // Copyright 2014 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_SRC_FXGE_GE_TEXT_INT_H_ 8 #define CORE_SRC_FXGE_GE_TEXT_INT_H_ 9 10 #include <map> 11 12 #include "core/include/fxge/fx_font.h" 13 #include "core/include/fxge/fx_freetype.h" 14 15 struct _CFX_UniqueKeyGen { 16 void Generate(int count, ...); 17 FX_CHAR m_Key[128]; 18 int m_KeyLen; 19 }; 20 class CFX_SizeGlyphCache { 21 public: CFX_SizeGlyphCache()22 CFX_SizeGlyphCache() {} 23 ~CFX_SizeGlyphCache(); 24 std::map<FX_DWORD, CFX_GlyphBitmap*> m_GlyphMap; 25 }; 26 class CTTFontDesc { 27 public: CTTFontDesc()28 CTTFontDesc() { 29 m_Type = 0; 30 m_pFontData = NULL; 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: CFX_FontFaceInfo(CFX_ByteString filePath,CFX_ByteString faceName,CFX_ByteString fontTables,FX_DWORD fontOffset,FX_DWORD fileSize)62 CFX_FontFaceInfo(CFX_ByteString filePath, 63 CFX_ByteString faceName, 64 CFX_ByteString fontTables, 65 FX_DWORD fontOffset, 66 FX_DWORD 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 FX_DWORD m_FontOffset; 79 const FX_DWORD m_FileSize; 80 FX_DWORD m_Styles; 81 FX_DWORD m_Charsets; 82 }; 83 84 #endif // CORE_SRC_FXGE_GE_TEXT_INT_H_ 85