@@ -0,0 +1,2680 @@
+%22%22%22%0A  Copyright 2014 Google Inc. All rights reserved.%0A%0A  Licensed under the Apache License, Version 2.0 (the %22License%22);%0A  you may not use this file except in compliance with the License.%0A  You may obtain a copy of the License at%0A%0A      http://www.apache.org/licenses/LICENSE-2.0%0A%0A  Unless required by applicable law or agreed to in writing, software%0A  distributed under the License is distributed on an %22AS IS%22 BASIS,%0A  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A  See the License for the specific language governing permissions and%0A  limitations under the License.%0A%22%22%22%0A%0Aimport argparse%0Aimport os%0Aimport sys%0Afrom fontTools.subset import load_font%0Afrom fontTools.subset import Options%0Afrom fontTools.subset import save_font%0Afrom fontTools.subset import Subsetter%0A%0A%0Adef main(args):%0A  %22%22%22Subset a font (useful for making small test fonts).%0A%0A  Args:%0A    args: list, arguments the user typed.%0A  %22%22%22%0A  parser = argparse.ArgumentParser()%0A  parser.add_argument('fontfile', help='Input font file')%0A  parser.add_argument('--text', default='',%0A                      help='Text to include in the subset')%0A  parser.add_argument('--unicodes', default='',%0A                      help='Comma separated list of Unicode codepoints (hex) '%0A                      'to include in the subset; eg, %22e7,0xe8,U+00e9%22')%0A  parser.add_argument('--glyphs', default='',%0A                      help='Comma separated list of glyph IDs (decimal) to '%0A                      'include in the subset; eg, %221,27%22')%0A  parser.add_argument('--hinting', default=False, action='store_true',%0A                      help='Enable hinting if specified, no hinting if not '%0A                      'present')%0A%0A  cmd_args = parser.parse_args(args)%0A%0A  options = Options()%0A  # Definitely want the .notdef glyph and outlines.%0A  options.notdef_glyph = True%0A  options.notdef_outline = True%0A  # Get the item. to keep in the subset.%0A  text = cmd_args.text%0A  unicodes_str = cmd_args.unicodes.lower().replace('0x', '').replace('u+', '')%0A  unicodes = %5Bint(c, 16) for c in unicodes_str.split(',') if c%5D%0A  glyphs = %5Bint(c) for c in cmd_args.glyphs.split(',') if c%5D%0A  fontfile = cmd_args.fontfile%0A  options.hinting = cmd_args.hinting  # False =%3E no hinting%0A%0A  dirname = os.path.dirname(fontfile)%0A  basename = os.path.basename(fontfile)%0A  filename, extension = os.path.splitext(basename)%0A  output_file = dirname + '/' + filename + '_subset' + extension%0A  font = load_font(fontfile, options, lazy=False)%0A%0A  subsetter = Subsetter(options)%0A  subsetter.populate(text=text, unicodes=unicodes, glyphs=glyphs)%0A  subsetter.subset(font)%0A  save_font(font, output_file, options)%0A%0A%0Aif __name__ == '__main__':%0A  main(sys.argv%5B1:%5D)%0A

add make_subset.py back (got lost some how)