From e4eb7486ec59398dbfe2628a8637ad895382fbdb Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 7 Jul 2018 10:26:03 +0300 Subject: [PATCH] Allow multiple character ranges in the makefont script --- scripts/makefont.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/makefont.py b/scripts/makefont.py index eb2c997a..24ae15a4 100755 --- a/scripts/makefont.py +++ b/scripts/makefont.py @@ -66,13 +66,13 @@ def convert_def(fn): return result -def make_font(fn, size, ch_range, autohinter, margin, padding, distfield): +def make_font(fn, size, ch_ranges, autohinter, margin, padding, distfield): import maketex import os cmd = "ttf2png \"%s\" -o makefont-tmp.png -d makefont-tmp.def -t -p -s %d -m %d -n %d -g"%(fn, size, margin, padding) - if ch_range: - cmd += " -r %d,%d"%ch_range + for r in ch_ranges: + cmd += " -r %d,%d"%r if autohinter: cmd += " -a" if distfield: @@ -102,7 +102,7 @@ if __name__=="__main__": parser.add_argument("-a", "--autohinter", action="store_const", const=True, default=False, help="Force autohinter") parser.add_argument("-m", "--margin", default=0, type=int, metavar="NUM", help="Margin around image edge in pixels") parser.add_argument("-n", "--padding", default=1, type=int, metavar="NUM", help="Padding between glyphs in pixels") - parser.add_argument("-r", "--range", type=parse_range, metavar="START,END", help="Range of code points to include") + parser.add_argument("-r", "--range", action="append", type=parse_range, metavar="START,END", help="Range of code points to include") parser.add_argument("-f", "--distfield", default=0, type=int, metavar="NUM", help="Produce a distance field texture") parser.add_argument("ttf", metavar="font.ttf", help="TrueType file to read") parser.add_argument("outfile", help="MspGL font file to write") -- 2.45.2