Flutter Engine
 
Loading...
Searching...
No Matches
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

int font_weight = FontWeight::normal
 
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
 
int strut_font_weight = FontWeight::normal
 
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 56 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 29 of file paragraph_style.cc.

29 {
30 return !ellipsis.empty();
31}
std::u16string ellipsis

References ellipsis.

◆ GetTextStyle()

TextStyle txt::ParagraphStyle::GetTextStyle ( ) const

Definition at line 11 of file paragraph_style.cc.

11 {
12 TextStyle result;
13 result.font_weight = font_weight;
14 result.font_style = font_style;
15 result.font_families = std::vector<std::string>({font_family});
16 if (font_size >= 0) {
17 result.font_size = font_size;
18 }
19 result.locale = locale;
20 result.height = height;
21 result.has_height_override = has_height_override;
22 return result;
23}

References txt::TextStyle::font_families, font_family, font_size, txt::TextStyle::font_size, font_style, txt::TextStyle::font_style, font_weight, txt::TextStyle::font_weight, has_height_override, txt::TextStyle::has_height_override, height, txt::TextStyle::height, locale, and txt::TextStyle::locale.

Referenced by impeller::interop::ParagraphStyle::CreateTextStyle().

◆ unlimited_lines()

bool txt::ParagraphStyle::unlimited_lines ( ) const

Definition at line 25 of file paragraph_style.cc.

25 {
26 return max_lines == std::numeric_limits<size_t>::max();
27};

References max_lines.

Member Data Documentation

◆ ellipsis

std::u16string txt::ParagraphStyle::ellipsis

Definition at line 87 of file paragraph_style.h.

Referenced by ellipsized(), and impeller::interop::ParagraphStyle::SetEllipsis().

◆ font_family

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

◆ font_size

double txt::ParagraphStyle::font_size = 14

◆ font_style

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

◆ font_weight

int txt::ParagraphStyle::font_weight = FontWeight::normal

◆ force_strut_height

bool txt::ParagraphStyle::force_strut_height = false

Definition at line 81 of file paragraph_style.h.

Referenced by flutter::decodeStrut().

◆ has_height_override

bool txt::ParagraphStyle::has_height_override = false

Definition at line 65 of file paragraph_style.h.

Referenced by GetTextStyle(), and impeller::interop::ParagraphStyle::SetHeight().

◆ height

double txt::ParagraphStyle::height = 1

Definition at line 64 of file paragraph_style.h.

Referenced by GetTextStyle(), and impeller::interop::ParagraphStyle::SetHeight().

◆ locale

std::string txt::ParagraphStyle::locale

Definition at line 88 of file paragraph_style.h.

Referenced by GetTextStyle(), and impeller::interop::ParagraphStyle::SetLocale().

◆ max_lines

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

◆ strut_enabled

bool txt::ParagraphStyle::strut_enabled = false

Definition at line 71 of file paragraph_style.h.

Referenced by flutter::decodeStrut().

◆ strut_font_families

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

Definition at line 74 of file paragraph_style.h.

Referenced by flutter::decodeStrut().

◆ strut_font_size

double txt::ParagraphStyle::strut_font_size = 14

Definition at line 75 of file paragraph_style.h.

Referenced by flutter::decodeStrut().

◆ strut_font_style

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

Definition at line 73 of file paragraph_style.h.

Referenced by flutter::decodeStrut().

◆ strut_font_weight

int txt::ParagraphStyle::strut_font_weight = FontWeight::normal

Definition at line 72 of file paragraph_style.h.

Referenced by flutter::decodeStrut().

◆ strut_half_leading

bool txt::ParagraphStyle::strut_half_leading = false

Definition at line 78 of file paragraph_style.h.

Referenced by flutter::decodeStrut(), and txt::TEST_F().

◆ strut_has_height_override

bool txt::ParagraphStyle::strut_has_height_override = false

Definition at line 77 of file paragraph_style.h.

Referenced by flutter::decodeStrut().

◆ strut_height

double txt::ParagraphStyle::strut_height = 1

Definition at line 76 of file paragraph_style.h.

Referenced by flutter::decodeStrut().

◆ strut_leading

double txt::ParagraphStyle::strut_leading = -1

Definition at line 79 of file paragraph_style.h.

Referenced by flutter::decodeStrut().

◆ text_align

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

◆ text_direction

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

◆ text_height_behavior

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

Definition at line 66 of file paragraph_style.h.


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