From 5aa18e58d1cde3fbb929e29e8a26b6fe7d550273 Mon Sep 17 00:00:00 2001 From: "A.T.Brask" Date: Sat, 5 Sep 2020 20:42:52 +0200 Subject: [PATCH] Fixed #1 --- README | 3 ++- c64ttf.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README b/README index 9e8dc30..fd9aa9c 100644 --- a/README +++ b/README @@ -10,6 +10,7 @@ History 1.1 (2014-03-25) Fixed the MacRoman CMAP table. Added Danish characters. 1.2 (2016-10-18) Fixed glyph order. Removed Numpy dependency. 1.3 (2020-05-16) Ported to Python 3. +1.4 (2020-09-05) Fixed PostScript font naming. Requirements ------------ @@ -22,7 +23,7 @@ usage: c64ttf.py [-h] [-l LOWERCASE] [-u UPPERCASE] [-o OUTPUT] [-x] [-m] [-i] [-p PIXELSIZE] [-d DESCENT] [-a] [-n NAME] [-y COPYRIGHTYEAR] [-c CREATOR] [-v VERSION] -c64ttf.py v1.3 - C64 Character Set to TrueType Converter (c) 2013-20 atbrask +c64ttf.py v1.4 - C64 Character Set to TrueType Converter (c) 2013-20 atbrask optional arguments: -h, --help show this help message and exit diff --git a/c64ttf.py b/c64ttf.py index c05da22..32a5d48 100755 --- a/c64ttf.py +++ b/c64ttf.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 """ C64 Character Set to TrueType Converter -Version 1.3 +Version 1.4 Copyright (c) 2013-2020, A.T.Brask (atbrask[at]gmail[dot]com) All rights reserved. @@ -902,7 +902,7 @@ def makeTable_name(ttf, fontName, subFamily, copyrightYear, creator, version): fullName = "{0} {1}".format(fontName, subFamily) uniqueID = "{0} {1}".format(creator, fullName) versionText = "Version {0}".format(version) - psFontName = "{0}-{1}".format("".join([b for b in fontName if 32 < ord(b) < 127]), creator) + psFontName = "".join([b for b in "{0}-{1}".format(fontName, creator) if 32 < ord(b) < 127 and b not in '[](){}<>/%'])[:63] nameEntries = [copyright, fontName, subFamily, uniqueID, fullName, versionText, psFontName] unicodeEnc = [0, 3, 0, "utf_16_be"] @@ -1022,7 +1022,7 @@ def processCharFiles(lowercaseInputFileName, uppercaseInputFileName, outputFileN # "static void main()" if __name__ == "__main__": - parser = argparse.ArgumentParser(description="c64ttf.py v1.3 - C64 Character Set to TrueType Converter (c) 2013-20 atbrask") + parser = argparse.ArgumentParser(description="c64ttf.py v1.4 - C64 Character Set to TrueType Converter (c) 2013-20 atbrask") # Files parser.add_argument("-l", "--lowercase", help="Input 64C file with lowercase and uppercase characters.")