class

NanoSVG::Font

Inherits NanoSVG::BinRead < Reference < Object

Constructors

new(data : Bytes)
Source

Class methods

load(path : String) : Font | Nil
Source

Instance methods

advance(gid : Int32) : Float32
Source
ascender
Source
descender
Source
glyph(gid : Int32) : Glyph | Nil
Source
glyph_index(codepoint : Int32) : Int32

cmap codepoint → glyph id (0 = .notdef when missing).

Source
kern(l_gid : Int32, r_gid : Int32) : Float32

Kerning between two glyph ids in font units (positive moves the second glyph right). GPOS first, legacy kern as a fallback.

Source
units_per_em
Source
x_height

X-height in font units: OS/2 sxHeight when present (v2+), else the top of the lowercase 'x' outline.

Source

Nested types