class HexaPDF::Type::FontDescriptor
See: PDF2.0 s9.8
whole.
This class specifies metrics and other attributes of a simple font or a CID font as a
def perform_validation #:nodoc:
def perform_validation #:nodoc: super if [self[:FontFile], self[:FontFile2], self[:FontFile3]].compact.size > 1 yield("Only one of /FontFile, /FontFile2 or /FontFile3 may be set", false) end font_weight = self[:FontWeight] if font_weight && !ALLOWED_FONT_WEIGHTS.include?(font_weight) yield("Field FontWeight does not contain an allowed value", true) delete(:FontWeight) end descent = self[:Descent] if descent && descent > 0 yield("The /Descent value needs to be a negative number", true) self[:Descent] = -descent end end