Flutter Engine
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
 
size_t text_height_behavior = TextHeightBehavior::kAll
 
bool has_height_override = false
 
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
 
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
 
minikin::BreakStrategy break_strategy
 

Detailed Description

Definition at line 63 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.

References ellipsis.

Referenced by txt::ParagraphTxt::Layout().

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

◆ GetTextStyle()

TextStyle txt::ParagraphStyle::GetTextStyle ( ) const

Definition at line 23 of file paragraph_style.cc.

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

Referenced by txt::ParagraphTxt::Layout(), and txt::ParagraphBuilderTxt::ParagraphBuilderTxt().

23  {
24  TextStyle result;
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 }
std::string font_family

◆ unlimited_lines()

bool txt::ParagraphStyle::unlimited_lines ( ) const

Definition at line 37 of file paragraph_style.cc.

References max_lines.

Referenced by txt::ParagraphTxt::Layout().

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

Member Data Documentation

◆ break_strategy

minikin::BreakStrategy txt::ParagraphStyle::break_strategy

◆ ellipsis

std::u16string txt::ParagraphStyle::ellipsis

◆ font_family

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

◆ font_size

double txt::ParagraphStyle::font_size = 14

Definition at line 70 of file paragraph_style.h.

Referenced by flutter::decodeStrut(), and GetTextStyle().

◆ font_style

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

Definition at line 68 of file paragraph_style.h.

Referenced by flutter::decodeStrut(), and GetTextStyle().

◆ font_weight

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

Definition at line 67 of file paragraph_style.h.

Referenced by flutter::decodeStrut(), and GetTextStyle().

◆ force_strut_height

bool txt::ParagraphStyle::force_strut_height = false

Definition at line 87 of file paragraph_style.h.

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

◆ has_height_override

bool txt::ParagraphStyle::has_height_override = false

Definition at line 73 of file paragraph_style.h.

Referenced by flutter::decodeStrut(), and GetTextStyle().

◆ height

double txt::ParagraphStyle::height = 1

Definition at line 71 of file paragraph_style.h.

Referenced by flutter::decodeStrut(), and GetTextStyle().

◆ locale

std::string txt::ParagraphStyle::locale

Definition at line 94 of file paragraph_style.h.

Referenced by flutter::decodeStrut(), and GetTextStyle().

◆ max_lines

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

◆ strut_enabled

bool txt::ParagraphStyle::strut_enabled = false

◆ strut_font_families

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

Definition at line 81 of file paragraph_style.h.

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

◆ strut_font_size

double txt::ParagraphStyle::strut_font_size = 14

Definition at line 82 of file paragraph_style.h.

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

◆ strut_font_style

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

Definition at line 80 of file paragraph_style.h.

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

◆ strut_font_weight

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

Definition at line 79 of file paragraph_style.h.

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

◆ strut_has_height_override

bool txt::ParagraphStyle::strut_has_height_override = false

Definition at line 84 of file paragraph_style.h.

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

◆ strut_height

double txt::ParagraphStyle::strut_height = 1

Definition at line 83 of file paragraph_style.h.

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

◆ strut_leading

double txt::ParagraphStyle::strut_leading = -1

Definition at line 85 of file paragraph_style.h.

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

◆ text_align

◆ text_direction

◆ text_height_behavior

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

Definition at line 72 of file paragraph_style.h.

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


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