DATAKIT SDK  V2026.4
Dtk_TextStyle Class Reference

This is the text_style. This class gathers information 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

TextAttributeEnum & Attributes ()
 Retrieves the text attribute - get/set -. More...
 
const TextAttributeEnum & Attributes () const
 Retrieves the text attribute - read only -. More...
 
Dtk_Double64 & CharHeight ()
 Retrieves the char height - get/set -. More...
 
const Dtk_Double64 & CharHeight () const
 Retrieves the char height - Read Only -. More...
 
Dtk_Double64 & CharSpacing ()
 Retrieves the char spacing - get/set -. More...
 
const Dtk_Double64 & CharSpacing () const
 Retrieves the char spacing - read only -. More...
 
Dtk_Double64 & CharWidth ()
 Retrieves the char width - get/set -. More...
 
const Dtk_Double64 & CharWidth () const
 Retrieves the char width - read only -. More...
 
 Dtk_TextStyle ()
 Default constructor. More...
 
Dtk_Font & Font ()
 Retrieves the font - get/set -. More...
 
const Dtk_Font & Font () const
 Retrieves the font - read only -. More...
 
FontStyleEnum & FontStyle ()
 Retrieves the font style - get/set -. More...
 
const FontStyleEnum & FontStyle () const
 Retrieves the font style - read only -. More...
 
TextJustificationEnum & Justification ()
 Retrieves the text justification - get/set -. More...
 
const TextJustificationEnum & Justification () const
 Retrieves the text justification - read only -. More...
 
Dtk_Double64 & LineSpacing ()
 Retrieves the line spacing - get/set -. More...
 
const Dtk_Double64 & LineSpacing () const
 Retrieves the line spacing - read only -. More...
 
Dtk_Double64 & Pitch ()
 Retrieves the text pitch - get/set -. More...
 
const Dtk_Double64 & Pitch () const
 Retrieves the text pitch - read only -. More...
 
Dtk_Double64 & Ratio ()
 Retrieves the text ratio - get/set -. More...
 
const Dtk_Double64 & Ratio () const
 Retrieves the text ratio - Read Only -. More...
 
Dtk_Double64 & Slant ()
 Retrieves the text slant - get/set -. More...
 
const Dtk_Double64 & Slant () 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...
 

Detailed Description

This is the text_style. This class gathers information about text style.

Member Enumeration Documentation

◆ FontStyleEnum

Enumerator
StyleRegular 
StyleBold 
StyleItalic 
StyleBoldItalic 
244  {
245  //! \image html FontStyleRegular.png
246  StyleRegular = 0,
247  //! \image html FontStyleBold.png
248  StyleBold,
249  //! \image html FontStyleItalic.png
250  StyleItalic,
251  //! \image html FontStyleBoldItalic.png
253  };

◆ TextAttributeEnum

Enumerator
AttributeNone 
AttributeUnderline 
AttributeStrikethrough 
AttributeOverline 
AttributeSuperscript 
AttributeSubscript 
265  {
266  //! \image html TextAttributeNone.png
267  AttributeNone = 0,
268  //! \image html TextAttributeUnderline.png
269  AttributeUnderline = 1,
270  //! \image html TextAttributeStrikethrough.png
272  //! \image html TextAttributeOverline.png
273  AttributeOverline = 4,
274  //! \image html TextAttributeSuperscript.png
276  //! \image html TextAttributeSubscript.png
277  AttributeSubscript = 16
278  };

◆ TextJustificationEnum

Enumerator
JustificationLeft 
JustificationCenter 
JustificationRight 
JustificationNone 
279  {
280  //! \image html TextJustificationLeft.png
281  JustificationLeft = 0,
282  //! \image html TextJustificationCenter.png
284  //! \image html TextJustificationRight.png
287  };

Constructor & Destructor Documentation

◆ ~Dtk_TextStyle()

Dtk_TextStyle::~Dtk_TextStyle ( )

Destructor.

◆ Dtk_TextStyle()

Dtk_TextStyle::Dtk_TextStyle ( )

Default constructor.

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
255  {
256  switch( inEnum )
257  {
258  default:
259  case StyleRegular: return L"StyleRegular";
260  case StyleBold: return L"StyleBold";
261  case StyleItalic: return L"StyleItalic";
262  case StyleBoldItalic: return L"StyleBoldItalic";
263  }
264  }

◆ 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()

◆ 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
289  {
290  switch( inEnum )
291  {
292  default:
293  case JustificationLeft: return L"JustificationLeft";
294  case JustificationCenter: return L"JustificationCenter";
295  case JustificationRight: return L"JustificationRight";
296  case JustificationNone: return L"JustificationNone";
297  }
298  }

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:283
Dtk_TextStyle::AttributeUnderline
@ AttributeUnderline
Definition: util_draw_dtk.hpp:269
Dtk_TextStyle::JustificationLeft
@ JustificationLeft
Definition: util_draw_dtk.hpp:281
Dtk_TextStyle::AttributeStrikethrough
@ AttributeStrikethrough
Definition: util_draw_dtk.hpp:271
Dtk_TextStyle::StyleBold
@ StyleBold
Definition: util_draw_dtk.hpp:248
Dtk_TextStyle::StyleItalic
@ StyleItalic
Definition: util_draw_dtk.hpp:250
Dtk_TextStyle::AttributeSubscript
@ AttributeSubscript
Definition: util_draw_dtk.hpp:277
Dtk_TextStyle::JustificationNone
@ JustificationNone
Definition: util_draw_dtk.hpp:286
Dtk_TextStyle::StyleBoldItalic
@ StyleBoldItalic
Definition: util_draw_dtk.hpp:252
Dtk_TextStyle::AttributeOverline
@ AttributeOverline
Definition: util_draw_dtk.hpp:273
Dtk_TextStyle::JustificationRight
@ JustificationRight
Definition: util_draw_dtk.hpp:285
Dtk_TextStyle::AttributeNone
@ AttributeNone
Definition: util_draw_dtk.hpp:267
Dtk_TextStyle::StyleRegular
@ StyleRegular
Definition: util_draw_dtk.hpp:246
Dtk_TextStyle::AttributeSuperscript
@ AttributeSuperscript
Definition: util_draw_dtk.hpp:275