Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
txt
src
txt
text_style.cc
Go to the documentation of this file.
1
/*
2
* Copyright 2017 Google, Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#include "
text_style.h
"
18
19
#include "
font_style.h
"
20
#include "
font_weight.h
"
21
#include "
third_party/skia/include/core/SkColor.h
"
22
#include "
txt/platform.h
"
23
24
namespace
txt
{
25
26
TextStyle::TextStyle
() : font_families(
GetDefaultFontFamilies
()) {}
27
28
bool
TextStyle::equals
(
const
TextStyle
& other)
const
{
29
if
(
color
!= other.
color
)
30
return
false
;
31
if
(
decoration
!= other.
decoration
)
32
return
false
;
33
if
(
decoration_color
!= other.
decoration_color
)
34
return
false
;
35
if
(
decoration_style
!= other.
decoration_style
)
36
return
false
;
37
if
(
decoration_thickness_multiplier
!= other.
decoration_thickness_multiplier
)
38
return
false
;
39
if
(
font_weight
!= other.
font_weight
)
40
return
false
;
41
if
(
font_style
!= other.
font_style
)
42
return
false
;
43
if
(
letter_spacing
!= other.
letter_spacing
)
44
return
false
;
45
if
(
word_spacing
!= other.
word_spacing
)
46
return
false
;
47
if
(
height
!= other.
height
)
48
return
false
;
49
if
(
has_height_override
!= other.
has_height_override
)
50
return
false
;
51
if
(
half_leading
!= other.
half_leading
)
52
return
false
;
53
if
(
locale
!= other.
locale
)
54
return
false
;
55
if
(
foreground
!= other.
foreground
)
56
return
false
;
57
if
(
font_families
.size() != other.
font_families
.size())
58
return
false
;
59
if
(
text_shadows
.size() != other.
text_shadows
.size())
60
return
false
;
61
for
(
size_t
font_index = 0; font_index <
font_families
.size(); ++font_index) {
62
if
(
font_families
[font_index] != other.
font_families
[font_index])
63
return
false
;
64
}
65
for
(
size_t
shadow_index = 0; shadow_index <
text_shadows
.size();
66
++shadow_index) {
67
if
(
text_shadows
[shadow_index] != other.
text_shadows
[shadow_index])
68
return
false
;
69
}
70
71
return
true
;
72
}
73
74
}
// namespace txt
SkColor.h
txt::TextStyle
Definition
text_style.h:36
txt::TextStyle::font_families
std::vector< std::string > font_families
Definition
text_style.h:52
txt::TextStyle::TextStyle
TextStyle()
Definition
text_style.cc:26
txt::TextStyle::foreground
std::optional< flutter::DlPaint > foreground
Definition
text_style.h:60
txt::TextStyle::decoration_style
TextDecorationStyle decoration_style
Definition
text_style.h:43
txt::TextStyle::height
double height
Definition
text_style.h:56
txt::TextStyle::font_style
FontStyle font_style
Definition
text_style.h:47
txt::TextStyle::decoration_color
SkColor decoration_color
Definition
text_style.h:42
txt::TextStyle::word_spacing
double word_spacing
Definition
text_style.h:55
txt::TextStyle::decoration
int decoration
Definition
text_style.h:39
txt::TextStyle::has_height_override
bool has_height_override
Definition
text_style.h:57
txt::TextStyle::equals
bool equals(const TextStyle &other) const
Definition
text_style.cc:28
txt::TextStyle::half_leading
bool half_leading
Definition
text_style.h:49
txt::TextStyle::text_shadows
std::vector< TextShadow > text_shadows
Definition
text_style.h:63
txt::TextStyle::locale
std::string locale
Definition
text_style.h:58
txt::TextStyle::color
SkColor color
Definition
text_style.h:38
txt::TextStyle::decoration_thickness_multiplier
double decoration_thickness_multiplier
Definition
text_style.h:45
txt::TextStyle::font_weight
FontWeight font_weight
Definition
text_style.h:46
txt::TextStyle::letter_spacing
double letter_spacing
Definition
text_style.h:54
font_style.h
font_weight.h
txt
Definition
paragraph_builder_skia.cc:26
txt::GetDefaultFontFamilies
std::vector< std::string > GetDefaultFontFamilies()
Definition
platform.cc:13
text_style.h
platform.h
Generated on Fri Apr 26 2024 06:18:17 for Flutter Engine by
1.9.8