From: W. Trevor King Date: Sat, 10 Mar 2012 14:55:31 +0000 (-0500) Subject: Add `--output` option to `font-reduce.py`. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=83445798f92b72c7a70c84c40ba396448447f7c0;p=blog.git Add `--output` option to `font-reduce.py`. This allows to to reduce system fonts, where you don't have write permission on the source directory. For example, I was trying to reduce GoodCityModern: $ font-reduce.py /usr/share/fonts/freefonts/gocmase_.pfb Save Failed Traceback (most recent call last): … File "…/font-reduce.py", line 65, in convert o.generate(output_file, flags=('PfEd-comments',)) EnvironmentError: Font generation failed Which is a cryptic error message for a `permission denied` error. The newly supported working equivalent is: $ font-reduce.py -o GoodCityModern.woff /usr/share/fonts/freefonts/gocmase_.pfb --- diff --git a/posts/font-reduce/font-reduce.py b/posts/font-reduce/font-reduce.py index 03c8aa7..d4d8c40 100755 --- a/posts/font-reduce/font-reduce.py +++ b/posts/font-reduce/font-reduce.py @@ -110,10 +110,13 @@ if __name__ == '__main__': '-l', '--license', help='override font license text') parser.add_argument( '-s', '--source', help='override font source URL') + parser.add_argument( + '-o', '--output', help='override path to output file') parser.add_argument( 'font', nargs='+', help='path to source font') args = parser.parse_args() for font in args.font: - convert(font, license=args.license, source=args.source) + convert(font, output_file=args.output, license=args.license, + source=args.source)