Flutter Engine
txt::Paragraph Class Referenceabstract

#include <paragraph.h>

Inheritance diagram for txt::Paragraph:
txt::ParagraphSkia txt::ParagraphTxt

Classes

struct  PositionWithAffinity
 
struct  Range
 
struct  TextBox
 

Public Types

enum  Affinity {
  UPSTREAM,
  DOWNSTREAM
}
 
enum  RectHeightStyle {
  RectHeightStyle::kTight,
  RectHeightStyle::kMax,
  RectHeightStyle::kIncludeLineSpacingMiddle,
  RectHeightStyle::kIncludeLineSpacingTop,
  RectHeightStyle::kIncludeLineSpacingBottom,
  RectHeightStyle::kStrut
}
 
enum  RectWidthStyle {
  RectWidthStyle::kTight,
  RectWidthStyle::kMax
}
 

Public Member Functions

virtual ~Paragraph ()=default
 
virtual double GetMaxWidth ()=0
 
virtual double GetHeight ()=0
 
virtual double GetLongestLine ()=0
 
virtual double GetMinIntrinsicWidth ()=0
 
virtual double GetMaxIntrinsicWidth ()=0
 
virtual double GetAlphabeticBaseline ()=0
 
virtual double GetIdeographicBaseline ()=0
 
virtual bool DidExceedMaxLines ()=0
 
virtual void Layout (double width)=0
 
virtual void Paint (SkCanvas *canvas, double x, double y)=0
 
virtual std::vector< TextBoxGetRectsForRange (size_t start, size_t end, RectHeightStyle rect_height_style, RectWidthStyle rect_width_style)=0
 
virtual std::vector< TextBoxGetRectsForPlaceholders ()=0
 
virtual PositionWithAffinity GetGlyphPositionAtCoordinate (double dx, double dy)=0
 
virtual Range< size_t > GetWordBoundary (size_t offset)=0
 
virtual std::vector< LineMetrics > & GetLineMetrics ()=0
 

Detailed Description

Definition at line 31 of file paragraph.h.

Member Enumeration Documentation

◆ Affinity

Enumerator
UPSTREAM 
DOWNSTREAM 

Definition at line 33 of file paragraph.h.

◆ RectHeightStyle

Enumerator
kTight 
kMax 
kIncludeLineSpacingMiddle 
kIncludeLineSpacingTop 
kIncludeLineSpacingBottom 
kStrut 

Definition at line 37 of file paragraph.h.

37  {
38  // Provide tight bounding boxes that fit heights per run.
39  kTight,
40 
41  // The height of the boxes will be the maximum height of all runs in the
42  // line. All rects in the same line will be the same height.
43  kMax,
44 
45  // Extends the top and/or bottom edge of the bounds to fully cover any line
46  // spacing. The top edge of each line should be the same as the bottom edge
47  // of the line above. There should be no gaps in vertical coverage given any
48  // ParagraphStyle line_height.
49  //
50  // The top and bottom of each rect will cover half of the
51  // space above and half of the space below the line.
52  kIncludeLineSpacingMiddle,
53  // The line spacing will be added to the top of the rect.
54  kIncludeLineSpacingTop,
55  // The line spacing will be added to the bottom of the rect.
56  kIncludeLineSpacingBottom,
57 
58  // Calculate boxes based on the strut's metrics.
59  kStrut
60  };

◆ RectWidthStyle

Enumerator
kTight 
kMax 

Definition at line 62 of file paragraph.h.

62  {
63  // Provide tight bounding boxes that fit widths to the runs of each line
64  // independently.
65  kTight,
66 
67  // Extends the width of the last rect of each line to match the position of
68  // the widest rect over all the lines.
69  kMax
70  };

Constructor & Destructor Documentation

◆ ~Paragraph()

virtual txt::Paragraph::~Paragraph ( )
virtualdefault

Member Function Documentation

◆ DidExceedMaxLines()

virtual bool txt::Paragraph::DidExceedMaxLines ( )
pure virtual

◆ GetAlphabeticBaseline()

virtual double txt::Paragraph::GetAlphabeticBaseline ( )
pure virtual

◆ GetGlyphPositionAtCoordinate()

virtual PositionWithAffinity txt::Paragraph::GetGlyphPositionAtCoordinate ( double  dx,
double  dy 
)
pure virtual

◆ GetHeight()

virtual double txt::Paragraph::GetHeight ( )
pure virtual

◆ GetIdeographicBaseline()

virtual double txt::Paragraph::GetIdeographicBaseline ( )
pure virtual

◆ GetLineMetrics()

virtual std::vector<LineMetrics>& txt::Paragraph::GetLineMetrics ( )
pure virtual

◆ GetLongestLine()

virtual double txt::Paragraph::GetLongestLine ( )
pure virtual

◆ GetMaxIntrinsicWidth()

virtual double txt::Paragraph::GetMaxIntrinsicWidth ( )
pure virtual

◆ GetMaxWidth()

virtual double txt::Paragraph::GetMaxWidth ( )
pure virtual

◆ GetMinIntrinsicWidth()

virtual double txt::Paragraph::GetMinIntrinsicWidth ( )
pure virtual

◆ GetRectsForPlaceholders()

virtual std::vector<TextBox> txt::Paragraph::GetRectsForPlaceholders ( )
pure virtual

◆ GetRectsForRange()

virtual std::vector<TextBox> txt::Paragraph::GetRectsForRange ( size_t  start,
size_t  end,
RectHeightStyle  rect_height_style,
RectWidthStyle  rect_width_style 
)
pure virtual

◆ GetWordBoundary()

virtual Range<size_t> txt::Paragraph::GetWordBoundary ( size_t  offset)
pure virtual

◆ Layout()

virtual void txt::Paragraph::Layout ( double  width)
pure virtual

◆ Paint()

virtual void txt::Paragraph::Paint ( SkCanvas *  canvas,
double  x,
double  y 
)
pure virtual

The documentation for this class was generated from the following file: