![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
The IFont resource object interface.
A font resource can either store a number of individual glyph rectangles referencing sub-regions of a Resource::IImage in order to render bitmap fonts, or a number of glyph outlines for rendering vector fonts on the fly (without the need of a Resource::IImage). Note, that bitmap font rendering works similar to using a Resource::IAtlas, in that the font resource does not store the actual glyph bitmaps. A corresponding Resource::IImage must be active during rendering e.g. a Graph::ITextGeometry object to produce the correct output.
Get the font's scale factor.
Number GetScaleFactor()
Get the font's vertical line size.
Number GetSizeY()
Get the font's base line offset.
Number GetBaseLine()
Get the font's ascent.
Number GetAscent()
Get the font's descent.
Number GetDescent()
Get the font spacing, i.e. the horizontal distance between glyphs.
Number GetSpacing()
Get the font leading, i.e. the vertical distance between lines.
Number GetLeading()
Get the horizontal size of the whitespace character.
Number GetSpaceWidth()
Get the common horizontal size of all digits.
Number GetDigitWidth()
Get the horizontal screen offset for rendering.
Number GetOffsetX()
Get the vertical screen offset for rendering.
Number GetOffsetY()
Check if the font resource contains bitmap glyph rectangles.
Boolean HasRectangles()
Get the actual number of bitmap glyph rectangles contained in the font.
Integer GetNumberOfRectangles()
Get a bitmap glyph rectangle by its index.
Murl.Resource.IRectangle GetRectangleByIndex(Integer index)
index | The index in the range from 0 to GetNumberOfRectangles()-1. |
Get a bitmap glyph rectangle for a given Unicode value.
Murl.Resource.IRectangle GetRectangleByCode(Integer charCode)
charCode | The Unicode value to query. |
Check if the font resource contains glyph outlines.
Boolean HasOutlines()
Get the actual number of glyph outlines contained in the font.
Integer GetNumberOfOutlines()
Get a glyph outline by its index.
Murl.Resource.IOutline GetOutlineByIndex(Integer index)
index | The index in the range from 0 to GetNumberOfOutlines()-1. |
Get a glyph outline for a given Unicode value.
Murl.Resource.IOutline GetOutlineByCode(Integer charCode)
charCode | The Unicode value to query. |
Check if the font resource contains kerning information.
Boolean HasKerning()
Get the kerning offset for a pair of Unicode characters.
Number GetKerningByCode(Integer charCodeLeft, Integer charCodeRight)
charCodeLeft | The Unicode value of the left character. |
charCodeRight | The Unicode value of the right character. |