Class: Fontisan::Audit::Checks::HintingCheck

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

Overview

Audits font hinting configuration. Hinting quality directly affects small-size screen rendering (Windows, Android, embedded systems).

TrueType (glyf outlines):

- fpgm (font program) presence recommended for hinted fonts
- prep (control value program) presence recommended
- cvt (control value table) presence recommended
- maxp.maxStackElements and maxp.maxZones must be positive
if any hinting instructions exist
- gasp table recommended for controlling grid-fitting per ppem

CFF (PostScript outlines):

- Private DICT should have BlueValues or StdHW/StdVW for hinting
- Subroutine usage (Local/Global subrs) recommended for size

Class Method Summary collapse

Methods inherited from Fontisan::Audit::Check

issue

Class Method Details

.call(font) ⇒ Array<Models::ValidationReport::Issue>

Parameters:

Returns:



26
27
28
29
30
31
32
33
34
# File 'lib/fontisan/audit/checks/hinting_check.rb', line 26

def self.call(font)
  if font.has_table?("glyf")
    validate_truetype_hinting(font)
  elsif font.has_table?("CFF ") || font.has_table?("CFF2")
    validate_cff_hinting(font)
  else
    []
  end
end

.codeObject



36
37
38
# File 'lib/fontisan/audit/checks/hinting_check.rb', line 36

def self.code
  :hinting
end