Flutter Engine
The Flutter Engine
third_party
skia
modules
skparagraph
src
ParagraphStyle.cpp
Go to the documentation of this file.
1
// Copyright 2019 Google LLC.
2
3
#include "
modules/skparagraph/include/DartTypes.h
"
4
#include "
modules/skparagraph/include/ParagraphStyle.h
"
5
#include "
src/base/SkUTF.h
"
6
#include "
src/core/SkStringUtils.h
"
7
8
namespace
skia
{
9
namespace
textlayout {
10
11
StrutStyle::StrutStyle
() {
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
22
ParagraphStyle::ParagraphStyle
() {
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
}
31
32
TextAlign
ParagraphStyle::effective_align
()
const
{
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
DartTypes.h
ParagraphStyle.h
SkStringUtils.h
SkUTF.h
SkFontStyle::Normal
static constexpr SkFontStyle Normal()
Definition:
SkFontStyle.h:66
max
static float max(float r, float g, float b)
Definition:
hsl.cpp:49
skia::textlayout::TextAlign
TextAlign
Definition:
DartTypes.h:52
skia::textlayout::TextAlign::kStart
@ kStart
skia::textlayout::TextAlign::kLeft
@ kLeft
skia::textlayout::TextAlign::kRight
@ kRight
skia::textlayout::TextAlign::kEnd
@ kEnd
skia::textlayout::TextDirection::kLtr
@ kLtr
skia
Definition:
DartTypes.h:13
skia::textlayout::ParagraphStyle::ParagraphStyle
ParagraphStyle()
Definition:
ParagraphStyle.cpp:22
skia::textlayout::ParagraphStyle::effective_align
TextAlign effective_align() const
Definition:
ParagraphStyle.cpp:32
skia::textlayout::StrutStyle::StrutStyle
StrutStyle()
Definition:
ParagraphStyle.cpp:11
Generated on Sun Jun 23 2024 21:56:06 for Flutter Engine by
1.9.4