Flutter Engine
The Flutter Engine
paragraph_style.cc
Go to the documentation of this file.
1/*
2 * Copyright 2017 Google, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "paragraph_style.h"
18
19#include <vector>
20
21namespace txt {
22
25 result.font_weight = font_weight;
26 result.font_style = font_style;
27 result.font_families = std::vector<std::string>({font_family});
28 if (font_size >= 0) {
29 result.font_size = font_size;
30 }
31 result.locale = locale;
32 result.height = height;
33 result.has_height_override = has_height_override;
34 return result;
35}
36
39};
40
42 return !ellipsis.empty();
43}
44
49 } else if (text_align == TextAlign::end) {
52 } else {
53 return text_align;
54 }
55}
56
57} // namespace txt
bool ellipsized() const
std::string font_family
std::u16string ellipsis
TextDirection text_direction
TextStyle GetTextStyle() const
TextAlign effective_align() const
bool unlimited_lines() const
GAsyncResult * result
static float max(float r, float g, float b)
Definition: hsl.cpp:49