| OLD | NEW |
| 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 FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ | 7 #ifndef FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ |
| 8 #define FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ | 8 #define FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 static CFX_ByteString GetDefaultFontByCharset(int32_t nCharset); | 49 static CFX_ByteString GetDefaultFontByCharset(int32_t nCharset); |
| 50 static const FPDF_CharsetFontMap defaultTTFMap[]; | 50 static const FPDF_CharsetFontMap defaultTTFMap[]; |
| 51 | 51 |
| 52 protected: | 52 protected: |
| 53 virtual void Initialize(); | 53 virtual void Initialize(); |
| 54 virtual CPDF_Document* GetDocument(); | 54 virtual CPDF_Document* GetDocument(); |
| 55 virtual CPDF_Font* FindFontSameCharset(CFX_ByteString& sFontAlias, | 55 virtual CPDF_Font* FindFontSameCharset(CFX_ByteString& sFontAlias, |
| 56 int32_t nCharset); | 56 int32_t nCharset); |
| 57 virtual void AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias); | 57 virtual void AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias); |
| 58 | 58 |
| 59 FX_BOOL KnowWord(int32_t nFontIndex, uint16_t word); | 59 bool KnowWord(int32_t nFontIndex, uint16_t word); |
| 60 | 60 |
| 61 void Empty(); | 61 void Empty(); |
| 62 int32_t GetFontIndex(const CFX_ByteString& sFontName, | 62 int32_t GetFontIndex(const CFX_ByteString& sFontName, |
| 63 int32_t nCharset, | 63 int32_t nCharset, |
| 64 FX_BOOL bFind); | 64 bool bFind); |
| 65 int32_t AddFontData(CPDF_Font* pFont, | 65 int32_t AddFontData(CPDF_Font* pFont, |
| 66 const CFX_ByteString& sFontAlias, | 66 const CFX_ByteString& sFontAlias, |
| 67 int32_t nCharset = FXFONT_DEFAULT_CHARSET); | 67 int32_t nCharset = FXFONT_DEFAULT_CHARSET); |
| 68 | 68 |
| 69 CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName, | 69 CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName, |
| 70 int32_t nCharset); | 70 int32_t nCharset); |
| 71 CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName); | 71 CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName); |
| 72 | 72 |
| 73 CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData; | 73 CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData; |
| 74 CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont; | 74 CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont; |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 int32_t FindFont(const CFX_ByteString& sFontName, | 77 int32_t FindFont(const CFX_ByteString& sFontName, |
| 78 int32_t nCharset = FXFONT_DEFAULT_CHARSET); | 78 int32_t nCharset = FXFONT_DEFAULT_CHARSET); |
| 79 | 79 |
| 80 CFX_ByteString GetNativeFont(int32_t nCharset); | 80 CFX_ByteString GetNativeFont(int32_t nCharset); |
| 81 CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, | 81 CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, |
| 82 CFX_ByteString& sFontName, | 82 CFX_ByteString& sFontName, |
| 83 uint8_t nCharset); | 83 uint8_t nCharset); |
| 84 FX_BOOL IsStandardFont(const CFX_ByteString& sFontName); | 84 bool IsStandardFont(const CFX_ByteString& sFontName); |
| 85 CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName); | 85 CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName); |
| 86 CPDF_Font* AddSystemFont(CPDF_Document* pDoc, | 86 CPDF_Font* AddSystemFont(CPDF_Document* pDoc, |
| 87 CFX_ByteString& sFontName, | 87 CFX_ByteString& sFontName, |
| 88 uint8_t nCharset); | 88 uint8_t nCharset); |
| 89 | 89 |
| 90 std::unique_ptr<CPDF_Document> m_pPDFDoc; | 90 std::unique_ptr<CPDF_Document> m_pPDFDoc; |
| 91 CFX_SystemHandler* const m_pSystemHandler; | 91 CFX_SystemHandler* const m_pSystemHandler; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 #endif // FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ | 94 #endif // FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ |
| OLD | NEW |