| Index: core/src/fpdfapi/fpdf_font/font_int.h
|
| diff --git a/core/src/fpdfapi/fpdf_font/font_int.h b/core/src/fpdfapi/fpdf_font/font_int.h
|
| index 5418ffd2c952774cd7accae57ba54001a9c7482f..33fa926b2ab329d6733787152e083423392c3c09 100644
|
| --- a/core/src/fpdfapi/fpdf_font/font_int.h
|
| +++ b/core/src/fpdfapi/fpdf_font/font_int.h
|
| @@ -8,6 +8,7 @@
|
| #define CORE_SRC_FPDFAPI_FPDF_FONT_FONT_INT_H_
|
|
|
| #include <map>
|
| +#include <memory>
|
|
|
| #include "core/include/fpdfapi/fpdf_resource.h"
|
| #include "core/include/fxcrt/fx_basic.h"
|
| @@ -39,14 +40,31 @@ class CPDF_CMapManager {
|
| std::map<CFX_ByteString, CPDF_CMap*> m_CMaps;
|
| CPDF_CID2UnicodeMap* m_CID2UnicodeMaps[6];
|
| };
|
| +
|
| +class CFX_StockFontArray {
|
| + public:
|
| + CFX_StockFontArray();
|
| + ~CFX_StockFontArray();
|
| +
|
| + // Takes ownership of |pFont|.
|
| + void SetFont(int index, CPDF_Font* pFont);
|
| + CPDF_Font* GetFont(int index) const;
|
| +
|
| + private:
|
| + std::unique_ptr<CPDF_Font> m_StockFonts[14];
|
| +};
|
| +
|
| class CPDF_FontGlobals {
|
| public:
|
| CPDF_FontGlobals();
|
| ~CPDF_FontGlobals();
|
| - void ClearAll();
|
| - void Clear(void* key);
|
| - CPDF_Font* Find(void* key, int index);
|
| - void Set(void* key, int index, CPDF_Font* pFont);
|
| +
|
| + void Clear(CPDF_Document* pDoc);
|
| + CPDF_Font* Find(CPDF_Document* pDoc, int index);
|
| +
|
| + // Takes ownership of |pFont|.
|
| + void Set(CPDF_Document* key, int index, CPDF_Font* pFont);
|
| +
|
| CPDF_CMapManager m_CMapManager;
|
| struct {
|
| const struct FXCMAP_CMap* m_pMapList;
|
| @@ -58,8 +76,7 @@ class CPDF_FontGlobals {
|
| } m_EmbeddedToUnicodes[CIDSET_NUM_SETS];
|
|
|
| private:
|
| - CFX_MapPtrToPtr m_pStockMap;
|
| - uint8_t* m_pContrastRamps;
|
| + std::map<CPDF_Document*, std::unique_ptr<CFX_StockFontArray>> m_StockMap;
|
| };
|
|
|
| struct CMap_CodeRange {
|
|
|