Flutter Engine
The Flutter Engine
third_party
skia
src
ports
SkFontConfigTypeface.h
Go to the documentation of this file.
1
/*
2
* Copyright 2013 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#ifndef SkFontConfigTypeface_DEFINED
9
#define SkFontConfigTypeface_DEFINED
10
11
#include "
include/core/SkFontStyle.h
"
12
#include "
include/core/SkRefCnt.h
"
13
#include "
include/core/SkStream.h
"
14
#include "
include/ports/SkFontConfigInterface.h
"
15
#include "
src/core/SkFontDescriptor.h
"
16
#include "
src/ports/SkTypeface_FreeType.h
"
17
18
class
SkFontDescriptor
;
19
20
class
SkTypeface_FCI
:
public
SkTypeface_FreeType
{
21
sk_sp<SkFontConfigInterface>
fFCI;
22
SkFontConfigInterface::FontIdentity
fIdentity;
23
SkString
fFamilyName;
24
25
public
:
26
static
SkTypeface_FCI
*
Create
(
sk_sp<SkFontConfigInterface>
fci,
27
const
SkFontConfigInterface::FontIdentity
& fi,
28
SkString
familyName,
29
const
SkFontStyle
& style)
30
{
31
return
new
SkTypeface_FCI
(std::move(fci), fi, std::move(familyName), style);
32
}
33
34
const
SkFontConfigInterface::FontIdentity
&
getIdentity
()
const
{
35
return
fIdentity;
36
}
37
38
sk_sp<SkTypeface>
onMakeClone
(
const
SkFontArguments
&
args
)
const override
{
39
SkFontStyle
style = this->
fontStyle
();
40
std::unique_ptr<SkFontData>
data
= this->
cloneFontData
(args, &style);
41
if
(!
data
) {
42
return
nullptr
;
43
}
44
return
sk_sp<SkTypeface>
(
new
SkTypeface_FreeTypeStream
(
45
std::move(
data
), fFamilyName, style, this->
isFixedPitch
()));
46
}
47
48
protected
:
49
SkTypeface_FCI
(
sk_sp<SkFontConfigInterface>
fci,
50
const
SkFontConfigInterface::FontIdentity
& fi,
51
SkString
familyName,
52
const
SkFontStyle
& style)
53
:
INHERITED
(style,
false
)
54
, fFCI(
std
::move(fci))
55
, fIdentity(fi)
56
, fFamilyName(
std
::move(familyName)) {}
57
58
void
onGetFamilyName
(
SkString
* familyName)
const override
{ *familyName = fFamilyName; }
59
void
onGetFontDescriptor
(
SkFontDescriptor
*,
bool
*)
const override
;
60
std::unique_ptr<SkStreamAsset>
onOpenStream
(
int
* ttcIndex)
const override
;
61
std::unique_ptr<SkFontData>
onMakeFontData
()
const override
;
62
63
private
:
64
using
INHERITED =
SkTypeface_FreeType
;
65
};
66
67
#endif
// SkFontConfigTypeface_DEFINED
SkFontConfigInterface.h
SkFontDescriptor.h
SkFontStyle.h
SkRefCnt.h
SkStream.h
SkTypeface_FreeType.h
SkFontDescriptor
Definition:
SkFontDescriptor.h:85
SkFontStyle
Definition:
SkFontStyle.h:16
SkString
Definition:
SkString.h:118
SkTypeface_FCI
Definition:
SkFontConfigTypeface.h:20
SkTypeface_FCI::getIdentity
const SkFontConfigInterface::FontIdentity & getIdentity() const
Definition:
SkFontConfigTypeface.h:34
SkTypeface_FCI::onGetFamilyName
void onGetFamilyName(SkString *familyName) const override
Definition:
SkFontConfigTypeface.h:58
SkTypeface_FCI::onGetFontDescriptor
void onGetFontDescriptor(SkFontDescriptor *, bool *) const override
Definition:
SkFontMgr_FontConfigInterface.cpp:35
SkTypeface_FCI::onOpenStream
std::unique_ptr< SkStreamAsset > onOpenStream(int *ttcIndex) const override
Definition:
SkFontMgr_FontConfigInterface.cpp:24
SkTypeface_FCI::onMakeClone
sk_sp< SkTypeface > onMakeClone(const SkFontArguments &args) const override
Definition:
SkFontConfigTypeface.h:38
SkTypeface_FCI::onMakeFontData
std::unique_ptr< SkFontData > onMakeFontData() const override
Definition:
SkFontMgr_FontConfigInterface.cpp:29
SkTypeface_FCI::Create
static SkTypeface_FCI * Create(sk_sp< SkFontConfigInterface > fci, const SkFontConfigInterface::FontIdentity &fi, SkString familyName, const SkFontStyle &style)
Definition:
SkFontConfigTypeface.h:26
SkTypeface_FCI::SkTypeface_FCI
SkTypeface_FCI(sk_sp< SkFontConfigInterface > fci, const SkFontConfigInterface::FontIdentity &fi, SkString familyName, const SkFontStyle &style)
Definition:
SkFontConfigTypeface.h:49
SkTypeface_FreeTypeStream
Definition:
SkTypeface_FreeType.h:92
SkTypeface_FreeType
Definition:
SkTypeface_FreeType.h:32
SkTypeface_FreeType::cloneFontData
std::unique_ptr< SkFontData > cloneFontData(const SkFontArguments &, SkFontStyle *style) const
Definition:
SkFontHost_FreeType.cpp:749
SkTypeface_FreeType::SkTypeface_FreeType
SkTypeface_FreeType(const SkFontStyle &style, bool isFixedPitch)
Definition:
SkFontHost_FreeType.cpp:1706
SkTypeface::fontStyle
SkFontStyle fontStyle() const
Definition:
SkTypeface.h:55
SkTypeface::isFixedPitch
bool isFixedPitch() const
Definition:
SkTypeface.h:68
SkWeakRefCnt
Definition:
SkWeakRefCnt.h:55
sk_sp< SkFontConfigInterface >
args
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
Definition:
fl_event_channel.h:89
dart::false
false
Definition:
isolate_reload.cc:58
std
Definition:
ref_ptr.h:256
SkFontArguments
Definition:
SkFontArguments.h:16
SkFontConfigInterface::FontIdentity
Definition:
SkFontConfigInterface.h:45
data
std::shared_ptr< const fml::Mapping > data
Definition:
texture_gles.cc:63
Generated on Sun Jun 23 2024 21:56:31 for Flutter Engine by
1.9.4