Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
cfx_glyphcache.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_GLYPHCACHE_H_
8
#
define
CORE_FXGE_CFX_GLYPHCACHE_H_
9
10
#
include
<
map
>
11
#
include
<
memory
>
12
#
include
<
tuple
>
13
14
#
include
"core/fxcrt/bytestring.h"
15
#
include
"core/fxcrt/observed_ptr.h"
16
#
include
"core/fxcrt/retain_ptr.h"
17
#
include
"core/fxge/cfx_face.h"
18
19
#
if
defined
(
PDF_USE_SKIA
)
20
#
include
"core/fxge/fx_font.h"
21
#
include
"third_party/skia/include/core/SkRefCnt.h"
// nogncheck
22
#
endif
23
24
class
CFX_Font
;
25
class
CFX_GlyphBitmap
;
26
class
CFX_Matrix
;
27
class
CFX_Path
;
28
struct
CFX_TextRenderOptions
;
29
30
class
CFX_GlyphCache
final
:
public
Retainable
,
public
Observable
{
31
public
:
32
CONSTRUCT_VIA_MAKE_RETAIN
;
33
34
const
CFX_GlyphBitmap
*
LoadGlyphBitmap
(
const
CFX_Font
* pFont,
35
uint32_t glyph_index,
36
bool
bFontStyle,
37
const
CFX_Matrix
& matrix,
38
int
dest_width,
39
int
anti_alias,
40
CFX_TextRenderOptions
* text_options);
41
const
CFX_Path
*
LoadGlyphPath
(
const
CFX_Font
* pFont,
42
uint32_t glyph_index,
43
int
dest_width);
44
int
GetGlyphWidth
(
const
CFX_Font
* font,
45
uint32_t glyph_index,
46
int
dest_width,
47
int
weight);
48
49
RetainPtr
<CFX_Face>
GetFace
() {
return
m_Face; }
50
51
#
if
defined
(
PDF_USE_SKIA
)
52
CFX_TypeFace* GetDeviceCache(
const
CFX_Font* pFont);
53
static
void
InitializeGlobals();
54
static
void
DestroyGlobals();
55
#
endif
56
57
private
:
58
explicit
CFX_GlyphCache(
RetainPtr
<CFX_Face> face);
59
~
CFX_GlyphCache
()
override
;
60
61
using
SizeGlyphCache = std::map<uint32_t, std::unique_ptr<CFX_GlyphBitmap>>;
62
// <glyph_index, width, weight, angle, vertical>
63
using
PathMapKey =
std
::tuple<uint32_t,
int
,
int
,
int
,
bool
>;
64
// <glyph_index, dest_width, weight>
65
using
WidthMapKey =
std
::tuple<uint32_t,
int
,
int
>;
66
67
std::unique_ptr<CFX_GlyphBitmap> RenderGlyph(
const
CFX_Font
* pFont,
68
uint32_t glyph_index,
69
bool
bFontStyle,
70
const
CFX_Matrix
& matrix,
71
int
dest_width,
72
int
anti_alias);
73
std::unique_ptr<CFX_GlyphBitmap> RenderGlyph_Nativetext(
74
const
CFX_Font
* pFont,
75
uint32_t glyph_index,
76
const
CFX_Matrix
& matrix,
77
int
dest_width,
78
int
anti_alias);
79
CFX_GlyphBitmap
* LookUpGlyphBitmap(
const
CFX_Font
* pFont,
80
const
CFX_Matrix
& matrix,
81
const
ByteString
& FaceGlyphsKey,
82
uint32_t glyph_index,
83
bool
bFontStyle,
84
int
dest_width,
85
int
anti_alias);
86
RetainPtr
<CFX_Face>
const
m_Face;
87
std::map<ByteString, SizeGlyphCache> m_SizeMap;
88
std::map<PathMapKey, std::unique_ptr<CFX_Path>> m_PathMap;
89
std::map<WidthMapKey,
int
> m_WidthMap;
90
#
if
defined
(
PDF_USE_SKIA
)
91
sk_sp<SkTypeface> m_pTypeface;
92
#
endif
93
};
94
95
#
endif
// CORE_FXGE_CFX_GLYPHCACHE_H_
ByteString
fxcrt::ByteString ByteString
Definition
bytestring.h:180
CApplePlatform::CApplePlatform
CApplePlatform()
CApplePlatform::Init
void Init() override
Definition
fx_apple_platform.cpp:147
CApplePlatform::CreateDefaultSystemFontInfo
std::unique_ptr< SystemFontInfoIface > CreateDefaultSystemFontInfo() override
Definition
fx_apple_platform.cpp:150
CApplePlatform::CreatePlatformFont
void * CreatePlatformFont(pdfium::span< const uint8_t > font_span) override
Definition
fx_apple_platform.cpp:160
CApplePlatform::m_quartz2d
CQuartz2D m_quartz2d
Definition
fx_apple_platform.h:25
CApplePlatform::~CApplePlatform
~CApplePlatform() override
CFX_Font
Definition
cfx_font.h:38
CFX_Font::GetPsName
ByteString GetPsName() const
Definition
cfx_font.cpp:376
CFX_Font::GetSubstFont
CFX_SubstFont * GetSubstFont() const
Definition
cfx_font.h:79
CFX_Font::IsBold
bool IsBold() const
Definition
cfx_font.cpp:361
CFX_GEModule::PlatformIface
Definition
cfx_gemodule.h:27
CFX_GEModule
Definition
cfx_gemodule.h:25
CFX_GEModule::GetPlatform
PlatformIface * GetPlatform() const
Definition
cfx_gemodule.h:46
CFX_GEModule::Get
static CFX_GEModule * Get()
Definition
cfx_gemodule.cpp:45
CFX_GlyphBitmap
Definition
cfx_glyphbitmap.h:14
CFX_GlyphCache::LoadGlyphBitmap
const CFX_GlyphBitmap * LoadGlyphBitmap(const CFX_Font *pFont, uint32_t glyph_index, bool bFontStyle, const CFX_Matrix &matrix, int dest_width, int anti_alias, CFX_TextRenderOptions *text_options)
Definition
cfx_glyphcache.cpp:154
CFX_GlyphCache::GetGlyphWidth
int GetGlyphWidth(const CFX_Font *font, uint32_t glyph_index, int dest_width, int weight)
Definition
cfx_glyphcache.cpp:224
CFX_GlyphCache::LoadGlyphPath
const CFX_Path * LoadGlyphPath(const CFX_Font *pFont, uint32_t glyph_index, int dest_width)
Definition
cfx_glyphcache.cpp:133
CFX_GlyphCache::GetFace
RetainPtr< CFX_Face > GetFace()
Definition
cfx_glyphcache.h:49
CFX_GlyphCache::~CFX_GlyphCache
~CFX_GlyphCache() override
CFX_Matrix
Definition
fx_coordinates.h:440
CFX_Matrix::d
float d
Definition
fx_coordinates.h:510
CFX_Matrix::a
float a
Definition
fx_coordinates.h:507
CFX_Matrix::c
float c
Definition
fx_coordinates.h:509
CFX_Matrix::b
float b
Definition
fx_coordinates.h:508
CFX_Path
Definition
cfx_path.h:18
CFX_SubstFont::m_Weight
int m_Weight
Definition
cfx_substfont.h:28
CQuartz2D
Definition
fx_quartz_device.h:20
CQuartz2D::SetGraphicsTextMatrix
void SetGraphicsTextMatrix(void *graphics, const CFX_Matrix &matrix)
Definition
fx_quartz_device.cpp:67
CQuartz2D::CreateFont
void * CreateFont(pdfium::span< const uint8_t > font_data)
Definition
fx_quartz_device.cpp:51
CQuartz2D::DrawGraphicsString
bool DrawGraphicsString(void *graphics, void *font, float font_size, pdfium::span< uint16_t > glyph_indices, pdfium::span< CGPoint > glyph_positions, FX_ARGB argb)
Definition
fx_quartz_device.cpp:78
CQuartz2D::DestroyGraphics
void DestroyGraphics(void *graphics)
Definition
fx_quartz_device.cpp:46
CQuartz2D::CreateGraphics
void * CreateGraphics(const RetainPtr< CFX_DIBitmap > &bitmap)
Definition
fx_quartz_device.cpp:26
CQuartz2D::DestroyFont
void DestroyFont(void *font)
Definition
fx_quartz_device.cpp:63
fxcrt::ByteString::operator==
bool operator==(const char *ptr) const
Definition
bytestring.cpp:208
fxcrt::Observable
Definition
observed_ptr.h:17
fxcrt::RetainPtr
Definition
retain_ptr.h:28
fxcrt::Retainable
Definition
retain_ptr.h:156
pdfium::CFDETextOutLargeBitmapTest
Definition
cfde_textout_unittest.cpp:117
pdfium::CFX_AggDeviceDriver::DrawDeviceText
bool DrawDeviceText(pdfium::span< const TextCharPos > pCharPos, CFX_Font *pFont, const CFX_Matrix &mtObject2Device, float font_size, uint32_t color, const CFX_TextRenderOptions &options) override
Definition
cfx_agg_devicedriver.cpp:951
pdfium::CFX_AggDeviceDriver::InitPlatform
void InitPlatform()
Definition
cfx_agg_devicedriver.cpp:947
pdfium::CFX_AggDeviceDriver::DestroyPlatform
void DestroyPlatform()
Definition
cfx_agg_devicedriver.cpp:949
FX_ARGB
uint32_t FX_ARGB
Definition
fx_dib.h:36
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
CONSTRUCT_VIA_MAKE_RETAIN
#define CONSTRUCT_VIA_MAKE_RETAIN
Definition
retain_ptr.h:222
CFX_TextRenderOptions
Definition
cfx_textrenderoptions.h:8
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fxge
cfx_glyphcache.h
Generated on
for Qt by
1.18.0