Flutter Engine
Loading...
Searching...
No Matches
paragraph_style.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "
paragraph_style.h
"
6
7
#include <vector>
8
9
namespace
txt
{
10
11
TextStyle
ParagraphStyle::GetTextStyle
()
const
{
12
TextStyle
result;
13
result.
font_weight
=
font_weight
;
14
result.
font_style
=
font_style
;
15
result.
font_families
= std::vector<std::string>({
font_family
});
16
if
(
font_size
>= 0) {
17
result.
font_size
=
font_size
;
18
}
19
result.
locale
=
locale
;
20
result.
height
=
height
;
21
result.
has_height_override
=
has_height_override
;
22
return
result;
23
}
24
25
bool
ParagraphStyle::unlimited_lines
()
const
{
26
return
max_lines
== std::numeric_limits<size_t>::max();
27
};
28
29
bool
ParagraphStyle::ellipsized
()
const
{
30
return
!
ellipsis
.empty();
31
}
32
33
TextAlign
ParagraphStyle::effective_align
()
const
{
34
if
(
text_align
==
TextAlign::start
) {
35
return
(
text_direction
==
TextDirection::ltr
) ?
TextAlign::left
36
:
TextAlign::right
;
37
}
else
if
(
text_align
==
TextAlign::end
) {
38
return
(
text_direction
==
TextDirection::ltr
) ?
TextAlign::right
39
:
TextAlign::left
;
40
}
else
{
41
return
text_align
;
42
}
43
}
44
45
}
// namespace txt
txt::ParagraphStyle::font_size
double font_size
Definition
paragraph_style.h:63
txt::ParagraphStyle::ellipsized
bool ellipsized() const
Definition
paragraph_style.cc:29
txt::ParagraphStyle::locale
std::string locale
Definition
paragraph_style.h:88
txt::ParagraphStyle::font_family
std::string font_family
Definition
paragraph_style.h:62
txt::ParagraphStyle::ellipsis
std::u16string ellipsis
Definition
paragraph_style.h:87
txt::ParagraphStyle::height
double height
Definition
paragraph_style.h:64
txt::ParagraphStyle::max_lines
size_t max_lines
Definition
paragraph_style.h:86
txt::ParagraphStyle::font_weight
int font_weight
Definition
paragraph_style.h:60
txt::ParagraphStyle::text_direction
TextDirection text_direction
Definition
paragraph_style.h:85
txt::ParagraphStyle::has_height_override
bool has_height_override
Definition
paragraph_style.h:65
txt::ParagraphStyle::GetTextStyle
TextStyle GetTextStyle() const
Definition
paragraph_style.cc:11
txt::ParagraphStyle::effective_align
TextAlign effective_align() const
Definition
paragraph_style.cc:33
txt::ParagraphStyle::unlimited_lines
bool unlimited_lines() const
Definition
paragraph_style.cc:25
txt::ParagraphStyle::font_style
FontStyle font_style
Definition
paragraph_style.h:61
txt::ParagraphStyle::text_align
TextAlign text_align
Definition
paragraph_style.h:84
txt::TextStyle
Definition
text_style.h:24
txt::TextStyle::font_families
std::vector< std::string > font_families
Definition
text_style.h:40
txt::TextStyle::height
double height
Definition
text_style.h:44
txt::TextStyle::font_style
FontStyle font_style
Definition
text_style.h:35
txt::TextStyle::font_weight
int font_weight
Definition
text_style.h:34
txt::TextStyle::has_height_override
bool has_height_override
Definition
text_style.h:45
txt::TextStyle::font_size
double font_size
Definition
text_style.h:41
txt::TextStyle::locale
std::string locale
Definition
text_style.h:46
txt
Definition
paragraph_builder_skia.cc:15
txt::TextAlign
TextAlign
Definition
paragraph_style.h:17
txt::TextAlign::right
@ right
txt::TextAlign::end
@ end
txt::TextAlign::left
@ left
txt::TextAlign::start
@ start
txt::TextDirection::ltr
@ ltr
paragraph_style.h
txt
src
txt
paragraph_style.cc
Generated on Thu Nov 6 2025 16:11:30 for Flutter Engine by
1.9.8