Module: Fontisan::Ufo::Compile::Name

Defined in:
lib/fontisan/ufo/compile/name.rb

Overview

Builds the OpenType name table from UFO fontinfo data. Writes Windows-Unicode (platform 3, encoding 1) name records for the standard 6 name IDs (copyright, family, subfamily, unique ID, full name, version, PostScript name).

BinData's Tables::Name structure doesn't make construction from a record list easy (it has a custom after_read_hook and a rest :string_storage); this builder produces the bytes directly so we don't fight the BinData shape.

Constant Summary collapse

PLATFORM_WINDOWS_UNICODE =
3
ENCODING_WINDOWS_UNICODE_BMP =
1
LANGUAGE_WINDOWS_ENGLISH_US =
0x0409

Class Method Summary collapse

Class Method Details

.build(font, **_opts) ⇒ String

Returns the name table bytes.

Parameters:

Returns:

  • (String)

    the name table bytes



23
24
25
26
# File 'lib/fontisan/ufo/compile/name.rb', line 23

def self.build(font, **_opts)
  records = default_records(font)
  format0_bytes(records)
end