Flutter Engine
minikin::LineBreaker Class Reference

#include <LineBreaker.h>

Public Member Functions

void setLocale (const icu::Locale &locale, Hyphenator *hyphenator)
 
void resize (size_t size)
 
size_t size () const
 
uint16_t * buffer ()
 
float * charWidths ()
 
void setText ()
 
void setLineWidths (float firstWidth, int firstWidthLineCount, float restWidth)
 
void setIndents (const std::vector< float > &indents)
 
BreakStrategy getStrategy () const
 
void setStrategy (BreakStrategy strategy)
 
void setJustified (bool justified)
 
HyphenationFrequency getHyphenationFrequency () const
 
void setHyphenationFrequency (HyphenationFrequency frequency)
 
float addStyleRun (MinikinPaint *paint, const std::shared_ptr< FontCollection > &typeface, FontStyle style, size_t start, size_t end, bool isRtl)
 
void addReplacement (size_t start, size_t end, float width)
 
size_t computeBreaks ()
 
void setCustomCharWidth (size_t offset, float width)
 
const int * getBreaks () const
 
const float * getWidths () const
 
const int * getFlags () const
 
void finish ()
 

Static Public Attributes

static const int kTab_Shift
 

Detailed Description

Definition at line 88 of file LineBreaker.h.

Member Function Documentation

◆ addReplacement()

void minikin::LineBreaker::addReplacement ( size_t  start,
size_t  end,
float  width 
)

◆ addStyleRun()

float minikin::LineBreaker::addStyleRun ( MinikinPaint paint,
const std::shared_ptr< FontCollection > &  typeface,
FontStyle  style,
size_t  start,
size_t  end,
bool  isRtl 
)

◆ buffer()

uint16_t* minikin::LineBreaker::buffer ( )
inline

Definition at line 109 of file LineBreaker.h.

Referenced by txt::BENCHMARK_DEFINE_F(), and txt::ParagraphTxt::ParagraphTxt().

109 { return mTextBuf.data(); }

◆ charWidths()

float* minikin::LineBreaker::charWidths ( )
inline

Definition at line 111 of file LineBreaker.h.

References minikin::LineWidths::setIndents().

111 { return mCharWidths.data(); }

◆ computeBreaks()

size_t minikin::LineBreaker::computeBreaks ( )

◆ finish()

void minikin::LineBreaker::finish ( )

◆ getBreaks()

const int* minikin::LineBreaker::getBreaks ( ) const
inline

Definition at line 159 of file LineBreaker.h.

Referenced by txt::ParagraphTxt::ParagraphTxt().

159 { return mBreaks.data(); }

◆ getFlags()

const int* minikin::LineBreaker::getFlags ( ) const
inline

Definition at line 163 of file LineBreaker.h.

References minikin::kBreakStrategy_Greedy, and minikin::kHyphenationFrequency_Normal.

163 { return mFlags.data(); }

◆ getHyphenationFrequency()

HyphenationFrequency minikin::LineBreaker::getHyphenationFrequency ( ) const
inline

Definition at line 128 of file LineBreaker.h.

128  {
129  return mHyphenationFrequency;
130  }

◆ getStrategy()

BreakStrategy minikin::LineBreaker::getStrategy ( ) const
inline

Definition at line 122 of file LineBreaker.h.

122 { return mStrategy; }

◆ getWidths()

const float* minikin::LineBreaker::getWidths ( ) const
inline

Definition at line 161 of file LineBreaker.h.

Referenced by txt::ParagraphTxt::ParagraphTxt().

161 { return mWidths.data(); }

◆ resize()

void minikin::LineBreaker::resize ( size_t  size)
inline

Definition at line 102 of file LineBreaker.h.

Referenced by txt::BENCHMARK_DEFINE_F(), and txt::ParagraphTxt::ParagraphTxt().

102  {
103  mTextBuf.resize(size);
104  mCharWidths.resize(size);
105  }
size_t size() const
Definition: LineBreaker.h:107

◆ setCustomCharWidth()

void minikin::LineBreaker::setCustomCharWidth ( size_t  offset,
float  width 
)

◆ setHyphenationFrequency()

void minikin::LineBreaker::setHyphenationFrequency ( HyphenationFrequency  frequency)
inline

Definition at line 132 of file LineBreaker.h.

References width.

132  {
133  mHyphenationFrequency = frequency;
134  }

◆ setIndents()

void minikin::LineBreaker::setIndents ( const std::vector< float > &  indents)

◆ setJustified()

void minikin::LineBreaker::setJustified ( bool  justified)
inline

Definition at line 126 of file LineBreaker.h.

Referenced by txt::ParagraphTxt::ParagraphTxt().

126 { mJustified = justified; }

◆ setLineWidths()

void minikin::LineBreaker::setLineWidths ( float  firstWidth,
int  firstWidthLineCount,
float  restWidth 
)

◆ setLocale()

void minikin::LineBreaker::setLocale ( const icu::Locale &  locale,
Hyphenator hyphenator 
)

◆ setStrategy()

void minikin::LineBreaker::setStrategy ( BreakStrategy  strategy)
inline

Definition at line 124 of file LineBreaker.h.

Referenced by txt::ParagraphTxt::ParagraphTxt().

124 { mStrategy = strategy; }

◆ setText()

void minikin::LineBreaker::setText ( )

◆ size()

size_t minikin::LineBreaker::size ( ) const
inline

Definition at line 107 of file LineBreaker.h.

107 { return mTextBuf.size(); }

Member Data Documentation

◆ kTab_Shift

const int minikin::LineBreaker::kTab_Shift
static
Initial value:
=
29

Definition at line 90 of file LineBreaker.h.


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