Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
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
 
FontWeight font_weight = FontWeight::w400
 
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 36 of file text_style.h.

Constructor & Destructor Documentation

◆ TextStyle()

txt::TextStyle::TextStyle ( )

Definition at line 26 of file text_style.cc.

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

Member Function Documentation

◆ equals()

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

Definition at line 28 of file text_style.cc.

28 {
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}
std::optional< flutter::DlPaint > foreground
Definition text_style.h:60
TextDecorationStyle decoration_style
Definition text_style.h:43
FontStyle font_style
Definition text_style.h:47
SkColor decoration_color
Definition text_style.h:42
double word_spacing
Definition text_style.h:55
bool has_height_override
Definition text_style.h:57
std::vector< TextShadow > text_shadows
Definition text_style.h:63
std::string locale
Definition text_style.h:58
SkColor color
Definition text_style.h:38
double decoration_thickness_multiplier
Definition text_style.h:45
FontWeight font_weight
Definition text_style.h:46
double letter_spacing
Definition text_style.h:54

Member Data Documentation

◆ background

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

Definition at line 59 of file text_style.h.

◆ color

SkColor txt::TextStyle::color = SK_ColorWHITE

Definition at line 38 of file text_style.h.

◆ decoration

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

Definition at line 39 of file text_style.h.

◆ decoration_color

SkColor txt::TextStyle::decoration_color = SK_ColorTRANSPARENT

Definition at line 42 of file text_style.h.

◆ decoration_style

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

Definition at line 43 of file text_style.h.

◆ decoration_thickness_multiplier

double txt::TextStyle::decoration_thickness_multiplier = 1.0

Definition at line 45 of file text_style.h.

◆ font_families

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

Definition at line 52 of file text_style.h.

◆ font_features

FontFeatures txt::TextStyle::font_features

Definition at line 64 of file text_style.h.

◆ font_size

double txt::TextStyle::font_size = 14.0

Definition at line 53 of file text_style.h.

◆ font_style

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

Definition at line 47 of file text_style.h.

◆ font_variations

FontVariations txt::TextStyle::font_variations

Definition at line 65 of file text_style.h.

◆ font_weight

FontWeight txt::TextStyle::font_weight = FontWeight::w400

Definition at line 46 of file text_style.h.

◆ foreground

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

Definition at line 60 of file text_style.h.

◆ half_leading

bool txt::TextStyle::half_leading = false

Definition at line 49 of file text_style.h.

◆ has_height_override

bool txt::TextStyle::has_height_override = false

Definition at line 57 of file text_style.h.

◆ height

double txt::TextStyle::height = 1.0

Definition at line 56 of file text_style.h.

◆ letter_spacing

double txt::TextStyle::letter_spacing = 0.0

Definition at line 54 of file text_style.h.

◆ locale

std::string txt::TextStyle::locale

Definition at line 58 of file text_style.h.

◆ text_baseline

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

Definition at line 48 of file text_style.h.

◆ text_shadows

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

Definition at line 63 of file text_style.h.

◆ word_spacing

double txt::TextStyle::word_spacing = 0.0

Definition at line 55 of file text_style.h.


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