Home | History | Annotate | Download | only in fontTools

Lines Matching refs:lst

45 def equal(lst):
46 lst = list(lst)
47 t = iter(lst)
49 assert all(item == first for item in t), "Expected all items to be equal: %s" % lst
52 def first(lst):
53 return next(iter(lst))
55 def recalculate(lst):
58 def current_time(lst):
61 def bitwise_and(lst):
62 return reduce(operator.and_, lst)
64 def bitwise_or(lst):
65 return reduce(operator.or_, lst)
67 def avg_int(lst):
68 lst = list(lst)
69 return sum(lst) // len(lst)
77 def wrapper(lst):
78 items = [item for item in lst if item is not NotImplemented]
83 def sumLists(lst):
85 for item in lst:
89 def sumDicts(lst):
91 for item in lst:
95 def mergeObjects(lst):
96 lst = [item for item in lst if item is not NotImplemented]
97 if not lst:
99 lst = [item for item in lst if item is not None]
100 if not lst:
103 clazz = lst[0].__class__
104 assert all(type(item) == clazz for item in lst), lst
110 allKeys = set.union(set(), *(vars(table).keys() for table in lst))
122 value = mergeLogic(getattr(table, key, NotImplemented) for table in lst)
132 def wrapper(lst):
133 lst = list(lst)
144 mergedValue = mergeLogic(bool(item & shiftedBit) for item in lst)
195 'checkSumAdjustment': lambda lst: 0, # We need *something* here
207 'fontDirectionHint': lambda lst: 2,
256 def mergeOs2FsType(lst):
257 lst = list(lst)
258 if all(item == 0 for item in lst):
262 for i in range(len(lst)):
264 if lst[i] & 0x000C:
265 lst[i] &= ~0x0002
267 elif lst[i] & 0x0008:
268 lst[i] |= 0x0004
270 elif lst[i] == 0:
271 lst[i] = 0x000C
273 fsType = mergeBits(os2FsTypeMergeBitMap)(lst)
325 'maxMemType42': lambda lst: 0,
327 'maxMemType1': lambda lst: 0,
329 'extraNames': lambda lst: [],
367 ttLib.getTableClass('prep').mergeMap = lambda self, lst: first(lst)
368 ttLib.getTableClass('fpgm').mergeMap = lambda self, lst: first(lst)
369 ttLib.getTableClass('cvt ').mergeMap = lambda self, lst: first(lst)
370 ttLib.getTableClass('gasp').mergeMap = lambda self, lst: first(lst) # FIXME? Appears irreconcilable
470 def mergeLookupLists(lst):
472 return sumLists(lst)
474 def mergeFeatures(lst):
475 assert lst
478 self.LookupListIndex = mergeLookupLists([l.LookupListIndex for l in lst if l.LookupListIndex])
482 def mergeFeatureLists(lst):
484 for l in lst:
498 def mergeLangSyses(lst):
499 assert lst
502 assert all(l.ReqFeatureIndex == 0xFFFF for l in lst)
507 self.FeatureIndex = mergeFeatureLists([l.FeatureIndex for l in lst if l.FeatureIndex])
511 def mergeScripts(lst):
512 assert lst
514 if len(lst) == 1:
515 return lst[0]
517 for sr in lst:
532 dfltLangSyses = [s.DefaultLangSys for s in lst if s.DefaultLangSys]
539 def mergeScriptRecords(lst):
541 for l in lst:
556 'ScriptCount': lambda lst: None, # TODO
560 'BaseScriptCount': lambda lst: None, # TODO
562 'BaseScriptRecord': lambda lst: sorted(sumLists(lst), key=lambda s: s.BaseScriptTag),
567 'FeatureRecord': lambda lst: sorted(sumLists(lst), key=lambda s: s.FeatureTag),
906 def __init__(self, lst):
907 self.l = lst
908 self.d = {id(v):i for i,v in enumerate(lst)}
919 def __init__(self, lst):
920 self.l = lst
921 self.s = set(id(v) for v in lst)