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:
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")