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

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

Issue 2185533006: Splitting fx_ge_fontmap.cpp (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Nits and added header files Created 4 years, 4 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
OLDNEW
(Empty)
1 // Copyright 2014 PDFium Authors. All rights reserved.
dsinclair 2016/07/27 17:36:01 nit: 2016
npm 2016/07/27 18:51:57 Done.
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_FXGE_INCLUDE_CFX_FONTMAPPER_H_
8 #define CORE_FXGE_INCLUDE_CFX_FONTMAPPER_H_
9
10 #include "core/fxge/include/cfx_fontmgr.h"
11 #include "core/fxge/include/fx_font.h"
12
13 class CFX_FontMapper {
14 public:
15 explicit CFX_FontMapper(CFX_FontMgr* mgr);
16 ~CFX_FontMapper();
17
18 void SetSystemFontInfo(std::unique_ptr<IFX_SystemFontInfo> pFontInfo);
19 IFX_SystemFontInfo* GetSystemFontInfo() { return m_pFontInfo.get(); }
20 void AddInstalledFont(const CFX_ByteString& name, int charset);
21 void LoadInstalledFonts();
22
23 FXFT_Face FindSubstFont(const CFX_ByteString& face_name,
24 FX_BOOL bTrueType,
25 uint32_t flags,
26 int weight,
27 int italic_angle,
28 int CharsetCP,
29 CFX_SubstFont* pSubstFont);
30 #ifdef PDF_ENABLE_XFA
31 FXFT_Face FindSubstFontByUnicode(uint32_t dwUnicode,
32 uint32_t flags,
33 int weight,
34 int italic_angle);
35 #endif // PDF_ENABLE_XFA
36 FX_BOOL IsBuiltinFace(const FXFT_Face face) const;
37 int GetFaceSize() const;
38 CFX_ByteString GetFaceName(int index) const {
39 return m_FaceArray[index].name;
40 }
41
42 std::vector<CFX_ByteString> m_InstalledTTFonts;
43
44 private:
45 static const size_t MM_FACE_COUNT = 2;
46 static const size_t FOXIT_FACE_COUNT = 14;
47
48 CFX_ByteString GetPSNameFromTT(void* hFont);
49 CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name);
50 FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont,
51 int iBaseFont,
52 int italic_angle,
53 int weight,
54 int picthfamily);
55
56 struct FaceData {
57 CFX_ByteString name;
58 uint32_t charset;
59 };
60
61 FX_BOOL m_bListLoaded;
62 FXFT_Face m_MMFaces[MM_FACE_COUNT];
63 CFX_ByteString m_LastFamily;
64 std::vector<FaceData> m_FaceArray;
65 std::unique_ptr<IFX_SystemFontInfo> m_pFontInfo;
66 FXFT_Face m_FoxitFaces[FOXIT_FACE_COUNT];
67 CFX_FontMgr* const m_pFontMgr;
68 };
69
70 #endif // CORE_FXGE_INCLUDE_CFX_FONTMAPPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698