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 XFA_FXFA_CXFA_FONTMGR_H_
8 #define XFA_FXFA_CXFA_FONTMGR_H_
9 
10 #include <map>
11 #include <memory>
12 #include <vector>
13 
14 #include "core/fxcrt/fx_extension.h"
15 #include "core/fxcrt/fx_system.h"
16 #include "core/fxcrt/retain_ptr.h"
17 #include "xfa/fgas/font/cfgas_defaultfontmanager.h"
18 #include "xfa/fgas/font/cfgas_fontmgr.h"
19 #include "xfa/fgas/font/cfgas_pdffontmgr.h"
20 #include "xfa/fxfa/fxfa.h"
21 
22 class CPDF_Font;
23 
24 class CXFA_FontMgr {
25  public:
26   CXFA_FontMgr();
27   ~CXFA_FontMgr();
28 
29   RetainPtr<CFGAS_GEFont> GetFont(CXFA_FFDoc* hDoc,
30                                   const WideStringView& wsFontFamily,
31                                   uint32_t dwFontStyles);
32   void SetDefFontMgr(std::unique_ptr<CFGAS_DefaultFontManager> pFontMgr);
33 
34  private:
35   std::unique_ptr<CFGAS_DefaultFontManager> m_pDefFontMgr;
36   std::map<ByteString, RetainPtr<CFGAS_GEFont>> m_FontMap;
37 };
38 
39 #endif  //  XFA_FXFA_CXFA_FONTMGR_H_
40