Created
October 8, 2019 00:23
-
-
Save fredbenenson/770f4aaa18728da6047e4efd7754a46b to your computer and use it in GitHub Desktop.
Generate Unicode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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