Class: Preflight::Rules::NoFontSubsets

Inherits:
Object
  • Object
show all
Defined in:
lib/preflight/rules/no_font_subsets.rb

Overview

check a file has no font subsets. Subsets are handy and valid in standards like PDFX/1a, but they can make it hard to edit a file

Arguments: none

Usage:

class MyPreflight
  include Preflight::Profile

  rule Preflight::Rules::NoFontSubsets
end

Instance Method Summary collapse

Instance Method Details

#check_hash(ohash) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/preflight/rules/no_font_subsets.rb', line 21

def check_hash(ohash)
  array = []
  ohash.each do |key, obj|
    next unless obj.is_a?(::Hash) && obj[:Type] == :Font
    if subset?(obj)
      array << Issue.new("Font partially subseted (#{obj[:BaseFont]})", self, :base_font => obj[:BaseFont])
    end
  end
  array
end