Flutter Engine
Loading...
Searching...
No Matches
text_style.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter 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
#include "
text_style.h
"
6
7
#include "
font_style.h
"
8
#include "
font_weight.h
"
9
#include "third_party/skia/include/core/SkColor.h"
10
#include "
txt/platform.h
"
11
12
namespace
txt
{
13
14
TextStyle::TextStyle
() : font_families(
GetDefaultFontFamilies
()) {}
15
16
bool
TextStyle::equals
(
const
TextStyle
& other)
const
{
17
if
(
color
!= other.
color
) {
18
return
false
;
19
}
20
if
(
decoration
!= other.
decoration
) {
21
return
false
;
22
}
23
if
(
decoration_color
!= other.
decoration_color
) {
24
return
false
;
25
}
26
if
(
decoration_style
!= other.
decoration_style
) {
27
return
false
;
28
}
29
if
(
decoration_thickness_multiplier
!=
30
other.
decoration_thickness_multiplier
) {
31
return
false
;
32
}
33
if
(
font_weight
!= other.
font_weight
) {
34
return
false
;
35
}
36
if
(
font_style
!= other.
font_style
) {
37
return
false
;
38
}
39
if
(
letter_spacing
!= other.
letter_spacing
) {
40
return
false
;
41
}
42
if
(
word_spacing
!= other.
word_spacing
) {
43
return
false
;
44
}
45
if
(
height
!= other.
height
) {
46
return
false
;
47
}
48
if
(
has_height_override
!= other.
has_height_override
) {
49
return
false
;
50
}
51
if
(
half_leading
!= other.
half_leading
) {
52
return
false
;
53
}
54
if
(
locale
!= other.
locale
) {
55
return
false
;
56
}
57
if
(
foreground
!= other.
foreground
) {
58
return
false
;
59
}
60
if
(
font_families
.size() != other.
font_families
.size()) {
61
return
false
;
62
}
63
if
(
text_shadows
.size() != other.
text_shadows
.size()) {
64
return
false
;
65
}
66
for
(
size_t
font_index = 0; font_index <
font_families
.size(); ++font_index) {
67
if
(
font_families
[font_index] != other.
font_families
[font_index]) {
68
return
false
;
69
}
70
}
71
for
(
size_t
shadow_index = 0; shadow_index <
text_shadows
.size();
72
++shadow_index) {
73
if
(
text_shadows
[shadow_index] != other.
text_shadows
[shadow_index]) {
74
return
false
;
75
}
76
}
77
78
return
true
;
79
}
80
81
}
// namespace txt
txt::TextStyle
Definition
text_style.h:24
txt::TextStyle::font_families
std::vector< std::string > font_families
Definition
text_style.h:40
txt::TextStyle::TextStyle
TextStyle()
Definition
text_style.cc:14
txt::TextStyle::foreground
std::optional< flutter::DlPaint > foreground
Definition
text_style.h:48
txt::TextStyle::decoration_style
TextDecorationStyle decoration_style
Definition
text_style.h:31
txt::TextStyle::height
double height
Definition
text_style.h:44
txt::TextStyle::font_style
FontStyle font_style
Definition
text_style.h:35
txt::TextStyle::decoration_color
SkColor decoration_color
Definition
text_style.h:30
txt::TextStyle::font_weight
int font_weight
Definition
text_style.h:34
txt::TextStyle::word_spacing
double word_spacing
Definition
text_style.h:43
txt::TextStyle::decoration
int decoration
Definition
text_style.h:27
txt::TextStyle::has_height_override
bool has_height_override
Definition
text_style.h:45
txt::TextStyle::equals
bool equals(const TextStyle &other) const
Definition
text_style.cc:16
txt::TextStyle::half_leading
bool half_leading
Definition
text_style.h:37
txt::TextStyle::text_shadows
std::vector< TextShadow > text_shadows
Definition
text_style.h:51
txt::TextStyle::locale
std::string locale
Definition
text_style.h:46
txt::TextStyle::color
SkColor color
Definition
text_style.h:26
txt::TextStyle::decoration_thickness_multiplier
double decoration_thickness_multiplier
Definition
text_style.h:33
txt::TextStyle::letter_spacing
double letter_spacing
Definition
text_style.h:42
font_style.h
font_weight.h
txt
Definition
paragraph_builder_skia.cc:15
txt::GetDefaultFontFamilies
std::vector< std::string > GetDefaultFontFamilies()
Definition
platform.cc:13
platform.h
text_style.h
txt
src
txt
text_style.cc
Generated on Thu Nov 6 2025 16:11:30 for Flutter Engine by
1.9.8