blob: ac5f2ced8a5aabbf319c3ae47ddc8bad72c9db77 [file] [log] [blame]
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001// 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.
Lei Zhanga6d9f0e2015-06-13 00:48:38 -07004
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07005// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
Dan Sinclairedbb3192016-03-21 09:08:24 -04007#ifndef FPDFSDK_FORMFILLER_CBA_FONTMAP_H_
8#define FPDFSDK_FORMFILLER_CBA_FONTMAP_H_
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07009
dan sinclair89e904b2016-03-23 19:29:15 -040010#include "fpdfsdk/pdfwindow/PWL_FontMap.h"
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070011
Tom Sepez245c80e2015-04-08 16:19:33 -070012class CPDF_Dictionary;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070013class CPDFSDK_Annot;
14
Nico Weber9d8ec5a2015-08-04 13:00:21 -070015class CBA_FontMap : public CPWL_FontMap {
16 public:
17 CBA_FontMap(CPDFSDK_Annot* pAnnot, IFX_SystemHandler* pSystemHandler);
Lei Zhang2b1a2d52015-08-14 22:16:22 -070018 ~CBA_FontMap() override;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070019
Nico Weber9d8ec5a2015-08-04 13:00:21 -070020 void SetDefaultFont(CPDF_Font* pFont, const CFX_ByteString& sFontName);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070021
Nico Weber9d8ec5a2015-08-04 13:00:21 -070022 void Reset();
23 void SetAPType(const CFX_ByteString& sAPType);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070024
Nico Weber9d8ec5a2015-08-04 13:00:21 -070025 private:
Lei Zhangfcfa3b82015-12-24 21:07:28 -080026 // CPWL_FontMap:
27 void Initialize() override;
28 CPDF_Document* GetDocument() override;
29 CPDF_Font* FindFontSameCharset(CFX_ByteString& sFontAlias,
30 int32_t nCharset) override;
31 void AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias) override;
32
Nico Weber9d8ec5a2015-08-04 13:00:21 -070033 CPDF_Font* FindResFontSameCharset(CPDF_Dictionary* pResDict,
34 CFX_ByteString& sFontAlias,
35 int32_t nCharset);
36 CPDF_Font* GetAnnotDefaultFont(CFX_ByteString& csNameTag);
37 void AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAlias);
Lei Zhanga6d9f0e2015-06-13 00:48:38 -070038
Nico Weber9d8ec5a2015-08-04 13:00:21 -070039 CPDF_Document* m_pDocument;
40 CPDF_Dictionary* m_pAnnotDict;
41 CPDF_Font* m_pDefaultFont;
42 CFX_ByteString m_sDefaultFontName;
Nico Weber9d8ec5a2015-08-04 13:00:21 -070043 CFX_ByteString m_sAPType;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070044};
45
Dan Sinclairedbb3192016-03-21 09:08:24 -040046#endif // FPDFSDK_FORMFILLER_CBA_FONTMAP_H_