John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 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. |
Lei Zhang | a6d9f0e | 2015-06-13 00:48:38 -0700 | [diff] [blame] | 4 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
Dan Sinclair | edbb319 | 2016-03-21 09:08:24 -0400 | [diff] [blame] | 7 | #ifndef FPDFSDK_FORMFILLER_CBA_FONTMAP_H_ |
| 8 | #define FPDFSDK_FORMFILLER_CBA_FONTMAP_H_ |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 9 | |
dan sinclair | 89e904b | 2016-03-23 19:29:15 -0400 | [diff] [blame^] | 10 | #include "fpdfsdk/pdfwindow/PWL_FontMap.h" |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 11 | |
Tom Sepez | 245c80e | 2015-04-08 16:19:33 -0700 | [diff] [blame] | 12 | class CPDF_Dictionary; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 13 | class CPDFSDK_Annot; |
| 14 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 15 | class CBA_FontMap : public CPWL_FontMap { |
| 16 | public: |
| 17 | CBA_FontMap(CPDFSDK_Annot* pAnnot, IFX_SystemHandler* pSystemHandler); |
Lei Zhang | 2b1a2d5 | 2015-08-14 22:16:22 -0700 | [diff] [blame] | 18 | ~CBA_FontMap() override; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 19 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 20 | void SetDefaultFont(CPDF_Font* pFont, const CFX_ByteString& sFontName); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 21 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 22 | void Reset(); |
| 23 | void SetAPType(const CFX_ByteString& sAPType); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 24 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 25 | private: |
Lei Zhang | fcfa3b8 | 2015-12-24 21:07:28 -0800 | [diff] [blame] | 26 | // 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 Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 33 | 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 Zhang | a6d9f0e | 2015-06-13 00:48:38 -0700 | [diff] [blame] | 38 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 39 | CPDF_Document* m_pDocument; |
| 40 | CPDF_Dictionary* m_pAnnotDict; |
| 41 | CPDF_Font* m_pDefaultFont; |
| 42 | CFX_ByteString m_sDefaultFontName; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 43 | CFX_ByteString m_sAPType; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 44 | }; |
| 45 | |
Dan Sinclair | edbb319 | 2016-03-21 09:08:24 -0400 | [diff] [blame] | 46 | #endif // FPDFSDK_FORMFILLER_CBA_FONTMAP_H_ |