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
12namespace txt {
13
15
16bool TextStyle::equals(const TextStyle& other) const {
17 if (color != other.color) {
18 return false;
19 }
20 if (decoration != other.decoration) {
21 return false;
22 }
24 return false;
25 }
27 return false;
28 }
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 }
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
std::vector< std::string > font_families
Definition text_style.h:40
std::optional< flutter::DlPaint > foreground
Definition text_style.h:48
TextDecorationStyle decoration_style
Definition text_style.h:31
FontStyle font_style
Definition text_style.h:35
SkColor decoration_color
Definition text_style.h:30
double word_spacing
Definition text_style.h:43
bool has_height_override
Definition text_style.h:45
bool equals(const TextStyle &other) const
Definition text_style.cc:16
std::vector< TextShadow > text_shadows
Definition text_style.h:51
std::string locale
Definition text_style.h:46
SkColor color
Definition text_style.h:26
double decoration_thickness_multiplier
Definition text_style.h:33
double letter_spacing
Definition text_style.h:42
std::vector< std::string > GetDefaultFontFamilies()
Definition platform.cc:13