10 $options = OptionParser.new do |opt|
11 opt.banner = "Usage: strip_font.rb [options] luafiles"
13 opt.on( '-n', '--name FONT_NAME', 'Output font name' ) do |name| font_name = name end
14 opt.on( '-i', '--input INPUT_FONT', 'Input font') do |file| input_file = file end
15 opt.on( '-o', '--output OUTPUT_FONT', 'Font to generate') do |file| output_file = file end
25 File.open(file) do |f|
27 content.scan(/(["'])0x([0-9a-fA-F]{4})\1/).each do |match|
28 print(match.inspect+"\n")
29 selection.add "SelectMore(0u"+match[1]+");"
35 Open("#{input_file}");
36 #{selection.to_a.join("\n")}
38 DetachAndRemoveGlyphs();
39 SetFontNames("#{font_name}", "#{font_name}", "#{font_name}");
41 Generate("#{output_file}");
44 system("echo -en #{a.inspect} | fontforge -c")