Flutter Engine
 
Loading...
Searching...
No Matches
txt::TextStyle Class Reference

#include <text_style.h>

Public Member Functions

 TextStyle ()
 
bool equals (const TextStyle &other) const
 

Public Attributes

SkColor color = SK_ColorWHITE
 
int decoration = TextDecoration::kNone
 
SkColor decoration_color = SK_ColorTRANSPARENT
 
TextDecorationStyle decoration_style = TextDecorationStyle::kSolid
 
double decoration_thickness_multiplier = 1.0
 
int font_weight = FontWeight::normal
 
FontStyle font_style = FontStyle::normal
 
TextBaseline text_baseline = TextBaseline::kAlphabetic
 
bool half_leading = false
 
std::vector< std::string > font_families
 
double font_size = 14.0
 
double letter_spacing = 0.0
 
double word_spacing = 0.0
 
double height = 1.0
 
bool has_height_override = false
 
std::string locale
 
std::optional< flutter::DlPaintbackground
 
std::optional< flutter::DlPaintforeground
 
std::vector< TextShadowtext_shadows
 
FontFeatures font_features
 
FontVariations font_variations
 

Detailed Description

Definition at line 24 of file text_style.h.

Constructor & Destructor Documentation

◆ TextStyle()

txt::TextStyle::TextStyle ( )

Definition at line 14 of file text_style.cc.

std::vector< std::string > font_families
Definition text_style.h:40
std::vector< std::string > GetDefaultFontFamilies()
Definition platform.cc:13

Member Function Documentation

◆ equals()

bool txt::TextStyle::equals ( const TextStyle other) const

Definition at line 16 of file text_style.cc.

16 {
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 }
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}
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
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

References color, decoration, decoration_color, decoration_style, decoration_thickness_multiplier, font_families, font_style, font_weight, foreground, half_leading, has_height_override, height, letter_spacing, locale, text_shadows, and word_spacing.

Member Data Documentation

◆ background

std::optional<flutter::DlPaint> txt::TextStyle::background

Definition at line 47 of file text_style.h.

Referenced by flutter::ParagraphBuilder::pushStyle().

◆ color

SkColor txt::TextStyle::color = SK_ColorWHITE

Definition at line 26 of file text_style.h.

Referenced by equals(), and flutter::ParagraphBuilder::pushStyle().

◆ decoration

int txt::TextStyle::decoration = TextDecoration::kNone

Definition at line 27 of file text_style.h.

Referenced by equals(), and flutter::ParagraphBuilder::pushStyle().

◆ decoration_color

SkColor txt::TextStyle::decoration_color = SK_ColorTRANSPARENT

Definition at line 30 of file text_style.h.

Referenced by equals(), and flutter::ParagraphBuilder::pushStyle().

◆ decoration_style

TextDecorationStyle txt::TextStyle::decoration_style = TextDecorationStyle::kSolid

Definition at line 31 of file text_style.h.

Referenced by equals(), and flutter::ParagraphBuilder::pushStyle().

◆ decoration_thickness_multiplier

double txt::TextStyle::decoration_thickness_multiplier = 1.0

Definition at line 33 of file text_style.h.

Referenced by equals(), and flutter::ParagraphBuilder::pushStyle().

◆ font_families

std::vector<std::string> txt::TextStyle::font_families

◆ font_features

FontFeatures txt::TextStyle::font_features

Definition at line 52 of file text_style.h.

Referenced by flutter::ParagraphBuilder::pushStyle().

◆ font_size

double txt::TextStyle::font_size = 14.0

◆ font_style

FontStyle txt::TextStyle::font_style = FontStyle::normal

◆ font_variations

FontVariations txt::TextStyle::font_variations

Definition at line 53 of file text_style.h.

Referenced by flutter::ParagraphBuilder::pushStyle().

◆ font_weight

int txt::TextStyle::font_weight = FontWeight::normal

◆ foreground

std::optional<flutter::DlPaint> txt::TextStyle::foreground

◆ half_leading

bool txt::TextStyle::half_leading = false

Definition at line 37 of file text_style.h.

Referenced by equals(), and flutter::ParagraphBuilder::pushStyle().

◆ has_height_override

bool txt::TextStyle::has_height_override = false

◆ height

double txt::TextStyle::height = 1.0

◆ letter_spacing

double txt::TextStyle::letter_spacing = 0.0

Definition at line 42 of file text_style.h.

Referenced by equals(), and flutter::ParagraphBuilder::pushStyle().

◆ locale

std::string txt::TextStyle::locale

◆ text_baseline

TextBaseline txt::TextStyle::text_baseline = TextBaseline::kAlphabetic

Definition at line 36 of file text_style.h.

◆ text_shadows

std::vector<TextShadow> txt::TextStyle::text_shadows

Definition at line 51 of file text_style.h.

Referenced by equals(), and flutter::ParagraphBuilder::pushStyle().

◆ word_spacing

double txt::TextStyle::word_spacing = 0.0

Definition at line 43 of file text_style.h.

Referenced by equals(), and flutter::ParagraphBuilder::pushStyle().


The documentation for this class was generated from the following files: