Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93b1483e authored by Deepanshu Gupta's avatar Deepanshu Gupta
Browse files

Improve error reporting when renaming fonts.

Log a better error in case of invalid input.

Change-Id: Ifb122c1cc624111769e650439aa24290155dbbc4
parent 3afd00e9
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ Rename the PS name of the input font.
OpenType fonts (*.otf) are not currently supported. They are copied to the destination without renaming.
XML files are also copied in case they are passed there by mistake.

Usage: build_font.py /path/to/input_font.ttf /path/to/output_font.ttf
Usage: build_font_single.py /path/to/input_font.ttf /path/to/output_font.ttf

"""

@@ -67,7 +67,8 @@ EXTENSIONS = ['.ttf', '.otf', '.xml']

def main(argv):
  if len(argv) < 2:
    sys.exit('Usage: build_font.py /path/to/input/font.ttf /path/to/out/font.ttf')
    print 'Incorrect usage: ' + str(argv)
    sys.exit('Usage: build_font_single.py /path/to/input/font.ttf /path/to/out/font.ttf')
  dest_path = argv[-1]
  input_path = argv[0]
  extension = os.path.splitext(input_path)[1].lower()