Flutter Engine
The Flutter Engine
ParagraphStyle.cpp
Go to the documentation of this file.
1// Copyright 2019 Google LLC.
2
5#include "src/base/SkUTF.h"
7
8namespace skia {
9namespace textlayout {
10
12 fFontStyle = SkFontStyle::Normal();
13 fFontSize = 14;
14 fHeight = 1;
15 fLeading = -1;
16 fForceHeight = false;
17 fHeightOverride = false;
18 fHalfLeading = false;
19 fEnabled = false;
20}
21
23 fTextAlign = TextAlign::kStart;
24 fTextDirection = TextDirection::kLtr;
26 fHeight = 1;
27 fTextHeightBehavior = TextHeightBehavior::kAll;
28 fHintingIsOn = true;
29 fReplaceTabCharacters = false;
30}
31
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}
41} // namespace textlayout
42} // namespace skia
static constexpr SkFontStyle Normal()
Definition: SkFontStyle.h:66
static float max(float r, float g, float b)
Definition: hsl.cpp:49
Definition: DartTypes.h:13