Module: Fontisan::Ufo::Compile::Post

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

Overview

Builds the OpenType post (PostScript name) table. Default version is 3.0 (no per-glyph names; smallest).

Constant Summary collapse

VERSION_3_0_RAW =
0x00030000

Class Method Summary collapse

Class Method Details

.build(font, **_opts) ⇒ String

Returns the post table bytes (32 bytes for v3.0).

Parameters:

  • _font (Fontisan::Ufo::Font)

    italic angle + underline read from info, but everything else is zero (no hinting)

Returns:

  • (String)

    the post table bytes (32 bytes for v3.0)



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fontisan/ufo/compile/post.rb', line 15

def self.build(font, **_opts)
  italic_angle = font.info.italic_angle || 0.0
  [
    VERSION_3_0_RAW,                       # version 3.0
    (italic_angle * 0x10000).to_i,         # italicAngle (Fixed 16.16)
    -100,                                  # underlinePosition (FUnits)
    50,                                    # underlineThickness
    0,                                     # isFixedPitch
    0,                                     # minMemType42
    0,                                     # maxMemType42
    0,                                     # minMemType1
    0, # maxMemType1
  ].pack("NNnnNNNNN")
end