Chromium Code Reviews| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 | 58 |
| 59 // IPVT_FontMap | 59 // IPVT_FontMap |
| 60 CPDF_Font* GetPDFFont(int32_t nFontIndex) override; | 60 CPDF_Font* GetPDFFont(int32_t nFontIndex) override; |
| 61 CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) override; | 61 CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) override; |
| 62 int32_t GetWordFontIndex(uint16_t word, | 62 int32_t GetWordFontIndex(uint16_t word, |
| 63 int32_t nCharset, | 63 int32_t nCharset, |
| 64 int32_t nFontIndex) override; | 64 int32_t nFontIndex) override; |
| 65 int32_t CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) override; | 65 int32_t CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) override; |
| 66 int32_t CharSetFromUnicode(uint16_t word, int32_t nOldCharset) override; | 66 int32_t CharSetFromUnicode(uint16_t word, int32_t nOldCharset) override; |
| 67 | 67 |
| 68 void SetSystemHandler(CFX_SystemHandler* pSystemHandler); | |
| 69 int32_t GetFontMapCount() const; | 68 int32_t GetFontMapCount() const; |
| 70 const CPWL_FontMap_Data* GetFontMapData(int32_t nIndex) const; | 69 const CPWL_FontMap_Data* GetFontMapData(int32_t nIndex) const; |
| 71 static int32_t GetNativeCharset(); | 70 static int32_t GetNativeCharset(); |
| 72 CFX_ByteString GetNativeFontName(int32_t nCharset); | 71 CFX_ByteString GetNativeFontName(int32_t nCharset); |
| 73 | 72 |
| 74 static CFX_ByteString GetDefaultFontByCharset(int32_t nCharset); | 73 static CFX_ByteString GetDefaultFontByCharset(int32_t nCharset); |
| 75 | |
| 76 CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, | |
| 77 CFX_ByteString& sFontName, | |
| 78 uint8_t nCharset); | |
| 79 static FX_BOOL IsStandardFont(const CFX_ByteString& sFontName); | |
| 80 CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName); | |
| 81 CPDF_Font* AddSystemFont(CPDF_Document* pDoc, | |
| 82 CFX_ByteString& sFontName, | |
| 83 uint8_t nCharset); | |
| 84 | |
| 85 static const FPDF_CharsetFontMap defaultTTFMap[]; | 74 static const FPDF_CharsetFontMap defaultTTFMap[]; |
| 86 | 75 |
| 87 protected: | 76 protected: |
| 88 virtual void Initialize(); | 77 virtual void Initialize(); |
| 89 virtual CPDF_Document* GetDocument(); | 78 virtual CPDF_Document* GetDocument(); |
| 90 virtual CPDF_Font* FindFontSameCharset(CFX_ByteString& sFontAlias, | 79 virtual CPDF_Font* FindFontSameCharset(CFX_ByteString& sFontAlias, |
| 91 int32_t nCharset); | 80 int32_t nCharset); |
| 92 virtual void AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias); | 81 virtual void AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias); |
| 93 | 82 |
| 94 FX_BOOL KnowWord(int32_t nFontIndex, uint16_t word); | 83 FX_BOOL KnowWord(int32_t nFontIndex, uint16_t word); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 108 | 97 |
| 109 CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData; | 98 CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData; |
| 110 CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont; | 99 CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont; |
| 111 | 100 |
| 112 private: | 101 private: |
| 113 CFX_ByteString GetFontName(int32_t nFontIndex); | 102 CFX_ByteString GetFontName(int32_t nFontIndex); |
| 114 int32_t FindFont(const CFX_ByteString& sFontName, | 103 int32_t FindFont(const CFX_ByteString& sFontName, |
| 115 int32_t nCharset = DEFAULT_CHARSET); | 104 int32_t nCharset = DEFAULT_CHARSET); |
| 116 | 105 |
| 117 CFX_ByteString GetNativeFont(int32_t nCharset); | 106 CFX_ByteString GetNativeFont(int32_t nCharset); |
| 107 CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, | |
| 108 CFX_ByteString& sFontName, | |
| 109 uint8_t nCharset); | |
| 110 FX_BOOL IsStandardFont(const CFX_ByteString& sFontName); | |
| 111 CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName); | |
| 112 CPDF_Font* AddSystemFont(CPDF_Document* pDoc, | |
| 113 CFX_ByteString& sFontName, | |
| 114 uint8_t nCharset); | |
| 118 | 115 |
| 119 std::unique_ptr<CPDF_Document> m_pPDFDoc; | 116 std::unique_ptr<CPDF_Document> m_pPDFDoc; |
| 120 CFX_SystemHandler* m_pSystemHandler; | 117 CFX_SystemHandler* m_pSystemHandler; |
|
Wei Li
2016/08/24 16:54:06
now it is const?
dsinclair
2016/08/24 17:47:41
Done.
| |
| 121 }; | 118 }; |
| 122 | 119 |
| 123 class CPWL_DocFontMap : public CPWL_FontMap { | |
| 124 public: | |
| 125 CPWL_DocFontMap(CFX_SystemHandler* pSystemHandler, | |
| 126 CPDF_Document* pAttachedDoc); | |
| 127 ~CPWL_DocFontMap() override; | |
| 128 | |
| 129 private: | |
| 130 // CPWL_FontMap: | |
| 131 CPDF_Document* GetDocument() override; | |
| 132 | |
| 133 CPDF_Document* m_pAttachedDoc; | |
| 134 }; | |
| 135 | |
| 136 #endif // FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ | 120 #endif // FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ |
| OLD | NEW |