(codepoints :[int])
| 357 | |
| 358 | |
| 359 | def genCompactIntRanges(codepoints :[int]) -> [[int]]: |
| 360 | compact = [] |
| 361 | codepoints = sorted(codepoints) |
| 362 | for k, g in groupby(enumerate(codepoints), lambda t: t[0]-t[1]): |
| 363 | ilist = list(map(itemgetter(1), g)) |
| 364 | if len(ilist) > 1: |
| 365 | compact.append(range(ilist[0], ilist[-1]+1)) |
| 366 | else: |
| 367 | compact.append(ilist[0]) |
| 368 | return compact |
| 369 | |
| 370 | |
| 371 | def genCSS(fontinfo, subsets): |