Flutter Engine
 
Loading...
Searching...
No Matches
paragraph.h
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#ifndef FLUTTER_IMPELLER_TOOLKIT_INTEROP_PARAGRAPH_H_
6#define FLUTTER_IMPELLER_TOOLKIT_INTEROP_PARAGRAPH_H_
7
13
14namespace impeller::interop {
15
16/**
17 * An immutable fully laid out paragraph.
18 */
19class Paragraph final
20 : public Object<Paragraph,
21 IMPELLER_INTERNAL_HANDLE_NAME(ImpellerParagraph)> {
22 public:
23 explicit Paragraph(std::unique_ptr<txt::Paragraph> paragraph);
24
25 ~Paragraph() override;
26
27 Paragraph(const Paragraph&) = delete;
28
29 Paragraph& operator=(const Paragraph&) = delete;
30
31 Scalar GetMaxWidth() const;
32
33 Scalar GetHeight() const;
34
36
38
40
42
44
45 uint32_t GetLineCount() const;
46
47 const std::unique_ptr<txt::Paragraph>& GetHandle() const;
48
50
52 size_t code_unit_index) const;
53
55 double x,
56 double y) const;
57
58 ImpellerRange GetWordBoundary(size_t code_unit_index) const;
59
60 private:
61 std::unique_ptr<txt::Paragraph> paragraph_;
62 mutable ScopedObject<LineMetrics> lazy_line_metrics_;
63};
64
65} // namespace impeller::interop
66
67#endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_PARAGRAPH_H_
Scalar GetLongestLineWidth() const
Definition paragraph.cc:22
ScopedObject< GlyphInfo > GetGlyphInfoAtCodeUnitIndex(size_t code_unit_index) const
Definition paragraph.cc:61
Scalar GetMinIntrinsicWidth() const
Definition paragraph.cc:26
ImpellerRange GetWordBoundary(size_t code_unit_index) const
Definition paragraph.cc:80
uint32_t GetLineCount() const
Definition paragraph.cc:42
Paragraph & operator=(const Paragraph &)=delete
Scalar GetIdeographicBaseline() const
Definition paragraph.cc:34
Paragraph(const Paragraph &)=delete
Scalar GetAlphabeticBaseline() const
Definition paragraph.cc:38
ScopedObject< GlyphInfo > GetClosestGlyphInfoAtParagraphCoordinates(double x, double y) const
Definition paragraph.cc:70
ScopedObject< LineMetrics > GetLineMetrics() const
Definition paragraph.cc:50
Scalar GetMaxIntrinsicWidth() const
Definition paragraph.cc:30
const std::unique_ptr< txt::Paragraph > & GetHandle() const
Definition paragraph.cc:46
int32_t x
double y
float Scalar
Definition scalar.h:19