A font resource loaded from a TTF/OTF file. Glyphs are packed into an SDF/MSDF atlas.
Lua full name: lysa.Font
|
| Font | create (uri: string)static |
| | Loads a font from the given virtual path and returns a new Font instance. More...
|
| |
| Font | clone () |
| | Returns a deep copy of this font, sharing the atlas but with independent rendering parameters. More...
|
| |
| float2 | get_size (text: string, scale: number) |
| | Returns the rendered width and height in pixels for the given UTF-8 string at the given scale. More...
|
| |
| number | get_width (char: string, scale: number) |
| | Returns the advance width in pixels for the first character of the given string at the given scale. More...
|
| |
| GlyphInfo | get_glyph_info (index: integer) |
| | Returns atlas and metrics information for the glyph at the given index. More...
|
| |
|
| integer | font_size |
| | Atlas font size in pixels used when rasterising glyphs. (read-only)
|
| |
| number | line_height |
| | Line height as a multiplier of font_size. (read-only)
|
| |
| number | ascender |
| | Distance from the baseline to the top of the tallest glyph, in pixels. (read-only)
|
| |
| number | descender |
| | Distance from the baseline to the bottom of the lowest glyph, in pixels (negative). (read-only)
|
| |
| Image | atlas |
| | Underlying GPU image containing the glyph atlas. (read-only)
|
| |
| float2 | px_range |
| | SDF/MSDF pixel range (x = lower, y = upper).
|
| |
| float4 | outline_color |
| | RGBA color of the glyph outline.
|
| |
| number | outline_threshold |
| | Distance field threshold for the outline boundary.
|
| |
| number | outline_bias |
| | Bias offset applied to the outline distance.
|
| |
| number | outline_width_absolute |
| | Absolute outline width in pixels.
|
| |
| number | outline_width_relative |
| | Relative outline width as a fraction of the font size.
|
| |
| number | outline_blur |
| | Blur factor applied to the outline edge; higher values = softer edge.
|
| |
| number | rounded_outline |
| | Corner rounding factor for the outline (0 = square corners, 1 = fully rounded).
|
| |
| number | rounded_interior |
| | Corner rounding factor applied to the interior of glyphs.
|
| |