Class: Fontisan::Audit::Checks::OpenTypeConformanceCheck
- Inherits:
-
Fontisan::Audit::Check
- Object
- Fontisan::Audit::Check
- Fontisan::Audit::Checks::OpenTypeConformanceCheck
- Defined in:
- lib/fontisan/audit/checks/opentype_conformance_check.rb
Overview
Foundational OpenType spec conformance checks. Covers the most commonly-violated "MUST" and "SHOULD" rules from the OT spec that other check domains don't already cover.
This check is intentionally a growing foundation — new OT spec rules are added incrementally as real-world fonts surface them. Full OT conformance is a long-running effort that tracks the spec's evolution (axis 14 per TODO #03).
Current checks:
- Required tables for each sfnt flavor (TTF vs CFF vs variable)
- head.indexToLocFormat consistency with loca table size
- name table must have at least family (1), subfamily (2),
full (4), PostScript (6) name IDs
- OS/2 fsSelection must not use reserved bits
- hhea.numberOfHMetrics must be ≤ maxp.numGlyphs
- post table version must be valid
- cmap must have at least one Unicode subtable (already
covered by CmapCheck — skipped here to avoid duplicate issues)
Constant Summary collapse
- REQUIRED_NAME_IDS =
{ 1 => "Family", 2 => "Subfamily", 4 => "Full", 6 => "PostScript", }.freeze
Class Method Summary collapse
Methods inherited from Fontisan::Audit::Check
Class Method Details
.call(font) ⇒ Array<Models::ValidationReport::Issue>
38 39 40 41 42 43 44 45 46 |
# File 'lib/fontisan/audit/checks/opentype_conformance_check.rb', line 38 def self.call(font) issues = [] issues.concat(validate_required_tables(font)) issues.concat(validate_loca_format(font)) issues.concat(validate_name_coverage(font)) issues.concat(validate_os2_fsselection(font)) issues.concat(validate_hhea_metrics(font)) issues end |
.code ⇒ Object
48 49 50 |
# File 'lib/fontisan/audit/checks/opentype_conformance_check.rb', line 48 def self.code :opentype_conformance end |