4
5
6
7
8
9
10
11
|
# File 'lib/dragonfly_fonts/processors/correct_metrics.rb', line 4
def call(content, options = {})
raise UnsupportedFormat unless content.ext
raise UnsupportedFormat unless FONT_FORGE_SUPPORTED_FORMATS.include?(content.ext.downcase)
content.shell_update(ext: content.ext || 'ttf') do |old_path, new_path|
"#{fontforge_command} -lang=ff -c 'Open($1); SetOS2Value(\"HHeadAscent\",$ascent); SetOS2Value(\"HHeadAscentIsOffset\",0); SetOS2Value(\"HHeadDescent\",-$descent); SetOS2Value(\"HHeadDescentIsOffset\",0); SetOS2Value(\"TypoLineGap\",0); Generate($2);' #{old_path} #{new_path}"
end
end
|