blob: 199bc2898714e20d4a6b6d9f09261752721078a1 [file] [log] [blame]
npmeadff192016-09-01 13:21:37 -07001// Copyright 2016 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.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FPDFAPI_FPDF_RENDER_CPDF_TYPE3CACHE_H_
8#define CORE_FPDFAPI_FPDF_RENDER_CPDF_TYPE3CACHE_H_
9
10#include <map>
11
12#include "core/fpdfapi/fpdf_font/cpdf_type3font.h"
dsinclaira52ab742016-09-29 13:59:29 -070013#include "core/fxcrt/fx_coordinates.h"
14#include "core/fxcrt/fx_string.h"
15#include "core/fxcrt/fx_system.h"
npmeadff192016-09-01 13:21:37 -070016
17class CPDF_Type3Glyphs;
18
19class CPDF_Type3Cache {
20 public:
21 explicit CPDF_Type3Cache(CPDF_Type3Font* pFont);
22 ~CPDF_Type3Cache();
23
24 CFX_GlyphBitmap* LoadGlyph(uint32_t charcode,
25 const CFX_Matrix* pMatrix,
26 FX_FLOAT retinaScaleX,
27 FX_FLOAT retinaScaleY);
28
29 private:
30 CFX_GlyphBitmap* RenderGlyph(CPDF_Type3Glyphs* pSize,
31 uint32_t charcode,
32 const CFX_Matrix* pMatrix,
33 FX_FLOAT retinaScaleX,
34 FX_FLOAT retinaScaleY);
35
36 CPDF_Type3Font* const m_pFont;
37 std::map<CFX_ByteString, CPDF_Type3Glyphs*> m_SizeMap;
38};
39
40#endif // CORE_FPDFAPI_FPDF_RENDER_CPDF_TYPE3CACHE_H_