Module: Fontisan::Ufo::Compile::Maxp

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

Overview

Builds the OpenType maxp (maximum profile) table. TrueType (0x00010000) carries 13 metrics; CFF (0x00005000) carries just num_glyphs. We pick the version based on which outline compiler is in use — caller passes version:.

Constant Summary collapse

VERSION_TRUE_TYPE =
0x00010000
VERSION_OPEN_TYPE =
0x00005000

Class Method Summary collapse

Class Method Details

.build(_font, glyphs:, version: VERSION_OPEN_TYPE) ⇒ Fontisan::Tables::Maxp

Parameters:

Returns:



19
20
21
22
23
24
25
26
27
28
# File 'lib/fontisan/ufo/compile/maxp.rb', line 19

def self.build(_font, glyphs:, version: VERSION_OPEN_TYPE)
  if version == VERSION_TRUE_TYPE
    build_truetype(glyphs)
  else
    Fontisan::Tables::Maxp.new(
      version_raw: VERSION_OPEN_TYPE,
      num_glyphs: glyphs.size,
    )
  end
end