• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // 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_RENDER_CPDF_TEXTRENDERER_H_
8 #define CORE_FPDFAPI_RENDER_CPDF_TEXTRENDERER_H_
9 
10 #include <vector>
11 
12 #include "core/fxcrt/fx_coordinates.h"
13 #include "core/fxcrt/fx_string.h"
14 #include "core/fxcrt/fx_system.h"
15 #include "core/fxge/fx_dib.h"
16 
17 class CFX_RenderDevice;
18 class CFX_GraphStateData;
19 class CFX_PathData;
20 class CPDF_RenderOptions;
21 class CPDF_Font;
22 
23 class CPDF_TextRenderer {
24  public:
25   static void DrawTextString(CFX_RenderDevice* pDevice,
26                              float origin_x,
27                              float origin_y,
28                              CPDF_Font* pFont,
29                              float font_size,
30                              const CFX_Matrix& matrix,
31                              const ByteString& str,
32                              FX_ARGB fill_argb,
33                              const CPDF_RenderOptions& options);
34 
35   static bool DrawTextPath(CFX_RenderDevice* pDevice,
36                            const std::vector<uint32_t>& charCodes,
37                            const std::vector<float>& charPos,
38                            CPDF_Font* pFont,
39                            float font_size,
40                            const CFX_Matrix& mtText2User,
41                            const CFX_Matrix* pUser2Device,
42                            const CFX_GraphStateData* pGraphState,
43                            FX_ARGB fill_argb,
44                            FX_ARGB stroke_argb,
45                            CFX_PathData* pClippingPath,
46                            int nFlag);
47 
48   static bool DrawNormalText(CFX_RenderDevice* pDevice,
49                              const std::vector<uint32_t>& charCodes,
50                              const std::vector<float>& charPos,
51                              CPDF_Font* pFont,
52                              float font_size,
53                              const CFX_Matrix& mtText2Device,
54                              FX_ARGB fill_argb,
55                              const CPDF_RenderOptions& options);
56 
57   CPDF_TextRenderer() = delete;
58   CPDF_TextRenderer(const CPDF_TextRenderer&) = delete;
59   CPDF_TextRenderer& operator=(const CPDF_TextRenderer&) = delete;
60 };
61 
62 #endif  // CORE_FPDFAPI_RENDER_CPDF_TEXTRENDERER_H_
63