Skip to content

SfntFont ​

Base class for TrueType and OpenType fonts.

Overview ​

Fontisan::SfntFont is the base class for sfnt-based fonts (TTF, OTF, WOFF, WOFF2).

Properties ​

PropertyTypeDescription
tablesHashFont tables by tag
glyphsGlyphAccessorGlyph access object
family_nameStringFont family name
styleStringFont style
versionStringFont version

Methods ​

table(tag) ​

Access a specific table.

ruby
head = font.table('head')
name = font.table('name')

glyph_name(id) ​

Get glyph name by ID.

ruby
name = font.glyph_name(42)

glyph_count ​

Get total glyph count.

ruby
count = font.glyph_count

See Also ​

Fontisan is a [Ribose](https://open.ribose.com/) project