LuciadCPillar 2023.1.04
luciad::TextStyle::Builder Class Referencefinal

A builder class for creating text styles. More...

#include <luciad/text/TextStyle.h>

Public Member Functions

 Builder (const Builder &other)
 
 ~Builder ()
 
TextStyle build () const
 Creates a newly created text style, based on the properties set on this builder. More...
 
BuilderfontName (std::string fontName)
 Sets the font name used for text rendering (possible values: Serif, Sans, Arial, Arial Black, Arial Narrow, Calibri, Console, Noto). More...
 
BuilderfontSize (size_t fontSize)
 Sets the font size in pixels , where a pixel is defined as 1/96th of 1 inch (https://www.w3.org/TR/css-values-4/#absolute-lengths). More...
 
BuilderhaloColor (Color haloColor)
 Sets the color of the halo (outline) around the text. More...
 
BuilderhaloWidth (double haloWidth)
 Sets the width of the halo (outline) around the text in pixels. More...
 
BuildertextColor (Color textColor)
 Sets the text color. More...
 

Detailed Description

A builder class for creating text styles.

Since
2020.2

Constructor & Destructor Documentation

◆ Builder()

luciad::TextStyle::Builder::Builder ( const Builder other)

◆ ~Builder()

luciad::TextStyle::Builder::~Builder ( )

Member Function Documentation

◆ build()

TextStyle luciad::TextStyle::Builder::build ( ) const

Creates a newly created text style, based on the properties set on this builder.

Returns
a newly created text style, based on the properties set on this builder.

◆ fontName()

Builder & luciad::TextStyle::Builder::fontName ( std::string  fontName)

Sets the font name used for text rendering (possible values: Serif, Sans, Arial, Arial Black, Arial Narrow, Calibri, Console, Noto).

If not specified, then the Serif font will be used to display text. The Noto font has support for the following alphabets: Arabic, Armenian, Bengali, Cyrillic, Devanagari, Georgian, Greek, Gujarati, Gurmukhi, Hangul, Han, Hebrew, Hiragana, Kanji, Kannada, Katakana, Lao, Latin, Malayalam, Oriya, Tamil, Telugu and Thai. Other fonts only support Latin alphabets.

Parameters
fontNameidentifier of the font used for text rendering.
Returns
this builder

◆ fontSize()

Builder & luciad::TextStyle::Builder::fontSize ( size_t  fontSize)

Sets the font size in pixels , where a pixel is defined as 1/96th of 1 inch (https://www.w3.org/TR/css-values-4/#absolute-lengths).

The font size value must be > 0. If not specified, a size of 14 is used.

Parameters
fontSizethe font size in pixels, where a pixel is defined as 1/96th of 1 inch.
Returns
this builder

◆ haloColor()

Builder & luciad::TextStyle::Builder::haloColor ( Color  haloColor)

Sets the color of the halo (outline) around the text.

The default value is white.

Parameters
haloColorthe color of the halo (outline) around the text.
Returns
this builder

◆ haloWidth()

Builder & luciad::TextStyle::Builder::haloWidth ( double  haloWidth)

Sets the width of the halo (outline) around the text in pixels.

This value must be greater then or equal to zero. If this value is equal to zero, no halo is drawn. Text halo width is 1 pixel wide by default.

Parameters
haloWidththe size of the halo (outline) around text in pixels.
Returns
this builder

◆ textColor()

Builder & luciad::TextStyle::Builder::textColor ( Color  textColor)

Sets the text color.

By default, this is black.

Parameters
textColorThe text color.
Returns
this builder.