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

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

Issue 1412733011: Make CFX_FontMgr member variables private. (try 2) (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: no unique_ptr 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') | core/src/fxge/ge/fx_ge_fontmap.cpp » ('J')
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>
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 #define FX_FONT_FLAG_SYMBOLIC_DINGBATS 0x20 169 #define FX_FONT_FLAG_SYMBOLIC_DINGBATS 0x20
170 #define FX_FONT_FLAG_MULTIPLEMASTER 0x40 170 #define FX_FONT_FLAG_MULTIPLEMASTER 0x40
171 typedef struct { 171 typedef struct {
172 const uint8_t* m_pFontData; 172 const uint8_t* m_pFontData;
173 FX_DWORD m_dwSize; 173 FX_DWORD m_dwSize;
174 } FoxitFonts; 174 } FoxitFonts;
175 class CFX_FontMgr { 175 class CFX_FontMgr {
176 public: 176 public:
177 CFX_FontMgr(); 177 CFX_FontMgr();
178 ~CFX_FontMgr(); 178 ~CFX_FontMgr();
179 void InitFTLibrary(); 179
180 FXFT_Face GetCachedFace(const CFX_ByteString& face_name, 180 FXFT_Face GetCachedFace(const CFX_ByteString& face_name,
181 int weight, 181 int weight,
182 FX_BOOL bItalic, 182 FX_BOOL bItalic,
183 uint8_t*& pFontData); 183 uint8_t*& pFontData);
184 FXFT_Face AddCachedFace(const CFX_ByteString& face_name, 184 FXFT_Face AddCachedFace(const CFX_ByteString& face_name,
185 int weight, 185 int weight,
186 FX_BOOL bItalic, 186 FX_BOOL bItalic,
187 uint8_t* pData, 187 uint8_t* pData,
188 FX_DWORD size, 188 FX_DWORD size,
189 int face_index); 189 int face_index);
(...skipping 10 matching lines...) Expand all
200 FXFT_Face GetFixedFace(const uint8_t* pData, FX_DWORD size, int face_index); 200 FXFT_Face GetFixedFace(const uint8_t* pData, FX_DWORD size, int face_index);
201 void ReleaseFace(FXFT_Face face); 201 void ReleaseFace(FXFT_Face face);
202 void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo); 202 void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo);
203 FXFT_Face FindSubstFont(const CFX_ByteString& face_name, 203 FXFT_Face FindSubstFont(const CFX_ByteString& face_name,
204 FX_BOOL bTrueType, 204 FX_BOOL bTrueType,
205 FX_DWORD flags, 205 FX_DWORD flags,
206 int weight, 206 int weight,
207 int italic_angle, 207 int italic_angle,
208 int CharsetCP, 208 int CharsetCP,
209 CFX_SubstFont* pSubstFont); 209 CFX_SubstFont* pSubstFont);
210 void FreeCache();
211 FX_BOOL GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index); 210 FX_BOOL GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index);
211 CFX_FontMapper* GetBuiltinMapper() const { return m_pBuiltinMapper; }
212 FXFT_Library GetFTLibrary() const { return m_FTLibrary; }
212 213
214 private:
215 void InitFTLibrary();
216
217 // TODO(thestig): Figure out why making this a unique_ptr does not work.
213 CFX_FontMapper* m_pBuiltinMapper; 218 CFX_FontMapper* m_pBuiltinMapper;
Lei Zhang 2015/10/20 18:13:31 I bet someone is abusing GetBuiltinMapper(). Will
Lei Zhang 2015/10/20 22:12:15 Well, I lost that bet. Good thing I didn't go all
214 std::map<CFX_ByteString, CTTFontDesc*> m_FaceMap; 219 std::map<CFX_ByteString, CTTFontDesc*> m_FaceMap;
215 FXFT_Library m_FTLibrary; 220 FXFT_Library m_FTLibrary;
216 FoxitFonts m_ExternalFonts[16];
217 }; 221 };
218 222
219 class IFX_FontEnumerator { 223 class IFX_FontEnumerator {
220 public: 224 public:
221 virtual void HitFont() = 0; 225 virtual void HitFont() = 0;
222 226
223 virtual void Finish() = 0; 227 virtual void Finish() = 0;
224 228
225 protected: 229 protected:
226 virtual ~IFX_FontEnumerator() {} 230 virtual ~IFX_FontEnumerator() {}
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 445
442 protected: 446 protected:
443 virtual ~IFX_GSUBTable() {} 447 virtual ~IFX_GSUBTable() {}
444 }; 448 };
445 449
446 CFX_ByteString GetNameFromTT(const uint8_t* name_table, FX_DWORD name); 450 CFX_ByteString GetNameFromTT(const uint8_t* name_table, FX_DWORD name);
447 451
448 int PDF_GetStandardFontName(CFX_ByteString* name); 452 int PDF_GetStandardFontName(CFX_ByteString* name);
449 453
450 #endif // CORE_INCLUDE_FXGE_FX_FONT_H_ 454 #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') | core/src/fxge/ge/fx_ge_fontmap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698