Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: core/include/fxge/fx_font.h

Issue 1414463006: Merge to XFA: Make CFX_FontMgr member variables private. (try 2) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | core/src/fxge/ge/fx_ge_font.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_INCLUDE_FXGE_FX_FONT_H_ 7 #ifndef CORE_INCLUDE_FXGE_FX_FONT_H_
8 #define CORE_INCLUDE_FXGE_FX_FONT_H_ 8 #define CORE_INCLUDE_FXGE_FX_FONT_H_
9 9
10 #include <map> 10 #include <map>
11 11
12 #include "../../../third_party/base/nonstd_unique_ptr.h"
12 #include "../fxcrt/fx_system.h" 13 #include "../fxcrt/fx_system.h"
13 #include "fx_dib.h" 14 #include "fx_dib.h"
14 15
15 typedef struct FT_FaceRec_* FXFT_Face; 16 typedef struct FT_FaceRec_* FXFT_Face;
16 typedef void* FXFT_Library; 17 typedef void* FXFT_Library;
17 18
18 class CFX_FaceCache; 19 class CFX_FaceCache;
19 class CFX_FontFaceInfo; 20 class CFX_FontFaceInfo;
20 class CFX_FontMapper; 21 class CFX_FontMapper;
21 class CFX_PathData; 22 class CFX_PathData;
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 #define FX_FONT_FLAG_SYMBOLIC_DINGBATS 0x20 230 #define FX_FONT_FLAG_SYMBOLIC_DINGBATS 0x20
230 #define FX_FONT_FLAG_MULTIPLEMASTER 0x40 231 #define FX_FONT_FLAG_MULTIPLEMASTER 0x40
231 typedef struct { 232 typedef struct {
232 const uint8_t* m_pFontData; 233 const uint8_t* m_pFontData;
233 FX_DWORD m_dwSize; 234 FX_DWORD m_dwSize;
234 } FoxitFonts; 235 } FoxitFonts;
235 class CFX_FontMgr { 236 class CFX_FontMgr {
236 public: 237 public:
237 CFX_FontMgr(); 238 CFX_FontMgr();
238 ~CFX_FontMgr(); 239 ~CFX_FontMgr();
240
239 void InitFTLibrary(); 241 void InitFTLibrary();
240 FXFT_Face GetCachedFace(const CFX_ByteString& face_name, 242 FXFT_Face GetCachedFace(const CFX_ByteString& face_name,
241 int weight, 243 int weight,
242 FX_BOOL bItalic, 244 FX_BOOL bItalic,
243 uint8_t*& pFontData); 245 uint8_t*& pFontData);
244 FXFT_Face AddCachedFace(const CFX_ByteString& face_name, 246 FXFT_Face AddCachedFace(const CFX_ByteString& face_name,
245 int weight, 247 int weight,
246 FX_BOOL bItalic, 248 FX_BOOL bItalic,
247 uint8_t* pData, 249 uint8_t* pData,
248 FX_DWORD size, 250 FX_DWORD size,
(...skipping 11 matching lines...) Expand all
260 FXFT_Face GetFixedFace(const uint8_t* pData, FX_DWORD size, int face_index); 262 FXFT_Face GetFixedFace(const uint8_t* pData, FX_DWORD size, int face_index);
261 void ReleaseFace(FXFT_Face face); 263 void ReleaseFace(FXFT_Face face);
262 void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo); 264 void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo);
263 FXFT_Face FindSubstFont(const CFX_ByteString& face_name, 265 FXFT_Face FindSubstFont(const CFX_ByteString& face_name,
264 FX_BOOL bTrueType, 266 FX_BOOL bTrueType,
265 FX_DWORD flags, 267 FX_DWORD flags,
266 int weight, 268 int weight,
267 int italic_angle, 269 int italic_angle,
268 int CharsetCP, 270 int CharsetCP,
269 CFX_SubstFont* pSubstFont); 271 CFX_SubstFont* pSubstFont);
270 void FreeCache();
271 FX_BOOL GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index); 272 FX_BOOL GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index);
273 CFX_FontMapper* GetBuiltinMapper() const { return m_pBuiltinMapper.get(); }
274 FXFT_Library GetFTLibrary() const { return m_FTLibrary; }
272 275
273 CFX_FontMapper* m_pBuiltinMapper; 276 private:
277 nonstd::unique_ptr<CFX_FontMapper> m_pBuiltinMapper;
274 std::map<CFX_ByteString, CTTFontDesc*> m_FaceMap; 278 std::map<CFX_ByteString, CTTFontDesc*> m_FaceMap;
275 FXFT_Library m_FTLibrary; 279 FXFT_Library m_FTLibrary;
276 FoxitFonts m_ExternalFonts[16];
277 }; 280 };
278 281
279 class IFX_FontEnumerator { 282 class IFX_FontEnumerator {
280 public: 283 public:
281 virtual void HitFont() = 0; 284 virtual void HitFont() = 0;
282 285
283 virtual void Finish() = 0; 286 virtual void Finish() = 0;
284 287
285 protected: 288 protected:
286 virtual ~IFX_FontEnumerator() {} 289 virtual ~IFX_FontEnumerator() {}
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 524
522 protected: 525 protected:
523 virtual ~IFX_GSUBTable() {} 526 virtual ~IFX_GSUBTable() {}
524 }; 527 };
525 528
526 CFX_ByteString GetNameFromTT(const uint8_t* name_table, FX_DWORD name); 529 CFX_ByteString GetNameFromTT(const uint8_t* name_table, FX_DWORD name);
527 530
528 int PDF_GetStandardFontName(CFX_ByteString* name); 531 int PDF_GetStandardFontName(CFX_ByteString* name);
529 532
530 #endif // CORE_INCLUDE_FXGE_FX_FONT_H_ 533 #endif // CORE_INCLUDE_FXGE_FX_FONT_H_
OLDNEW
« no previous file with comments | « no previous file | core/src/fxge/ge/fx_ge_font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698