KerningData Class Reference

#include <customgui_kerning.h>

Inheritance diagram for KerningData:

详细描述

The CustomDataType that contains an array of Kerning 对象。

注意
Has to be created with Alloc() and destroyed with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

Alloc/Free

static KerningData Alloc ()
static void  Free ( KerningData *&pData)

Constructor/Destructor

  KerningData ()
  ~KerningData ()

Kerning

Kerning   GetKerning ( Int32 index) const
Kerning   CalculateKerning ( Int32 index, const maxon::String &s) const
Bool   SetKerning ( Int32 index, const Kerning &kerning, Bool combine=false)
Bool   SetKerning ( Int32 index_start, Int32 index_end, const Kerning &kerning, Bool combine=false)
Bool   SetKerning ( Int32 index_start, Int32 index_end, const KerningTriState &tristate)
void  ResetKerning ( Int32 index)
void  ResetKerning ()

Array

Bool   Init (const maxon::String &s, Bool preserve)
Bool   Init ( Int32 count, Bool preserve=false)
Int32   GetCount () const
void  清零 ()

CopyTo

Bool   CopyTo ( KerningData *pDest) const

String

String   GetString () const

Selection

void  SetSelectionStart ( Int32 start)
Int32   GetSelectionStart () const
void  SetSelectionEnd ( Int32 end)
Int32   GetSelectionEnd () const
void  SetSelection ( Int32 start, Int32 end)
Int32   GetSelectionLength () const

Edit Mode

Bool   GetEditmode () const
void  SetEditmode ( Bool editmode)

构造函数 & 析构函数文档编制

◆  KerningData()

KerningData ( )

Constructor.

◆  ~KerningData()

~ KerningData ( )

Destructor.

成员函数文档编制

◆  Alloc()

static KerningData * Alloc ( )
static

Allocates a KerningData object. Destroy the allocated KerningData object with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

返回
The allocated KerningData object, or nullptr if the allocation failed.

◆  Free()

static void Free ( KerningData *&  pData )
static

Destructs KerningData objects allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in,out] pData The KerningData object to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  GetKerning()

Kerning GetKerning ( Int32   index ) const

Retrieves the Kerning object with the settings at index .

参数
[in] index The index of the Kerning 对象。
返回
The Kerning object for index .

◆  CalculateKerning()

Kerning CalculateKerning ( Int32   index ,
const maxon::String s  
) const

Calculates the actual Kerning for index .

注意
All offsets and scale of the previous array elements will be taken into account.
参数
[in] index The index of the Kerning 对象。
[in] s Pass a string to consider line breaks.
返回
The Kerning object for index .

◆  SetKerning() [1/3]

Bool SetKerning ( Int32   index ,
const Kerning kerning ,
Bool   combine = false  
)

设置 Kerning data for index .

参数
[in] index The index of the Kerning 对象。
[in] kerning The Kerning data to set.
[in] combine false , existing Kerning data will be overwritten with new one. If true , both will be combined.
返回
True if successful.

◆  SetKerning() [2/3]

Bool SetKerning ( Int32   index_start ,
Int32   index_end ,
const Kerning kerning ,
Bool   combine = false  
)

Sets Kerning values for a range of indices.

参数
[in] index_start The range start index.
[in] index_end The range end index.
[in] kerning The Kerning data to set.
[in] combine false , existing Kerning datasets will be overwritten with new one. If true , they will be combined.
返回
true if successful, otherwise false .

◆  SetKerning() [3/3]

Bool SetKerning ( Int32   index_start ,
Int32   index_end ,
const KerningTriState tristate  
)

Sets KerningTriState values for a range of indices.

参数
[in] index_start The range start index.
[in] index_end The range end index.
[in] tristate The Kerning TriState .
返回
true if successful, otherwise false .

◆  ResetKerning() [1/2]

void ResetKerning ( Int32   index )

Resets Kerning data for index to default values.

参数
[in] index The index of the Kerning data to reset.

◆  ResetKerning() [2/2]

void ResetKerning ( )

Resets all Kerning data objects in array to default values (count is preserved).

◆  Init() [1/2]

Bool Init ( const maxon::String s ,
Bool   preserve  
)

Initializes Kerning data array with length of string s .

参数
[in] s The length of the Kerning data array will be set to length of s .
[in] preserve true to keep existing Kerning data. false for default values in all elements.
返回
true if successful, otherwise false .

◆  Init() [2/2]

Bool Init ( Int32   count ,
Bool   preserve = false  
)

Initializes Kerning data array with length count .

参数
[in] count The length of the Kerning data array.
[in] preserve true to keep existing Kerning data. false for default values in all elements.
返回
true if successful, otherwise false .

◆  GetCount()

Int32 GetCount ( ) const

Gets the length of Kerning data array.

返回
The Kerning data array's length.

◆  Clear()

void Clear ( )

Clears all Kerning data. Length is reset to 0 .

◆  CopyTo()

Bool CopyTo ( KerningData pDest ) const

Copies the KerningData object to another one.

参数
[in] pDest The pointer to the destination KerningData 对象。
返回
true if successful, otherwise false .

◆  GetString()

String GetString ( ) const

Retrieves the string that the KerningData has been initialized with.

返回
The string.

◆  SetSelectionStart()

void SetSelectionStart ( Int32   start )

Sets the index of the selection start.

参数
[in] start The index of the selection start: 0 <= start < GetString() .GetLength()

◆  GetSelectionStart()

Int32 GetSelectionStart ( ) const

Gets the index of the selection start.

返回
The index of the selection start.

◆  SetSelectionEnd()

void SetSelectionEnd ( Int32   end )

Sets the index of the selection end.

参数
[in] end The index of the selection end: 0 <= end < GetString() .GetLength()

◆  GetSelectionEnd()

Int32 GetSelectionEnd ( ) const

Gets the index of the selection end.

返回
The index of the selection end.

◆  SetSelection()

void SetSelection ( Int32   start ,
Int32   end  
)

Sets the indexes of the selection start and end.

参数
[in] start The index of the selection start.
[in] end The index of the selection end.

◆  GetSelectionLength()

Int32 GetSelectionLength ( ) const

Gets the length of the selection ( GetSelectionEnd() - GetSelectionStart() ).

返回
The selection's length.

◆  GetEditmode()

Bool GetEditmode ( ) const

Gets the edit mode state.

返回
true if edit mode is enabled, otherwise false .

◆  SetEditmode()

void SetEditmode ( Bool   editmode )

Sets the edit mode state.

参数
[in] editmode true to enable edit mode, otherwise false .