summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/cfx_stockfontarray.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/font/cfx_stockfontarray.h')
-rw-r--r--core/fpdfapi/font/cfx_stockfontarray.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/core/fpdfapi/font/cfx_stockfontarray.h b/core/fpdfapi/font/cfx_stockfontarray.h
new file mode 100644
index 0000000000..50a13c167f
--- /dev/null
+++ b/core/fpdfapi/font/cfx_stockfontarray.h
@@ -0,0 +1,27 @@
+// Copyright 2017 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_FPDFAPI_FONT_CFX_STOCKFONTARRAY_H_
+#define CORE_FPDFAPI_FONT_CFX_STOCKFONTARRAY_H_
+
+#include <memory>
+
+#include "core/fpdfapi/font/cpdf_font.h"
+
+class CFX_StockFontArray {
+ public:
+ CFX_StockFontArray();
+ ~CFX_StockFontArray();
+
+ // Takes ownership of |pFont|, returns unowned pointer to it.
+ CPDF_Font* SetFont(uint32_t index, std::unique_ptr<CPDF_Font> pFont);
+ CPDF_Font* GetFont(uint32_t index) const;
+
+ private:
+ std::unique_ptr<CPDF_Font> m_StockFonts[14];
+};
+
+#endif // CORE_FPDFAPI_FONT_CFX_STOCKFONTARRAY_H_