Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfx_gemodule.h
Go to the documentation of this file.
1// Copyright 2016 The PDFium Authors
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_FXGE_CFX_GEMODULE_H_
8#define CORE_FXGE_CFX_GEMODULE_H_
9
10#include <stdint.h>
11
12#include <memory>
13
14#include "build/build_config.h"
15#include "core/fxcrt/unowned_ptr_exclusion.h"
16
17#if BUILDFLAG(IS_APPLE)
18#include "third_party/base/containers/span.h"
19#endif
20
21class CFX_FontCache;
22class CFX_FontMgr;
24
26 public:
28 public:
30 virtual ~PlatformIface() = default;
31
32 virtual void Init() = 0;
35#if BUILDFLAG(IS_APPLE)
36 virtual void* CreatePlatformFont(pdfium::span<const uint8_t> font_span) = 0;
37#endif
38 };
39
40 static void Create(const char** pUserFontPaths);
41 static void Destroy();
42 static CFX_GEModule* Get();
43
44 CFX_FontCache* GetFontCache() const { return m_pFontCache.get(); }
45 CFX_FontMgr* GetFontMgr() const { return m_pFontMgr.get(); }
46 PlatformIface* GetPlatform() const { return m_pPlatform.get(); }
47 const char** GetUserFontPaths() const { return m_pUserFontPaths; }
48
49 private:
50 explicit CFX_GEModule(const char** pUserFontPaths);
51 ~CFX_GEModule();
52
53 std::unique_ptr<PlatformIface> const m_pPlatform;
54 std::unique_ptr<CFX_FontMgr> const m_pFontMgr;
55 std::unique_ptr<CFX_FontCache> const m_pFontCache;
56
57 // Exclude because taken from public API.
58 UNOWNED_PTR_EXCLUSION const char** const m_pUserFontPaths;
59};
60
61#endif // CORE_FXGE_CFX_GEMODULE_H_
virtual ~PlatformIface()=default
virtual std::unique_ptr< SystemFontInfoIface > CreateDefaultSystemFontInfo()=0
static std::unique_ptr< PlatformIface > Create()
PlatformIface * GetPlatform() const
static CFX_GEModule * Get()
CFX_FontCache * GetFontCache() const
static void Create(const char **pUserFontPaths)
CFX_FontMgr * GetFontMgr() const
static void Destroy()
const char ** GetUserFontPaths() const
static bool UseTTCharmapMSSymbol(const RetainPtr< CFX_Face > &face)
Definition cpdf_font.h:149
int m_Flags
Definition cpdf_font.h:178
FontEncoding m_BaseEncoding
void LoadGlyphMap() override
CPDF_Type1Font * AsType1Font() override
const CPDF_Type1Font * AsType1Font() const override
bool IsBase14Font() const
~CPDF_Type1Font() override
bool Load() override
bool IsType1Font() const override
FontEncoding
#define FXFONT_NONSYMBOLIC
Definition fx_font.h:32
bool FontStyleIsNonSymbolic(uint32_t style)
Definition fx_font.h:71
bool FontStyleIsSymbolic(uint32_t style)
Definition fx_font.h:68
#define FXFONT_SYMBOLIC
Definition fx_font.h:30
#define UNOWNED_PTR_EXCLUSION