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

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

Issue 1864893003: Remove IFX_FontEnumerator (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 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 | « core/fxge/ge/fx_ge_fontmap.cpp ('k') | core/fxge/win32/fx_win32_device.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_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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 bool GetBuiltinFont(size_t index, const uint8_t** pFontData, uint32_t* size); 280 bool GetBuiltinFont(size_t index, const uint8_t** pFontData, uint32_t* size);
281 CFX_FontMapper* GetBuiltinMapper() const { return m_pBuiltinMapper.get(); } 281 CFX_FontMapper* GetBuiltinMapper() const { return m_pBuiltinMapper.get(); }
282 FXFT_Library GetFTLibrary() const { return m_FTLibrary; } 282 FXFT_Library GetFTLibrary() const { return m_FTLibrary; }
283 283
284 private: 284 private:
285 std::unique_ptr<CFX_FontMapper> m_pBuiltinMapper; 285 std::unique_ptr<CFX_FontMapper> m_pBuiltinMapper;
286 std::map<CFX_ByteString, CTTFontDesc*> m_FaceMap; 286 std::map<CFX_ByteString, CTTFontDesc*> m_FaceMap;
287 FXFT_Library m_FTLibrary; 287 FXFT_Library m_FTLibrary;
288 }; 288 };
289 289
290 class IFX_FontEnumerator {
291 public:
292 virtual void HitFont() = 0;
293
294 virtual void Finish() = 0;
295
296 protected:
297 virtual ~IFX_FontEnumerator() {}
298 };
299
300 class IFX_AdditionalFontEnum { 290 class IFX_AdditionalFontEnum {
301 public: 291 public:
302 virtual int CountFiles() = 0; 292 virtual int CountFiles() = 0;
303 virtual IFX_FileStream* GetFontFile(int index) = 0; 293 virtual IFX_FileStream* GetFontFile(int index) = 0;
304 294
305 protected: 295 protected:
306 virtual ~IFX_AdditionalFontEnum() {} 296 virtual ~IFX_AdditionalFontEnum() {}
307 }; 297 };
308 298
309 class CFX_FontMapper { 299 class CFX_FontMapper {
310 public: 300 public:
311 explicit CFX_FontMapper(CFX_FontMgr* mgr); 301 explicit CFX_FontMapper(CFX_FontMgr* mgr);
312 ~CFX_FontMapper(); 302 ~CFX_FontMapper();
313 303
314 void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo); 304 void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo);
315 IFX_SystemFontInfo* GetSystemFontInfo() { return m_pFontInfo; } 305 IFX_SystemFontInfo* GetSystemFontInfo() { return m_pFontInfo; }
316 void AddInstalledFont(const CFX_ByteString& name, int charset); 306 void AddInstalledFont(const CFX_ByteString& name, int charset);
317 void LoadInstalledFonts(); 307 void LoadInstalledFonts();
318 std::vector<CFX_ByteString> m_InstalledTTFonts; 308
319 void SetFontEnumerator(IFX_FontEnumerator* pFontEnumerator) {
320 m_pFontEnumerator = pFontEnumerator;
321 }
322 IFX_FontEnumerator* GetFontEnumerator() const { return m_pFontEnumerator; }
323 FXFT_Face FindSubstFont(const CFX_ByteString& face_name, 309 FXFT_Face FindSubstFont(const CFX_ByteString& face_name,
324 FX_BOOL bTrueType, 310 FX_BOOL bTrueType,
325 uint32_t flags, 311 uint32_t flags,
326 int weight, 312 int weight,
327 int italic_angle, 313 int italic_angle,
328 int CharsetCP, 314 int CharsetCP,
329 CFX_SubstFont* pSubstFont); 315 CFX_SubstFont* pSubstFont);
330 #ifdef PDF_ENABLE_XFA 316 #ifdef PDF_ENABLE_XFA
331 FXFT_Face FindSubstFontByUnicode(uint32_t dwUnicode, 317 FXFT_Face FindSubstFontByUnicode(uint32_t dwUnicode,
332 uint32_t flags, 318 uint32_t flags,
333 int weight, 319 int weight,
334 int italic_angle); 320 int italic_angle);
335 #endif // PDF_ENABLE_XFA 321 #endif // PDF_ENABLE_XFA
336 FX_BOOL IsBuiltinFace(const FXFT_Face face) const; 322 FX_BOOL IsBuiltinFace(const FXFT_Face face) const;
337 int GetFaceSize() const; 323 int GetFaceSize() const;
338 CFX_ByteString GetFaceName(int index) const { return m_FaceArray[index]; } 324 CFX_ByteString GetFaceName(int index) const { return m_FaceArray[index]; }
339 325
326 std::vector<CFX_ByteString> m_InstalledTTFonts;
327
340 private: 328 private:
341 static const size_t MM_FACE_COUNT = 2; 329 static const size_t MM_FACE_COUNT = 2;
342 static const size_t FOXIT_FACE_COUNT = 14; 330 static const size_t FOXIT_FACE_COUNT = 14;
343 331
344 CFX_ByteString GetPSNameFromTT(void* hFont); 332 CFX_ByteString GetPSNameFromTT(void* hFont);
345 CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name); 333 CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name);
346 FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont, 334 FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont,
347 int iBaseFont, 335 int iBaseFont,
348 int italic_angle, 336 int italic_angle,
349 int weight, 337 int weight,
350 int picthfamily); 338 int picthfamily);
351 339
352 FX_BOOL m_bListLoaded; 340 FX_BOOL m_bListLoaded;
353 FXFT_Face m_MMFaces[MM_FACE_COUNT]; 341 FXFT_Face m_MMFaces[MM_FACE_COUNT];
354 CFX_ByteString m_LastFamily; 342 CFX_ByteString m_LastFamily;
355 CFX_ArrayTemplate<uint32_t> m_CharsetArray; 343 CFX_ArrayTemplate<uint32_t> m_CharsetArray;
356 std::vector<CFX_ByteString> m_FaceArray; 344 std::vector<CFX_ByteString> m_FaceArray;
357 IFX_SystemFontInfo* m_pFontInfo; 345 IFX_SystemFontInfo* m_pFontInfo;
358 FXFT_Face m_FoxitFaces[FOXIT_FACE_COUNT]; 346 FXFT_Face m_FoxitFaces[FOXIT_FACE_COUNT];
359 IFX_FontEnumerator* m_pFontEnumerator;
360 CFX_FontMgr* const m_pFontMgr; 347 CFX_FontMgr* const m_pFontMgr;
361 }; 348 };
362 349
363 class IFX_SystemFontInfo { 350 class IFX_SystemFontInfo {
364 public: 351 public:
365 static IFX_SystemFontInfo* CreateDefault(const char** pUserPaths); 352 static IFX_SystemFontInfo* CreateDefault(const char** pUserPaths);
366 virtual void Release() = 0; 353 virtual void Release() = 0;
367 354
368 virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) = 0; 355 virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) = 0;
369 virtual void* MapFont(int weight, 356 virtual void* MapFont(int weight,
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 virtual ~IFX_GSUBTable() {} 544 virtual ~IFX_GSUBTable() {}
558 }; 545 };
559 546
560 CFX_ByteString GetNameFromTT(const uint8_t* name_table, 547 CFX_ByteString GetNameFromTT(const uint8_t* name_table,
561 uint32_t name_table_size, 548 uint32_t name_table_size,
562 uint32_t name); 549 uint32_t name);
563 550
564 int PDF_GetStandardFontName(CFX_ByteString* name); 551 int PDF_GetStandardFontName(CFX_ByteString* name);
565 552
566 #endif // CORE_FXGE_INCLUDE_FX_FONT_H_ 553 #endif // CORE_FXGE_INCLUDE_FX_FONT_H_
OLDNEW
« no previous file with comments | « core/fxge/ge/fx_ge_fontmap.cpp ('k') | core/fxge/win32/fx_win32_device.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698