Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
skia::textlayout::ParagraphStyle Struct Reference

#include <ParagraphStyle.h>

Public Member Functions

 ParagraphStyle ()
 
bool operator== (const ParagraphStyle &rhs) const
 
const StrutStylegetStrutStyle () const
 
void setStrutStyle (StrutStyle strutStyle)
 
const TextStylegetTextStyle () const
 
void setTextStyle (const TextStyle &textStyle)
 
TextDirection getTextDirection () const
 
void setTextDirection (TextDirection direction)
 
TextAlign getTextAlign () const
 
void setTextAlign (TextAlign align)
 
size_t getMaxLines () const
 
void setMaxLines (size_t maxLines)
 
SkString getEllipsis () const
 
std::u16string getEllipsisUtf16 () const
 
void setEllipsis (const std::u16string &ellipsis)
 
void setEllipsis (const SkString &ellipsis)
 
SkScalar getHeight () const
 
void setHeight (SkScalar height)
 
TextHeightBehavior getTextHeightBehavior () const
 
void setTextHeightBehavior (TextHeightBehavior v)
 
bool unlimited_lines () const
 
bool ellipsized () const
 
TextAlign effective_align () const
 
bool hintingIsOn () const
 
void turnHintingOff ()
 
bool getReplaceTabCharacters () const
 
void setReplaceTabCharacters (bool value)
 
bool getApplyRoundingHack () const
 
void setApplyRoundingHack (bool value)
 

Detailed Description

Definition at line 78 of file ParagraphStyle.h.

Constructor & Destructor Documentation

◆ ParagraphStyle()

skia::textlayout::ParagraphStyle::ParagraphStyle ( )

Definition at line 22 of file ParagraphStyle.cpp.

22 {
23 fTextAlign = TextAlign::kStart;
24 fTextDirection = TextDirection::kLtr;
25 fLinesLimit = std::numeric_limits<size_t>::max();
26 fHeight = 1;
27 fTextHeightBehavior = TextHeightBehavior::kAll;
28 fHintingIsOn = true;
29 fReplaceTabCharacters = false;
30}

Member Function Documentation

◆ effective_align()

TextAlign skia::textlayout::ParagraphStyle::effective_align ( ) const

Definition at line 32 of file ParagraphStyle.cpp.

32 {
33 if (fTextAlign == TextAlign::kStart) {
34 return (fTextDirection == TextDirection::kLtr) ? TextAlign::kLeft : TextAlign::kRight;
35 } else if (fTextAlign == TextAlign::kEnd) {
36 return (fTextDirection == TextDirection::kLtr) ? TextAlign::kRight : TextAlign::kLeft;
37 } else {
38 return fTextAlign;
39 }
40}

◆ ellipsized()

bool skia::textlayout::ParagraphStyle::ellipsized ( ) const
inline

Definition at line 119 of file ParagraphStyle.h.

119{ return !fEllipsis.isEmpty() || !fEllipsisUtf16.empty(); }
bool isEmpty() const
Definition SkString.h:130

◆ getApplyRoundingHack()

bool skia::textlayout::ParagraphStyle::getApplyRoundingHack ( ) const
inline

Definition at line 127 of file ParagraphStyle.h.

127{ return fApplyRoundingHack; }

◆ getEllipsis()

SkString skia::textlayout::ParagraphStyle::getEllipsis ( ) const
inline

Definition at line 105 of file ParagraphStyle.h.

105{ return fEllipsis; }

◆ getEllipsisUtf16()

std::u16string skia::textlayout::ParagraphStyle::getEllipsisUtf16 ( ) const
inline

Definition at line 106 of file ParagraphStyle.h.

106{ return fEllipsisUtf16; }

◆ getHeight()

SkScalar skia::textlayout::ParagraphStyle::getHeight ( ) const
inline

Definition at line 110 of file ParagraphStyle.h.

110{ return fHeight; }

◆ getMaxLines()

size_t skia::textlayout::ParagraphStyle::getMaxLines ( ) const
inline

Definition at line 102 of file ParagraphStyle.h.

102{ return fLinesLimit; }

◆ getReplaceTabCharacters()

bool skia::textlayout::ParagraphStyle::getReplaceTabCharacters ( ) const
inline

Definition at line 124 of file ParagraphStyle.h.

124{ return fReplaceTabCharacters; }

◆ getStrutStyle()

const StrutStyle & skia::textlayout::ParagraphStyle::getStrutStyle ( ) const
inline

Definition at line 90 of file ParagraphStyle.h.

90{ return fStrutStyle; }

◆ getTextAlign()

TextAlign skia::textlayout::ParagraphStyle::getTextAlign ( ) const
inline

Definition at line 99 of file ParagraphStyle.h.

99{ return fTextAlign; }

◆ getTextDirection()

TextDirection skia::textlayout::ParagraphStyle::getTextDirection ( ) const
inline

Definition at line 96 of file ParagraphStyle.h.

96{ return fTextDirection; }

◆ getTextHeightBehavior()

TextHeightBehavior skia::textlayout::ParagraphStyle::getTextHeightBehavior ( ) const
inline

Definition at line 113 of file ParagraphStyle.h.

113{ return fTextHeightBehavior; }

◆ getTextStyle()

const TextStyle & skia::textlayout::ParagraphStyle::getTextStyle ( ) const
inline

Definition at line 93 of file ParagraphStyle.h.

93{ return fDefaultTextStyle; }

◆ hintingIsOn()

bool skia::textlayout::ParagraphStyle::hintingIsOn ( ) const
inline

Definition at line 121 of file ParagraphStyle.h.

121{ return fHintingIsOn; }

◆ operator==()

bool skia::textlayout::ParagraphStyle::operator== ( const ParagraphStyle rhs) const
inline

Definition at line 81 of file ParagraphStyle.h.

81 {
82 return this->fHeight == rhs.fHeight &&
83 this->fEllipsis == rhs.fEllipsis &&
84 this->fEllipsisUtf16 == rhs.fEllipsisUtf16 &&
85 this->fTextDirection == rhs.fTextDirection && this->fTextAlign == rhs.fTextAlign &&
86 this->fDefaultTextStyle == rhs.fDefaultTextStyle &&
87 this->fReplaceTabCharacters == rhs.fReplaceTabCharacters;
88 }

◆ setApplyRoundingHack()

void skia::textlayout::ParagraphStyle::setApplyRoundingHack ( bool  value)
inline

Definition at line 128 of file ParagraphStyle.h.

128{ fApplyRoundingHack = value; }
uint8_t value

◆ setEllipsis() [1/2]

void skia::textlayout::ParagraphStyle::setEllipsis ( const SkString ellipsis)
inline

Definition at line 108 of file ParagraphStyle.h.

108{ fEllipsis = ellipsis; }

◆ setEllipsis() [2/2]

void skia::textlayout::ParagraphStyle::setEllipsis ( const std::u16string &  ellipsis)
inline

Definition at line 107 of file ParagraphStyle.h.

107{ fEllipsisUtf16 = ellipsis; }

◆ setHeight()

void skia::textlayout::ParagraphStyle::setHeight ( SkScalar  height)
inline

Definition at line 111 of file ParagraphStyle.h.

111{ fHeight = height; }
int32_t height

◆ setMaxLines()

void skia::textlayout::ParagraphStyle::setMaxLines ( size_t  maxLines)
inline

Definition at line 103 of file ParagraphStyle.h.

103{ fLinesLimit = maxLines; }

◆ setReplaceTabCharacters()

void skia::textlayout::ParagraphStyle::setReplaceTabCharacters ( bool  value)
inline

Definition at line 125 of file ParagraphStyle.h.

125{ fReplaceTabCharacters = value; }

◆ setStrutStyle()

void skia::textlayout::ParagraphStyle::setStrutStyle ( StrutStyle  strutStyle)
inline

Definition at line 91 of file ParagraphStyle.h.

91{ fStrutStyle = std::move(strutStyle); }

◆ setTextAlign()

void skia::textlayout::ParagraphStyle::setTextAlign ( TextAlign  align)
inline

Definition at line 100 of file ParagraphStyle.h.

100{ fTextAlign = align; }

◆ setTextDirection()

void skia::textlayout::ParagraphStyle::setTextDirection ( TextDirection  direction)
inline

Definition at line 97 of file ParagraphStyle.h.

97{ fTextDirection = direction; }

◆ setTextHeightBehavior()

void skia::textlayout::ParagraphStyle::setTextHeightBehavior ( TextHeightBehavior  v)
inline

Definition at line 114 of file ParagraphStyle.h.

114{ fTextHeightBehavior = v; }

◆ setTextStyle()

void skia::textlayout::ParagraphStyle::setTextStyle ( const TextStyle textStyle)
inline

Definition at line 94 of file ParagraphStyle.h.

94{ fDefaultTextStyle = textStyle; }

◆ turnHintingOff()

void skia::textlayout::ParagraphStyle::turnHintingOff ( )
inline

Definition at line 122 of file ParagraphStyle.h.

122{ fHintingIsOn = false; }

◆ unlimited_lines()

bool skia::textlayout::ParagraphStyle::unlimited_lines ( ) const
inline

Definition at line 116 of file ParagraphStyle.h.

116 {
117 return fLinesLimit == std::numeric_limits<size_t>::max();
118 }

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