Skip to content

Instantly share code, notes, and snippets.

@fredbenenson
Created October 8, 2019 00:23
Show Gist options
  • Save fredbenenson/770f4aaa18728da6047e4efd7754a46b to your computer and use it in GitHub Desktop.
Save fredbenenson/770f4aaa18728da6047e4efd7754a46b to your computer and use it in GitHub Desktop.
Generate Unicode
#!/usr/bin/env ruby
# encoding: utf-8
require "unicode/name"
require "csv"
require "slugify"
(4884..4886).each do |char|
begin
output = char.chr('UTF-8').to_s
char_name = Unicode::Name.of(output)
file_name = char_name ? "#{char_name.slugify}-#{char}" : char.to_s
puts "#{char}"
# - #{output} - #{char_name}"
if !char_name.to_s.empty?
cmd = "convert -verbose -size 500x500 -pointsize 450 -font Noto-Serif-Ethiopic-Regular -gravity center caption:'#{output}' output/#{file_name}.png"
system(cmd)
end
rescue RangeError => e
# puts e
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment