[subset] Accept unicode ranges
Eg --unicodes=41-5a,61-7a to choose ASCII letters. Note that with this, --unicodes-file accepts fontconfig .orth files that do not include other files.
This commit is contained in:
parent
702729a076
commit
bdaa75f9e7
@ -2428,7 +2428,15 @@ def parse_unicodes(s):
|
||||
import re
|
||||
s = re.sub (r"0[xX]", " ", s)
|
||||
s = re.sub (r"[<+>,;&#\\xXuU\n ]", " ", s)
|
||||
return [int (x, 16) for x in s.split (' ') if len (x)]
|
||||
l = []
|
||||
for item in s.split():
|
||||
fields = item.split('-')
|
||||
if len(fields) == 1:
|
||||
l.append(int(item, 16))
|
||||
else:
|
||||
start,end = fields
|
||||
l.extend(range(int(start, 16), int(end, 16)+1))
|
||||
return l
|
||||
|
||||
def main(args):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user