DATAKIT API  V2025.1
Dtk_TextStyle Class Reference

This is the text_style. This class gathers several informations about text style. More...

Public Types

enum  FontStyleEnum { StyleRegular = 0, StyleBold, StyleItalic, StyleBoldItalic }
 
enum  TextAttributeEnum {
  AttributeNone = 0, AttributeUnderline = 1, AttributeStrikethrough = 2, AttributeOverline = 4,
  AttributeSuperscript = 8, AttributeSubscript = 16
}
 
enum  TextJustificationEnum { JustificationLeft = 0, JustificationCenter, JustificationRight, JustificationNone }
 

Public Member Functions

TextAttributeEnumAttributes ()
 Retrieves the text attribute - get/set -. More...
 
const TextAttributeEnumAttributes () const
 Retrieves the text attribute - read only -. More...
 
Dtk_Double64CharHeight ()
 Retrieves the char height - get/set -. More...
 
const Dtk_Double64CharHeight () const
 Retrieves the char height - Read Only -. More...
 
Dtk_Double64CharSpacing ()
 Retrieves the char spacing - get/set -. More...
 
const Dtk_Double64CharSpacing () const
 Retrieves the char spacing - read only -. More...
 
Dtk_Double64CharWidth ()
 Retrieves the char width - get/set -. More...
 
const Dtk_Double64CharWidth () const
 Retrieves the char width - read only -. More...
 
 Dtk_TextStyle ()
 Base constructor. More...
 
 Dtk_TextStyle (const Dtk_TextStyle &s)
 Copy constructor. More...
 
 Dtk_TextStyle (Dtk_TextStyle &&s) DTK_NOEXCEPT
 \MoveConstructor{s} More...
 
Dtk_FontFont ()
 Retrieves the font - get/set -. More...
 
const Dtk_FontFont () const
 Retrieves the font - read only -. More...
 
FontStyleEnumFontStyle ()
 Retrieves the font style - get/set -. More...
 
const FontStyleEnumFontStyle () const
 Retrieves the font style - read only -. More...
 
TextJustificationEnumJustification ()
 Retrieves the text justification - get/set -. More...
 
const TextJustificationEnumJustification () const
 Retrieves the text justification - read only -. More...
 
Dtk_Double64LineSpacing ()
 Retrieves the line spacing - get/set -. More...
 
const Dtk_Double64LineSpacing () const
 Retrieves the line spacing - read only -. More...
 
Dtk_TextStyleoperator= (const Dtk_TextStyle &s)
 Assignment Operator. More...
 
Dtk_TextStyleoperator= (Dtk_TextStyle &&s) DTK_NOEXCEPT
 \MoveOp{s} More...
 
Dtk_Double64Pitch ()
 Retrieves the text pitch - get/set -. More...
 
const Dtk_Double64Pitch () const
 Retrieves the text pitch - read only -. More...
 
Dtk_Double64Ratio ()
 Retrieves the text ratio - get/set -. More...
 
const Dtk_Double64Ratio () const
 Retrieves the text ratio - Read Only -. More...
 
Dtk_Double64Slant ()
 Retrieves the text slant - get/set -. More...
 
const Dtk_Double64Slant () const
 Retrieves the text slant - read only -. More...
 
 ~Dtk_TextStyle ()
 Destructor. More...
 

Static Public Member Functions

static Dtk_string FontStyleEnumToString (const FontStyleEnum &inEnum)
 
static Dtk_string TextJustificationEnumToString (const TextJustificationEnum &inEnum)
 

Protected Attributes

TextAttributeEnum _attributes
 Text Attribute (Underline, etc...) More...
 
Dtk_Double64 _char_height
 Height of each char in the text. More...
 
Dtk_Double64 _char_spacing
 Spacing between two chars. More...
 
Dtk_Double64 _char_width
 Width of each char in the text. More...
 
Dtk_Font _font
 Font informations. More...
 
FontStyleEnum _font_style
 Font Style type (Regular, Italic, etc...) More...
 
TextJustificationEnum _justification
 Text Justification (Left, etc...) More...
 
Dtk_Double64 _line_spacing
 Spacing between two lines in the text - for multiline texts for example -. More...
 
Dtk_Double64 _pitch
 Char Pitch. More...
 
Dtk_Double64 _ratio
 Char Ratio. It represents the stretch of the width of the text. Default value is 1. More...
 
Dtk_Double64 _slant
 Char Slant (PI/2 by default) More...
 

Friends

std::ostream & operator<< (std::ostream &o, const Dtk_TextStyle &d)
 

Detailed Description

This is the text_style. This class gathers several informations about text style.

Member Enumeration Documentation

◆ FontStyleEnum

Enumerator
StyleRegular 
StyleBold 
StyleItalic 
StyleBoldItalic 
262  {
264  StyleRegular = 0,
266  StyleBold,
268  StyleItalic,
271  };

◆ TextAttributeEnum

Enumerator
AttributeNone 
AttributeUnderline 
AttributeStrikethrough 
AttributeOverline 
AttributeSuperscript 
AttributeSubscript 
283  {
285  AttributeNone = 0,
287  AttributeUnderline = 1,
291  AttributeOverline = 4,
295  AttributeSubscript = 16
296  };

◆ TextJustificationEnum

Enumerator
JustificationLeft 
JustificationCenter 
JustificationRight 
JustificationNone 
297  {
299  JustificationLeft = 0,
305  };

Constructor & Destructor Documentation

◆ ~Dtk_TextStyle()

Dtk_TextStyle::~Dtk_TextStyle ( )

Destructor.

◆ Dtk_TextStyle() [1/3]

Dtk_TextStyle::Dtk_TextStyle ( )

Base constructor.

◆ Dtk_TextStyle() [2/3]

Dtk_TextStyle::Dtk_TextStyle ( const Dtk_TextStyle s)

Copy constructor.

Parameters
sObject to copy.

◆ Dtk_TextStyle() [3/3]

Dtk_TextStyle::Dtk_TextStyle ( Dtk_TextStyle &&  s)

\MoveConstructor{s}

Member Function Documentation

◆ Attributes() [1/2]

TextAttributeEnum& Dtk_TextStyle::Attributes ( )

Retrieves the text attribute - get/set -.

Returns
The text attribute
See also
Attributes() const

◆ Attributes() [2/2]

const TextAttributeEnum& Dtk_TextStyle::Attributes ( ) const

Retrieves the text attribute - read only -.

Returns
The text attribute
See also
Attributes()

◆ CharHeight() [1/2]

Dtk_Double64& Dtk_TextStyle::CharHeight ( )

Retrieves the char height - get/set -.

Returns
The char height
See also
CharHeight() const

◆ CharHeight() [2/2]

const Dtk_Double64& Dtk_TextStyle::CharHeight ( ) const

Retrieves the char height - Read Only -.

Returns
The char height
See also
CharHeight()

◆ CharSpacing() [1/2]

Dtk_Double64& Dtk_TextStyle::CharSpacing ( )

Retrieves the char spacing - get/set -.

Returns
The char spacing
See also
CharSpacing() const

◆ CharSpacing() [2/2]

const Dtk_Double64& Dtk_TextStyle::CharSpacing ( ) const

Retrieves the char spacing - read only -.

Returns
The char spacing
See also
CharSpacing()

◆ CharWidth() [1/2]

Dtk_Double64& Dtk_TextStyle::CharWidth ( )

Retrieves the char width - get/set -.

Returns
The char width
See also
CharWidth() const

◆ CharWidth() [2/2]

const Dtk_Double64& Dtk_TextStyle::CharWidth ( ) const

Retrieves the char width - read only -.

Returns
The char width
See also
CharWidth()

◆ Font() [1/2]

Dtk_Font& Dtk_TextStyle::Font ( )

Retrieves the font - get/set -.

Returns
The font
See also
Font() const

◆ Font() [2/2]

const Dtk_Font& Dtk_TextStyle::Font ( ) const

Retrieves the font - read only -.

Returns
The font
See also
Font()

◆ FontStyle() [1/2]

FontStyleEnum& Dtk_TextStyle::FontStyle ( )

Retrieves the font style - get/set -.

Returns
The font style
See also
FontStyle() const

◆ FontStyle() [2/2]

const FontStyleEnum& Dtk_TextStyle::FontStyle ( ) const

Retrieves the font style - read only -.

Returns
The font style
See also
FontStyle()

◆ FontStyleEnumToString()

static Dtk_string Dtk_TextStyle::FontStyleEnumToString ( const FontStyleEnum inEnum)
static
273  {
274  switch( inEnum )
275  {
276  default:
277  case StyleRegular: return L"StyleRegular";
278  case StyleBold: return L"StyleBold";
279  case StyleItalic: return L"StyleItalic";
280  case StyleBoldItalic: return L"StyleBoldItalic";
281  }
282  }

◆ Justification() [1/2]

TextJustificationEnum& Dtk_TextStyle::Justification ( )

Retrieves the text justification - get/set -.

Returns
The text justification
See also
Justification()

◆ Justification() [2/2]

const TextJustificationEnum& Dtk_TextStyle::Justification ( ) const

Retrieves the text justification - read only -.

Returns
The text justification
See also
Justification() const

◆ LineSpacing() [1/2]

Dtk_Double64& Dtk_TextStyle::LineSpacing ( )

Retrieves the line spacing - get/set -.

Returns
The line spacing
See also
LineSpacing() const

◆ LineSpacing() [2/2]

const Dtk_Double64& Dtk_TextStyle::LineSpacing ( ) const

Retrieves the line spacing - read only -.

Returns
The line spacing
See also
LineSpacing()

◆ operator=() [1/2]

Dtk_TextStyle& Dtk_TextStyle::operator= ( const Dtk_TextStyle s)

Assignment Operator.

Parameters
sObject to copy.

◆ operator=() [2/2]

Dtk_TextStyle& Dtk_TextStyle::operator= ( Dtk_TextStyle &&  s)

\MoveOp{s}

◆ Pitch() [1/2]

Dtk_Double64& Dtk_TextStyle::Pitch ( )

Retrieves the text pitch - get/set -.

Returns
The text pitch
See also
Pitch() const

◆ Pitch() [2/2]

const Dtk_Double64& Dtk_TextStyle::Pitch ( ) const

Retrieves the text pitch - read only -.

Returns
The text pitch
See also
Pitch()

◆ Ratio() [1/2]

Dtk_Double64& Dtk_TextStyle::Ratio ( )

Retrieves the text ratio - get/set -.

Returns
The text ratio
See also
Ratio() const

◆ Ratio() [2/2]

const Dtk_Double64& Dtk_TextStyle::Ratio ( ) const

Retrieves the text ratio - Read Only -.

Returns
The text ratio
See also
Ratio()

◆ Slant() [1/2]

Dtk_Double64& Dtk_TextStyle::Slant ( )

Retrieves the text slant - get/set -.

Returns
The text slant
See also
Slant() const

◆ Slant() [2/2]

const Dtk_Double64& Dtk_TextStyle::Slant ( ) const

Retrieves the text slant - read only -.

Returns
The text slant
See also
Slant()

◆ TextJustificationEnumToString()

static Dtk_string Dtk_TextStyle::TextJustificationEnumToString ( const TextJustificationEnum inEnum)
static
307  {
308  switch( inEnum )
309  {
310  default:
311  case JustificationLeft: return L"JustificationLeft";
312  case JustificationCenter: return L"JustificationCenter";
313  case JustificationRight: return L"JustificationRight";
314  case JustificationNone: return L"JustificationNone";
315  }
316  }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  o,
const Dtk_TextStyle d 
)
friend

Field Documentation

◆ _attributes

TextAttributeEnum Dtk_TextStyle::_attributes
protected

Text Attribute (Underline, etc...)

◆ _char_height

Dtk_Double64 Dtk_TextStyle::_char_height
protected

Height of each char in the text.

◆ _char_spacing

Dtk_Double64 Dtk_TextStyle::_char_spacing
protected

Spacing between two chars.

◆ _char_width

Dtk_Double64 Dtk_TextStyle::_char_width
protected

Width of each char in the text.

◆ _font

Dtk_Font Dtk_TextStyle::_font
protected

Font informations.

◆ _font_style

FontStyleEnum Dtk_TextStyle::_font_style
protected

Font Style type (Regular, Italic, etc...)

◆ _justification

TextJustificationEnum Dtk_TextStyle::_justification
protected

Text Justification (Left, etc...)

◆ _line_spacing

Dtk_Double64 Dtk_TextStyle::_line_spacing
protected

Spacing between two lines in the text - for multiline texts for example -.

◆ _pitch

Dtk_Double64 Dtk_TextStyle::_pitch
protected

Char Pitch.

◆ _ratio

Dtk_Double64 Dtk_TextStyle::_ratio
protected

Char Ratio. It represents the stretch of the width of the text. Default value is 1.

◆ _slant

Dtk_Double64 Dtk_TextStyle::_slant
protected

Char Slant (PI/2 by default)

Dtk_TextStyle::JustificationCenter
@ JustificationCenter
Definition: util_draw_dtk.hpp:301
Dtk_TextStyle::AttributeUnderline
@ AttributeUnderline
Definition: util_draw_dtk.hpp:287
Dtk_TextStyle::JustificationLeft
@ JustificationLeft
Definition: util_draw_dtk.hpp:299
Dtk_TextStyle::AttributeStrikethrough
@ AttributeStrikethrough
Definition: util_draw_dtk.hpp:289
Dtk_TextStyle::StyleBold
@ StyleBold
Definition: util_draw_dtk.hpp:266
Dtk_TextStyle::StyleItalic
@ StyleItalic
Definition: util_draw_dtk.hpp:268
Dtk_TextStyle::AttributeSubscript
@ AttributeSubscript
Definition: util_draw_dtk.hpp:295
Dtk_TextStyle::JustificationNone
@ JustificationNone
Definition: util_draw_dtk.hpp:304
Dtk_TextStyle::StyleBoldItalic
@ StyleBoldItalic
Definition: util_draw_dtk.hpp:270
Dtk_TextStyle::AttributeOverline
@ AttributeOverline
Definition: util_draw_dtk.hpp:291
Dtk_TextStyle::JustificationRight
@ JustificationRight
Definition: util_draw_dtk.hpp:303
Dtk_TextStyle::AttributeNone
@ AttributeNone
Definition: util_draw_dtk.hpp:285
Dtk_TextStyle::StyleRegular
@ StyleRegular
Definition: util_draw_dtk.hpp:264
Dtk_TextStyle::AttributeSuperscript
@ AttributeSuperscript
Definition: util_draw_dtk.hpp:293