Kerning Struct Reference

#include <customgui_kerning.h>

Detailed Description

Holds the kerning parameters for one character in a string.

Public Member Functions

 Kerning ()
 
 Kerning (const Kerning &source)
 
 Kerning (Float kerning, Float tracking, Float scale, Float scaleH, Float scaleV, Float baselineShift, Float leading)
 
Bool ReadHF (HyperFile *hf, Int32 level)
 
Bool WriteHF (HyperFile *hf) const
 
Vector GetOffsetVector () const
 
Vector GetScaleVector () const
 
String ToString () const
 

Public Attributes

Float _kerning
 
Float _tracking
 
Float _scale
 
Float _scaleH
 
Float _scaleV
 
Float _baselineShift
 
Float _leading
 

Friends

Bool operator== (const Kerning &k1, const Kerning &k2)
 
Bool operator!= (const Kerning &k1, const Kerning &k2)
 
Kerning Combine (const Kerning &k1, const Kerning &k2)
 

Constructor & Destructor Documentation

◆ Kerning() [1/3]

Kerning ( )

Default constructor.

◆ Kerning() [2/3]

Kerning ( const Kerning source)

Copy constructor.

Parameters
[in]sourceThe Kerning object to copy members from.

◆ Kerning() [3/3]

Kerning ( Float  kerning,
Float  tracking,
Float  scale,
Float  scaleH,
Float  scaleV,
Float  baselineShift,
Float  leading 
)

Constructor with parameters.

Parameters
[in]kerningAssigned to _kerning.
[in]trackingAssigned to _tracking.
[in]scaleAssigned to _scale.
[in]scaleHAssigned to _scaleH.
[in]scaleVAssigned to _scaleV.
[in]baselineShiftAssigned to _baselineShift.
[in]leadingAssigned to _leading.

Member Function Documentation

◆ ReadHF()

Bool ReadHF ( HyperFile hf,
Int32  level 
)

Reads the Kerning object from a HyperFile.

Parameters
[in]hfThe HyperFile to read from. The caller owns the pointed HyperFile.
[in]levelThe file level.
Returns
true if successful, otherwise false.

◆ WriteHF()

Bool WriteHF ( HyperFile hf) const

Writes the Kerning object to a HyperFile.

Parameters
[in]hfThe HyperFile to write to. The caller owns the pointed HyperFile.
Returns
true if successful, otherwise false.

◆ GetOffsetVector()

Vector GetOffsetVector ( ) const

Computes a vector that combines kerning, tracking, baseline shift and leading.

Returns
The offset vector.

◆ GetScaleVector()

Vector GetScaleVector ( ) const

Computes a vector that combines scale, horizontal scale and vertical scale.

Returns
The scale vector.

◆ ToString()

String ToString ( ) const

Converts the Kerning value to a readable string.

Returns
The string.

Friends And Related Function Documentation

◆ operator==

Bool operator== ( const Kerning k1,
const Kerning k2 
)
friend

Equality operator.

Returns
true if equal, otherwise false.

◆ operator!=

Bool operator!= ( const Kerning k1,
const Kerning k2 
)
friend

Inequality operator.

Returns
true if not equal, otherwise false.

◆ Combine

Kerning Combine ( const Kerning k1,
const Kerning k2 
)
friend

Combines two Kerning objects.

Note
Offsets are added, scales are taken from second Kerning object.
Parameters
[in]k1The first Kerning object.
[in]k2The second Kerning object.
Returns
The resulting Kerning object.

Member Data Documentation

◆ _kerning

Float _kerning

Moves the character along its X axis, to create (or remove) space before the character.

◆ _tracking

Float _tracking

Like _kerning, but for a group of characters.

◆ _scale

Float _scale

Scales the character.

◆ _scaleH

Float _scaleH

Scales the character along its X axis.

◆ _scaleV

Float _scaleV

Scales the character along its Y axis.

◆ _baselineShift

Float _baselineShift

Moves the character along its Y axis.

◆ _leading

Float _leading

Not used currently.