MCPcopy Index your code
hub / github.com/rsms/inter / genCompactIntRanges

Function genCompactIntRanges

misc/tools/subset.py:359–368  ·  view source on GitHub ↗
(codepoints :[int])

Source from the content-addressed store, hash-verified

357
358
359def 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
371def genCSS(fontinfo, subsets):

Callers 2

mainFunction · 0.85
genCSSFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…