Flutter Engine
 
Loading...
Searching...
No Matches
txt::Paragraph Class Referenceabstract

#include <paragraph.h>

Classes

struct  PositionWithAffinity
 
struct  Range
 
struct  TextBox
 

Public Types

enum  Affinity {
  UPSTREAM ,
  DOWNSTREAM
}
 
enum class  RectHeightStyle {
  kTight ,
  kMax ,
  kIncludeLineSpacingMiddle ,
  kIncludeLineSpacingTop ,
  kIncludeLineSpacingBottom ,
  kStrut
}
 
enum class  RectWidthStyle {
  kTight ,
  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 bool Paint (flutter::DisplayListBuilder *builder, 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 bool GetGlyphInfoAt (unsigned offset, skia::textlayout::Paragraph::GlyphInfo *glyphInfo) const =0
 
virtual bool GetClosestGlyphInfoAtCoordinate (double dx, double dy, skia::textlayout::Paragraph::GlyphInfo *glyphInfo) const =0
 
virtual Range< size_t > GetWordBoundary (size_t offset)=0
 
virtual std::vector< LineMetrics > & GetLineMetrics ()=0
 
virtual bool GetLineMetricsAt (int lineNumber, skia::textlayout::LineMetrics *lineMetrics) const =0
 
virtual size_t GetNumberOfLines () const =0
 
virtual int GetLineNumberAt (size_t utf16Offset) const =0
 

Detailed Description

Definition at line 22 of file paragraph.h.

Member Enumeration Documentation

◆ Affinity

Enumerator
UPSTREAM 
DOWNSTREAM 

Definition at line 25 of file paragraph.h.

◆ RectHeightStyle

Enumerator
kTight 
kMax 
kIncludeLineSpacingMiddle 
kIncludeLineSpacingTop 
kIncludeLineSpacingBottom 
kStrut 

Definition at line 29 of file paragraph.h.

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

◆ RectWidthStyle

enum class txt::Paragraph::RectWidthStyle
strong
Enumerator
kTight 
kMax 

Definition at line 54 of file paragraph.h.

54 {
55 // Provide tight bounding boxes that fit widths to the runs of each line
56 // independently.
57 kTight,
58
59 // Extends the width of the last rect of each line to match the position of
60 // the widest rect over all the lines.
61 kMax
62 };

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

◆ GetClosestGlyphInfoAtCoordinate()

virtual bool txt::Paragraph::GetClosestGlyphInfoAtCoordinate ( double  dx,
double  dy,
skia::textlayout::Paragraph::GlyphInfo *  glyphInfo 
) const
pure virtual

◆ GetGlyphInfoAt()

virtual bool txt::Paragraph::GetGlyphInfoAt ( unsigned  offset,
skia::textlayout::Paragraph::GlyphInfo *  glyphInfo 
) const
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

◆ GetLineMetricsAt()

virtual bool txt::Paragraph::GetLineMetricsAt ( int  lineNumber,
skia::textlayout::LineMetrics *  lineMetrics 
) const
pure virtual

◆ GetLineNumberAt()

virtual int txt::Paragraph::GetLineNumberAt ( size_t  utf16Offset) const
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

◆ GetNumberOfLines()

virtual size_t txt::Paragraph::GetNumberOfLines ( ) const
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 bool txt::Paragraph::Paint ( flutter::DisplayListBuilder builder,
double  x,
double  y 
)
pure virtual

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