Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
txt::ParagraphStyle Class Reference

#include <paragraph_style.h>

Public Member Functions

TextStyle GetTextStyle () const
 
bool unlimited_lines () const
 
bool ellipsized () const
 
TextAlign effective_align () const
 

Public Attributes

FontWeight font_weight = FontWeight::w400
 
FontStyle font_style = FontStyle::normal
 
std::string font_family = ""
 
double font_size = 14
 
double height = 1
 
bool has_height_override = false
 
size_t text_height_behavior = TextHeightBehavior::kAll
 
bool strut_enabled = false
 
FontWeight strut_font_weight = FontWeight::w400
 
FontStyle strut_font_style = FontStyle::normal
 
std::vector< std::string > strut_font_families
 
double strut_font_size = 14
 
double strut_height = 1
 
bool strut_has_height_override = false
 
bool strut_half_leading = false
 
double strut_leading = -1
 
bool force_strut_height = false
 
TextAlign text_align = TextAlign::start
 
TextDirection text_direction = TextDirection::ltr
 
size_t max_lines = std::numeric_limits<size_t>::max()
 
std::u16string ellipsis
 
std::string locale
 

Detailed Description

Definition at line 64 of file paragraph_style.h.

Member Function Documentation

◆ effective_align()

TextAlign txt::ParagraphStyle::effective_align ( ) const

◆ ellipsized()

bool txt::ParagraphStyle::ellipsized ( ) const

Definition at line 41 of file paragraph_style.cc.

41 {
42 return !ellipsis.empty();
43}
std::u16string ellipsis

◆ GetTextStyle()

TextStyle txt::ParagraphStyle::GetTextStyle ( ) const

Definition at line 23 of file paragraph_style.cc.

23 {
25 result.font_weight = font_weight;
26 result.font_style = font_style;
27 result.font_families = std::vector<std::string>({font_family});
28 if (font_size >= 0) {
29 result.font_size = font_size;
30 }
31 result.locale = locale;
32 result.height = height;
33 result.has_height_override = has_height_override;
34 return result;
35}
GAsyncResult * result

◆ unlimited_lines()

bool txt::ParagraphStyle::unlimited_lines ( ) const

Definition at line 37 of file paragraph_style.cc.

37 {
38 return max_lines == std::numeric_limits<size_t>::max();
39};

Member Data Documentation

◆ ellipsis

std::u16string txt::ParagraphStyle::ellipsis

Definition at line 95 of file paragraph_style.h.

◆ font_family

std::string txt::ParagraphStyle::font_family = ""

Definition at line 70 of file paragraph_style.h.

◆ font_size

double txt::ParagraphStyle::font_size = 14

Definition at line 71 of file paragraph_style.h.

◆ font_style

FontStyle txt::ParagraphStyle::font_style = FontStyle::normal

Definition at line 69 of file paragraph_style.h.

◆ font_weight

FontWeight txt::ParagraphStyle::font_weight = FontWeight::w400

Definition at line 68 of file paragraph_style.h.

◆ force_strut_height

bool txt::ParagraphStyle::force_strut_height = false

Definition at line 89 of file paragraph_style.h.

◆ has_height_override

bool txt::ParagraphStyle::has_height_override = false

Definition at line 73 of file paragraph_style.h.

◆ height

double txt::ParagraphStyle::height = 1

Definition at line 72 of file paragraph_style.h.

◆ locale

std::string txt::ParagraphStyle::locale

Definition at line 96 of file paragraph_style.h.

◆ max_lines

size_t txt::ParagraphStyle::max_lines = std::numeric_limits<size_t>::max()

Definition at line 94 of file paragraph_style.h.

◆ strut_enabled

bool txt::ParagraphStyle::strut_enabled = false

Definition at line 79 of file paragraph_style.h.

◆ strut_font_families

std::vector<std::string> txt::ParagraphStyle::strut_font_families

Definition at line 82 of file paragraph_style.h.

◆ strut_font_size

double txt::ParagraphStyle::strut_font_size = 14

Definition at line 83 of file paragraph_style.h.

◆ strut_font_style

FontStyle txt::ParagraphStyle::strut_font_style = FontStyle::normal

Definition at line 81 of file paragraph_style.h.

◆ strut_font_weight

FontWeight txt::ParagraphStyle::strut_font_weight = FontWeight::w400

Definition at line 80 of file paragraph_style.h.

◆ strut_half_leading

bool txt::ParagraphStyle::strut_half_leading = false

Definition at line 86 of file paragraph_style.h.

◆ strut_has_height_override

bool txt::ParagraphStyle::strut_has_height_override = false

Definition at line 85 of file paragraph_style.h.

◆ strut_height

double txt::ParagraphStyle::strut_height = 1

Definition at line 84 of file paragraph_style.h.

◆ strut_leading

double txt::ParagraphStyle::strut_leading = -1

Definition at line 87 of file paragraph_style.h.

◆ text_align

TextAlign txt::ParagraphStyle::text_align = TextAlign::start

Definition at line 92 of file paragraph_style.h.

◆ text_direction

TextDirection txt::ParagraphStyle::text_direction = TextDirection::ltr

Definition at line 93 of file paragraph_style.h.

◆ text_height_behavior

size_t txt::ParagraphStyle::text_height_behavior = TextHeightBehavior::kAll

Definition at line 74 of file paragraph_style.h.


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