From 744212d0eb3cc771698f04fd8b5a2cd74e8d8fb1 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 6 May 2011 02:01:33 -0500 Subject: [PATCH] Write documentation of script.py --- mkv => command lines for mkv | 0 lib.py | 2 ++ script.py | 29 +++++++++++++---------------- 3 files changed, 15 insertions(+), 16 deletions(-) rename mkv => command lines for mkv (100%) diff --git a/mkv b/command lines for mkv similarity index 100% rename from mkv rename to command lines for mkv diff --git a/lib.py b/lib.py index 4bf87c6..3da2267 100644 --- a/lib.py +++ b/lib.py @@ -29,6 +29,8 @@ class InterpolateFonts: font might be 50% between the two, an extra-bold font might be 200% and a thin one -100%." + http://fontforge.sourceforge.net/elementmenu.html#Interpolate + The three different `parameters' correspond to the three types of interpolation that are alluded to in the FontForge documentation. diff --git a/script.py b/script.py index 95b7c72..9cce21a 100755 --- a/script.py +++ b/script.py @@ -5,22 +5,12 @@ import os import lib -"""The two paths correspond to fonts (or font directories) for `mash up'. - -One question regarding the x, y, z flags could be: could we look at the -fontforge source? - -The `output' integer is a choice, and corresponds to the number of fonts that -are produced. - -""" - def handle_options(my_options): """Process optparse options with the InterpolateFonts class in mind. One flag is passed directly from the command line to my_options. - The x, y, z flags correspond to the `my_parameter' attribute of the + The x, y, z flags correspond to the `parameter' attribute of the InterpolateFonts class, cf its docstring http://fontforge.sourceforge.net/elementmenu.html#Interpolate @@ -40,11 +30,18 @@ def handle_options(my_options): if __name__ == "__main__": - gui = OptionParser() - gui.add_option("-o", "--output", action="store", type="int", dest="output_files") - gui.add_option("-x", action="store_true", dest="x") - gui.add_option("-y", action="store_true", dest="y") - gui.add_option("-z", action="store_true", dest="z") + usage = "%prog [-xyz] -o number font_path1 font_path2" + epi = """Interpolate between two font paths and generate a number of ttf +files along the way. For permutations, the font paths may be directories. +Fontforge defines three types of interpolation. We call them x, y, and z. This +software produces crashes, freezes, segmentation faults and fonts.""" + + gui = OptionParser(usage, epilog=epi) + gui.add_option("-o", "--output", action="store", type="int", + dest="output_files", help="positive integer related to amount of font production") + gui.add_option("-x", action="store_true", dest="x", help="interpolation 100%") + gui.add_option("-y", action="store_true", dest="y", help="interpolation -100%") + gui.add_option("-z", action="store_true", dest="z", help="interpolation 200%") (options, paths) = gui.parse_args() a_parameter = handle_options(options) -- 2.11.4.GIT