Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
skia::textlayout::TextStyle Class Reference

#include <TextStyle.h>

Public Member Functions

 TextStyle ()=default
 
 TextStyle (const TextStyle &other)=default
 
TextStyleoperator= (const TextStyle &other)=default
 
TextStyle cloneForPlaceholder ()
 
bool equals (const TextStyle &other) const
 
bool equalsByFonts (const TextStyle &that) const
 
bool matchOneAttribute (StyleType styleType, const TextStyle &other) const
 
bool operator== (const TextStyle &rhs) const
 
SkColor getColor () const
 
void setColor (SkColor color)
 
bool hasForeground () const
 
SkPaint getForeground () const
 
ParagraphPainter::SkPaintOrID getForegroundPaintOrID () const
 
void setForegroundPaint (SkPaint paint)
 
void setForegroundColor (SkPaint paint)
 
void setForegroundPaintID (ParagraphPainter::PaintID paintID)
 
void clearForegroundColor ()
 
bool hasBackground () const
 
SkPaint getBackground () const
 
ParagraphPainter::SkPaintOrID getBackgroundPaintOrID () const
 
void setBackgroundPaint (SkPaint paint)
 
void setBackgroundColor (SkPaint paint)
 
void setBackgroundPaintID (ParagraphPainter::PaintID paintID)
 
void clearBackgroundColor ()
 
Decoration getDecoration () const
 
TextDecoration getDecorationType () const
 
TextDecorationMode getDecorationMode () const
 
SkColor getDecorationColor () const
 
TextDecorationStyle getDecorationStyle () const
 
SkScalar getDecorationThicknessMultiplier () const
 
void setDecoration (TextDecoration decoration)
 
void setDecorationMode (TextDecorationMode mode)
 
void setDecorationStyle (TextDecorationStyle style)
 
void setDecorationColor (SkColor color)
 
void setDecorationThicknessMultiplier (SkScalar m)
 
SkFontStyle getFontStyle () const
 
void setFontStyle (SkFontStyle fontStyle)
 
size_t getShadowNumber () const
 
std::vector< TextShadowgetShadows () const
 
void addShadow (TextShadow shadow)
 
void resetShadows ()
 
size_t getFontFeatureNumber () const
 
std::vector< FontFeaturegetFontFeatures () const
 
void addFontFeature (const SkString &fontFeature, int value)
 
void resetFontFeatures ()
 
const std::optional< FontArguments > & getFontArguments () const
 
void setFontArguments (const std::optional< SkFontArguments > &args)
 
SkScalar getFontSize () const
 
void setFontSize (SkScalar size)
 
const std::vector< SkString > & getFontFamilies () const
 
void setFontFamilies (std::vector< SkString > families)
 
SkScalar getBaselineShift () const
 
void setBaselineShift (SkScalar baselineShift)
 
void setHeight (SkScalar height)
 
SkScalar getHeight () const
 
void setHeightOverride (bool heightOverride)
 
bool getHeightOverride () const
 
void setHalfLeading (bool halfLeading)
 
bool getHalfLeading () const
 
void setLetterSpacing (SkScalar letterSpacing)
 
SkScalar getLetterSpacing () const
 
void setWordSpacing (SkScalar wordSpacing)
 
SkScalar getWordSpacing () const
 
SkTypefacegetTypeface () const
 
sk_sp< SkTypefacerefTypeface () const
 
void setTypeface (sk_sp< SkTypeface > typeface)
 
SkString getLocale () const
 
void setLocale (const SkString &locale)
 
TextBaseline getTextBaseline () const
 
void setTextBaseline (TextBaseline baseline)
 
void getFontMetrics (SkFontMetrics *metrics) const
 
bool isPlaceholder () const
 
void setPlaceholder ()
 

Detailed Description

Definition at line 151 of file TextStyle.h.

Constructor & Destructor Documentation

◆ TextStyle() [1/2]

skia::textlayout::TextStyle::TextStyle ( )
default

◆ TextStyle() [2/2]

skia::textlayout::TextStyle::TextStyle ( const TextStyle other)
default

Member Function Documentation

◆ addFontFeature()

void skia::textlayout::TextStyle::addFontFeature ( const SkString fontFeature,
int  value 
)
inline

Definition at line 239 of file TextStyle.h.

240 { fFontFeatures.emplace_back(fontFeature, value); }
uint8_t value

◆ addShadow()

void skia::textlayout::TextStyle::addShadow ( TextShadow  shadow)
inline

Definition at line 233 of file TextStyle.h.

233{ fTextShadows.emplace_back(shadow); }

◆ clearBackgroundColor()

void skia::textlayout::TextStyle::clearBackgroundColor ( )
inline

Definition at line 209 of file TextStyle.h.

209{ fHasBackground = false; }

◆ clearForegroundColor()

void skia::textlayout::TextStyle::clearForegroundColor ( )
inline

Definition at line 189 of file TextStyle.h.

189{ fHasForeground = false; }

◆ cloneForPlaceholder()

TextStyle skia::textlayout::TextStyle::cloneForPlaceholder ( )

◆ equals()

bool skia::textlayout::TextStyle::equals ( const TextStyle other) const

◆ equalsByFonts()

bool skia::textlayout::TextStyle::equalsByFonts ( const TextStyle that) const

◆ getBackground()

SkPaint skia::textlayout::TextStyle::getBackground ( ) const
inline

Definition at line 192 of file TextStyle.h.

192 {
193 const SkPaint* paint = std::get_if<SkPaint>(&fBackground);
194 return paint ? *paint : SkPaint();
195 }
const Paint & paint
Definition: color_source.cc:38

◆ getBackgroundPaintOrID()

ParagraphPainter::SkPaintOrID skia::textlayout::TextStyle::getBackgroundPaintOrID ( ) const
inline

Definition at line 196 of file TextStyle.h.

196 {
197 return fBackground;
198 }

◆ getBaselineShift()

SkScalar skia::textlayout::TextStyle::getBaselineShift ( ) const
inline

Definition at line 257 of file TextStyle.h.

257{ return fBaselineShift; }

◆ getColor()

SkColor skia::textlayout::TextStyle::getColor ( ) const
inline

Definition at line 165 of file TextStyle.h.

165{ return fColor; }

◆ getDecoration()

Decoration skia::textlayout::TextStyle::getDecoration ( ) const
inline

Definition at line 212 of file TextStyle.h.

212{ return fDecoration; }

◆ getDecorationColor()

SkColor skia::textlayout::TextStyle::getDecorationColor ( ) const
inline

Definition at line 215 of file TextStyle.h.

215{ return fDecoration.fColor; }

◆ getDecorationMode()

TextDecorationMode skia::textlayout::TextStyle::getDecorationMode ( ) const
inline

Definition at line 214 of file TextStyle.h.

214{ return fDecoration.fMode; }
TextDecorationMode fMode
Definition: TextStyle.h:72

◆ getDecorationStyle()

TextDecorationStyle skia::textlayout::TextStyle::getDecorationStyle ( ) const
inline

Definition at line 216 of file TextStyle.h.

216{ return fDecoration.fStyle; }
TextDecorationStyle fStyle
Definition: TextStyle.h:74

◆ getDecorationThicknessMultiplier()

SkScalar skia::textlayout::TextStyle::getDecorationThicknessMultiplier ( ) const
inline

Definition at line 217 of file TextStyle.h.

217 {
218 return fDecoration.fThicknessMultiplier;
219 }

◆ getDecorationType()

TextDecoration skia::textlayout::TextStyle::getDecorationType ( ) const
inline

Definition at line 213 of file TextStyle.h.

213{ return fDecoration.fType; }

◆ getFontArguments()

const std::optional< FontArguments > & skia::textlayout::TextStyle::getFontArguments ( ) const
inline

Definition at line 244 of file TextStyle.h.

244{ return fFontArguments; }

◆ getFontFamilies()

const std::vector< SkString > & skia::textlayout::TextStyle::getFontFamilies ( ) const
inline

Definition at line 252 of file TextStyle.h.

252{ return fFontFamilies; }

◆ getFontFeatureNumber()

size_t skia::textlayout::TextStyle::getFontFeatureNumber ( ) const
inline

Definition at line 237 of file TextStyle.h.

237{ return fFontFeatures.size(); }

◆ getFontFeatures()

std::vector< FontFeature > skia::textlayout::TextStyle::getFontFeatures ( ) const
inline

Definition at line 238 of file TextStyle.h.

238{ return fFontFeatures; }

◆ getFontMetrics()

void skia::textlayout::TextStyle::getFontMetrics ( SkFontMetrics metrics) const

◆ getFontSize()

SkScalar skia::textlayout::TextStyle::getFontSize ( ) const
inline

Definition at line 249 of file TextStyle.h.

249{ return fFontSize; }

◆ getFontStyle()

SkFontStyle skia::textlayout::TextStyle::getFontStyle ( ) const
inline

Definition at line 227 of file TextStyle.h.

227{ return fFontStyle; }

◆ getForeground()

SkPaint skia::textlayout::TextStyle::getForeground ( ) const
inline

Definition at line 169 of file TextStyle.h.

169 {
170 const SkPaint* paint = std::get_if<SkPaint>(&fForeground);
171 return paint ? *paint : SkPaint();
172 }

◆ getForegroundPaintOrID()

ParagraphPainter::SkPaintOrID skia::textlayout::TextStyle::getForegroundPaintOrID ( ) const
inline

Definition at line 173 of file TextStyle.h.

173 {
174 return fForeground;
175 }

◆ getHalfLeading()

bool skia::textlayout::TextStyle::getHalfLeading ( ) const
inline

Definition at line 267 of file TextStyle.h.

267{ return fHalfLeading; }

◆ getHeight()

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

Definition at line 261 of file TextStyle.h.

261{ return fHeightOverride ? fHeight : 0; }

◆ getHeightOverride()

bool skia::textlayout::TextStyle::getHeightOverride ( ) const
inline

Definition at line 264 of file TextStyle.h.

264{ return fHeightOverride; }

◆ getLetterSpacing()

SkScalar skia::textlayout::TextStyle::getLetterSpacing ( ) const
inline

Definition at line 270 of file TextStyle.h.

270{ return fLetterSpacing; }

◆ getLocale()

SkString skia::textlayout::TextStyle::getLocale ( ) const
inline

Definition at line 279 of file TextStyle.h.

279{ return fLocale; }

◆ getShadowNumber()

size_t skia::textlayout::TextStyle::getShadowNumber ( ) const
inline

Definition at line 231 of file TextStyle.h.

231{ return fTextShadows.size(); }

◆ getShadows()

std::vector< TextShadow > skia::textlayout::TextStyle::getShadows ( ) const
inline

Definition at line 232 of file TextStyle.h.

232{ return fTextShadows; }

◆ getTextBaseline()

TextBaseline skia::textlayout::TextStyle::getTextBaseline ( ) const
inline

Definition at line 282 of file TextStyle.h.

282{ return fTextBaseline; }

◆ getTypeface()

SkTypeface * skia::textlayout::TextStyle::getTypeface ( ) const
inline

Definition at line 275 of file TextStyle.h.

275{ return fTypeface.get(); }
T * get() const
Definition: SkRefCnt.h:303

◆ getWordSpacing()

SkScalar skia::textlayout::TextStyle::getWordSpacing ( ) const
inline

Definition at line 273 of file TextStyle.h.

273{ return fWordSpacing; }

◆ hasBackground()

bool skia::textlayout::TextStyle::hasBackground ( ) const
inline

Definition at line 191 of file TextStyle.h.

191{ return fHasBackground; }

◆ hasForeground()

bool skia::textlayout::TextStyle::hasForeground ( ) const
inline

Definition at line 168 of file TextStyle.h.

168{ return fHasForeground; }

◆ isPlaceholder()

bool skia::textlayout::TextStyle::isPlaceholder ( ) const
inline

Definition at line 287 of file TextStyle.h.

287{ return fIsPlaceholder; }

◆ matchOneAttribute()

bool skia::textlayout::TextStyle::matchOneAttribute ( StyleType  styleType,
const TextStyle other 
) const

◆ operator=()

TextStyle & skia::textlayout::TextStyle::operator= ( const TextStyle other)
default

◆ operator==()

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

Definition at line 162 of file TextStyle.h.

162{ return this->equals(rhs); }
bool equals(const TextStyle &other) const

◆ refTypeface()

sk_sp< SkTypeface > skia::textlayout::TextStyle::refTypeface ( ) const
inline

Definition at line 276 of file TextStyle.h.

276{ return fTypeface; }

◆ resetFontFeatures()

void skia::textlayout::TextStyle::resetFontFeatures ( )
inline

Definition at line 241 of file TextStyle.h.

241{ fFontFeatures.clear(); }

◆ resetShadows()

void skia::textlayout::TextStyle::resetShadows ( )
inline

Definition at line 234 of file TextStyle.h.

234{ fTextShadows.clear(); }

◆ setBackgroundColor()

void skia::textlayout::TextStyle::setBackgroundColor ( SkPaint  paint)
inline

Definition at line 204 of file TextStyle.h.

204{ setBackgroundPaint(std::move(paint)); }
void setBackgroundPaint(SkPaint paint)
Definition: TextStyle.h:199

◆ setBackgroundPaint()

void skia::textlayout::TextStyle::setBackgroundPaint ( SkPaint  paint)
inline

Definition at line 199 of file TextStyle.h.

199 {
200 fHasBackground = true;
201 fBackground = std::move(paint);
202 }

◆ setBackgroundPaintID()

void skia::textlayout::TextStyle::setBackgroundPaintID ( ParagraphPainter::PaintID  paintID)
inline

Definition at line 205 of file TextStyle.h.

205 {
206 fHasBackground = true;
207 fBackground = paintID;
208 }

◆ setBaselineShift()

void skia::textlayout::TextStyle::setBaselineShift ( SkScalar  baselineShift)
inline

Definition at line 258 of file TextStyle.h.

258{ fBaselineShift = baselineShift; }

◆ setColor()

void skia::textlayout::TextStyle::setColor ( SkColor  color)
inline

Definition at line 166 of file TextStyle.h.

166{ fColor = color; }
DlColor color

◆ setDecoration()

void skia::textlayout::TextStyle::setDecoration ( TextDecoration  decoration)
inline

Definition at line 220 of file TextStyle.h.

220{ fDecoration.fType = decoration; }

◆ setDecorationColor()

void skia::textlayout::TextStyle::setDecorationColor ( SkColor  color)
inline

Definition at line 223 of file TextStyle.h.

223{ fDecoration.fColor = color; }

◆ setDecorationMode()

void skia::textlayout::TextStyle::setDecorationMode ( TextDecorationMode  mode)
inline

Definition at line 221 of file TextStyle.h.

221{ fDecoration.fMode = mode; }
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition: switches.h:228

◆ setDecorationStyle()

void skia::textlayout::TextStyle::setDecorationStyle ( TextDecorationStyle  style)
inline

Definition at line 222 of file TextStyle.h.

222{ fDecoration.fStyle = style; }

◆ setDecorationThicknessMultiplier()

void skia::textlayout::TextStyle::setDecorationThicknessMultiplier ( SkScalar  m)
inline

Definition at line 224 of file TextStyle.h.

◆ setFontArguments()

void skia::textlayout::TextStyle::setFontArguments ( const std::optional< SkFontArguments > &  args)

◆ setFontFamilies()

void skia::textlayout::TextStyle::setFontFamilies ( std::vector< SkString families)
inline

Definition at line 253 of file TextStyle.h.

253 {
254 fFontFamilies = std::move(families);
255 }

◆ setFontSize()

void skia::textlayout::TextStyle::setFontSize ( SkScalar  size)
inline

Definition at line 250 of file TextStyle.h.

250{ fFontSize = size; }
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

◆ setFontStyle()

void skia::textlayout::TextStyle::setFontStyle ( SkFontStyle  fontStyle)
inline

Definition at line 228 of file TextStyle.h.

228{ fFontStyle = fontStyle; }

◆ setForegroundColor()

void skia::textlayout::TextStyle::setForegroundColor ( SkPaint  paint)
inline

Definition at line 181 of file TextStyle.h.

181{ setForegroundPaint(std::move(paint)); }
void setForegroundPaint(SkPaint paint)
Definition: TextStyle.h:176

◆ setForegroundPaint()

void skia::textlayout::TextStyle::setForegroundPaint ( SkPaint  paint)
inline

Definition at line 176 of file TextStyle.h.

176 {
177 fHasForeground = true;
178 fForeground = std::move(paint);
179 }

◆ setForegroundPaintID()

void skia::textlayout::TextStyle::setForegroundPaintID ( ParagraphPainter::PaintID  paintID)
inline

Definition at line 185 of file TextStyle.h.

185 {
186 fHasForeground = true;
187 fForeground = paintID;
188 }

◆ setHalfLeading()

void skia::textlayout::TextStyle::setHalfLeading ( bool  halfLeading)
inline

Definition at line 266 of file TextStyle.h.

266{ fHalfLeading = halfLeading; }

◆ setHeight()

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

Definition at line 260 of file TextStyle.h.

260{ fHeight = height; }
int32_t height

◆ setHeightOverride()

void skia::textlayout::TextStyle::setHeightOverride ( bool  heightOverride)
inline

Definition at line 263 of file TextStyle.h.

263{ fHeightOverride = heightOverride; }

◆ setLetterSpacing()

void skia::textlayout::TextStyle::setLetterSpacing ( SkScalar  letterSpacing)
inline

Definition at line 269 of file TextStyle.h.

269{ fLetterSpacing = letterSpacing; }

◆ setLocale()

void skia::textlayout::TextStyle::setLocale ( const SkString locale)
inline

Definition at line 280 of file TextStyle.h.

280{ fLocale = locale; }

◆ setPlaceholder()

void skia::textlayout::TextStyle::setPlaceholder ( )
inline

Definition at line 288 of file TextStyle.h.

288{ fIsPlaceholder = true; }

◆ setTextBaseline()

void skia::textlayout::TextStyle::setTextBaseline ( TextBaseline  baseline)
inline

Definition at line 283 of file TextStyle.h.

283{ fTextBaseline = baseline; }

◆ setTypeface()

void skia::textlayout::TextStyle::setTypeface ( sk_sp< SkTypeface typeface)
inline

Definition at line 277 of file TextStyle.h.

277{ fTypeface = std::move(typeface); }

◆ setWordSpacing()

void skia::textlayout::TextStyle::setWordSpacing ( SkScalar  wordSpacing)
inline

Definition at line 272 of file TextStyle.h.

272{ fWordSpacing = wordSpacing; }

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