LuciadCPillar 2023.1.04
luciad::TextPatternBuilder Class Reference

Creates a pattern containing text. More...

#include <luciad/layers/styles/complexstrokes/builders/TextPatternBuilder.h>

Public Member Functions

ComplexStrokePattern build ()
 Build the text pattern as configured. More...
 
TextPatternBuilderoffset (double offset)
 Sets the offset of the text, relative to the base line, in pixels. More...
 
TextPatternBuilderrotateUp (bool rotateUp)
 Indicates if the text should be flipped when it is turned upside down. More...
 
TextPatternBuildertext (std::string text)
 Sets the text as a single line. More...
 
TextPatternBuildertext (std::vector< std::string > text)
 Sets multiple lines of text, with each element being a separate line. More...
 
TextPatternBuildertextStyle (TextStyle textStyle)
 Sets the style of the text. More...
 

Detailed Description

Creates a pattern containing text.

See also
ComplexStrokePatternFactory::textBuilder()
Since
2023.1

Member Function Documentation

◆ build()

ComplexStrokePattern luciad::TextPatternBuilder::build ( )

Build the text pattern as configured.

Returns
the ComplexStrokePattern.
Exceptions
luciad::LogicExceptionwhen the text has not been set.

◆ offset()

TextPatternBuilder & luciad::TextPatternBuilder::offset ( double  offset)

Sets the offset of the text, relative to the base line, in pixels.

Defaults to 0.

Parameters
offsetthe offset of the text.
Returns
this builder.

◆ rotateUp()

TextPatternBuilder & luciad::TextPatternBuilder::rotateUp ( bool  rotateUp)

Indicates if the text should be flipped when it is turned upside down.

Defaults to true.

Parameters
rotateUpif the text should be flipped when it is turned upside down.
Returns
this builder.

◆ text() [1/2]

TextPatternBuilder & luciad::TextPatternBuilder::text ( std::string  text)

Sets the text as a single line.

Parameters
textthe text to be displayed.
Returns
this builder.

◆ text() [2/2]

TextPatternBuilder & luciad::TextPatternBuilder::text ( std::vector< std::string >  text)

Sets multiple lines of text, with each element being a separate line.

Parameters
textthe text to be displayed. May not be empty.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptiontext may not be empty.

◆ textStyle()

TextPatternBuilder & luciad::TextPatternBuilder::textStyle ( TextStyle  textStyle)

Sets the style of the text.

Parameters
textStylethe style of the text.
Returns
this builder.