Sha256: fcae2c4903e678fed301ef362cf3dbea39aaa628111fead9bf2e43ced8f135ff

Contents?: true

Size: 487 Bytes

Versions: 8

Compression:

Stored size: 487 Bytes

Contents

#!/usr/bin/env ruby

fname = ARGV.first || "unifont-5.1.20080820.hex"

want = ARGV[1] && ARGV[1].to_i(16)

File.read(fname).each_line do |line|
  idx, data = line.strip.split(':',2)
  idx = idx.to_i(16)
  next if want && want != idx
  case data.size
  when 32
    data.scan(/../).each do |x|
      puts(("%08b" % x.to_i(16)).tr('01',' #'))
    end
  when 64
    data.scan(/..../).each do |x|
      puts(("%016b" % x.to_i(16)).tr('01',' #'))
    end
  else raise data.size.to_s
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sugar_png-0.5.5 data/1-dump-hex.rb
sugar_png-0.5.4 data/1-dump-hex.rb
sugar_png-0.5.3 data/1-dump-hex.rb
sugar_png-0.5.2 data/1-dump-hex.rb
sugar_png-0.5.1 data/1-dump-hex.rb
sugar_png-0.5.0 data/1-dump-hex.rb
sugar_png-0.4.1 data/1-dump-hex.rb
sugar_png-0.4.0 data/1-dump-hex.rb