Class: Fontisan::Audit::Checks::HeadCheck

Inherits:
Fontisan::Audit::Check show all
Defined in:
lib/fontisan/audit/checks/head_check.rb

Overview

Validates the 'head' table per the OpenType spec.

Constant Summary collapse

HEAD_MAGIC =
0x5F0F3CF5
MIN_UPM =
16
MAX_UPM =
16_384
MAC_STYLE_DEFINED_BITS =
0x00FF
MAC_STYLE_RESERVED_BITS =
0xFF00

Class Method Summary collapse

Methods inherited from Fontisan::Audit::Check

issue

Class Method Details

.call(font) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/fontisan/audit/checks/head_check.rb', line 16

def self.call(font)
  return [] unless font.has_table?("head")

  head = font.table("head")
  issues = []
  issues.concat(validate_magic(head))
  issues.concat(validate_upm(head))
  issues.concat(validate_loc_format(head))
  issues.concat(validate_dates(head))
  issues.concat(validate_mac_style(head))
  issues
end

.codeObject



29
30
31
# File 'lib/fontisan/audit/checks/head_check.rb', line 29

def self.code
  :ot_head
end