![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
The ITextStyleFont graph node interface.
Get the constant Graph::INode interface. This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.
Murl.Graph.INode GetNodeInterface()
Get a constant Graph::IFontResourceTarget container. This method returns a constant pointer to a Graph::IFontResourceTarget container, which allows to query the font resources referenced by a node implementing this interface.
Murl.Graph.IGenericResourceTarget.ResourceIFont GetFontResourceTarget()
Set the font size.
Boolean SetFontSize(Number fontSize)
fontSize | The font size in system units. |
Get the font size.
Number GetFontSize()
Set the character spacing value. This method sets the character spacing used for output, i.e. the horizontal distance between neighbored characters. The given spacing value adds to the default value specified in the font used for rendering this text; a value of 0.0 represents the font's original spacing, a positive value increases the horizontal distance between characters, and a negative value decreases it.
Note: The given spacing value is not scaled by the font used; if e.g. a positive value is used for a large font, the same value used with a smaller version of that same font will result in a (relatively) larger distance between characters. It is however influenced by a possible additional scaling operation performed by a text rendering object.
Boolean SetSpacing(Number spacing)
spacing | The character spacing value. |
Get the character spacing value.
Number GetSpacing()
Set the leading value. This method sets the leading value used for output, i.e. the vertical distance between subsequent text lines. The given leading value adds to the default value specified in the font used for rendering this text; a value of 0.0 represents the font's original leading, a positive value increases the vertical distance between lines, and a negative value decreases it.
Note: The given leading value is not scaled by the font used; if e.g. a positive value is used for a large font, the same value used with a smaller version of that same font will result in a (relatively) larger distance between lines. It is however influenced by a possible additional scaling operation performed by a text rendering object.
Boolean SetLeading(Number leading)
leading | The leading value. |
Get the leading value.
Number GetLeading()
Set the ascent value.
Boolean SetAscent(Number ascent)
ascent | The ascent value. |
Get the ascent value.
Number GetAscent()
Set the descent value.
Boolean SetDescent(Number descent)
descent | The descent value. |
Get the descent value.
Number GetDescent()
Set the embolding strength value. The embolding strength determines the "boldness" or "weight" of the font's rendered glyphs. Positive values result in thicker lines, and negative values can be used to make the font "thinner". Useful values are in the range from -1 to +1, but can also lie beyond that range.
Note that not all types of fonts allow glyph embolding. If not supported, this method returns false.
Boolean SetEmbolding(Number strength)
strength | The embolding strength value. |
Get the embolding strength value.
Number GetEmbolding()
Set the space width factor. This method sets a factor used to control the actual width of the white space character. In some cases, it is useful to manually control the space character's width, when a font's default space width produces too small or too big a distance between subsequent words. A space width factor of 1.0 represents the original width defined by the font used for rendering.
Boolean SetSpaceWidthFactor(Number factor)
factor | The space width factor. |
Get the space width factor.
Number GetSpaceWidthFactor()
Set the digit width factor. This method sets a factor used to control the horizontal advance of all digit characters of a font ('0'-'9'). A digit width factor of 1.0 represents the original width defined by the font used for rendering.
Note, that this value only influences distance and not visual width; a value of e.g. 0.1 will result in overlapping digits without actually scaling them.
Boolean SetDigitWidthFactor(Number factor)
factor | The digit width factor. |
Get the digit width factor.
Number GetDigitWidthFactor()
Enable/disable unified digit width. For certain use cases, such as a score counter in an action game, it is useful to set a common width for all digits ('0'-'9'); doing so prevents the counter from jittering due to different digit widths.
Boolean SetSameDigitWidthEnabled(Boolean enabled)
enabled | If true, all digits use the same horizontal advance value. |
Check if unified digit width is enabled.
Boolean IsSameDigitWidthEnabled()