lib/ttfunk/subset/base.rb in ttfunk-1.2.2 vs lib/ttfunk/subset/base.rb in ttfunk-1.3.0
- old
+ new
@@ -1,16 +1,16 @@
-require 'ttfunk/table/cmap'
-require 'ttfunk/table/glyf'
-require 'ttfunk/table/head'
-require 'ttfunk/table/hhea'
-require 'ttfunk/table/hmtx'
-require 'ttfunk/table/kern'
-require 'ttfunk/table/loca'
-require 'ttfunk/table/maxp'
-require 'ttfunk/table/name'
-require 'ttfunk/table/post'
-require 'ttfunk/table/simple'
+require_relative '../table/cmap'
+require_relative '../table/glyf'
+require_relative '../table/head'
+require_relative '../table/hhea'
+require_relative '../table/hmtx'
+require_relative '../table/kern'
+require_relative '../table/loca'
+require_relative '../table/maxp'
+require_relative '../table/name'
+require_relative '../table/post'
+require_relative '../table/simple'
module TTFunk
module Subset
class Base
attr_reader :original
@@ -29,14 +29,14 @@
def encode(options={})
cmap_table = new_cmap_table(options)
glyphs = collect_glyphs(original_glyph_ids)
- old2new_glyph = cmap_table[:charmap].inject({ 0 => 0 }) { |map, (code, ids)| map[ids[:old]] = ids[:new]; map }
+ old2new_glyph = cmap_table[:charmap].inject({ 0 => 0 }) { |map, (_, ids)| map[ids[:old]] = ids[:new]; map }
next_glyph_id = cmap_table[:max_glyph_id]
glyphs.keys.each do |old_id|
- unless old2new_glyph.key?(old_id)
+ unless old2new_glyph.key?(old_id)
old2new_glyph[old_id] = next_glyph_id
next_glyph_id += 1
end
end