MCPcopy Create free account
hub / github.com/PageBot/PageBot / getOverflow

Method getOverflow

Lib/pagebot/elements/text.py:447–466  ·  view source on GitHub ↗

Figures out what the overflow of the text is, with the given (w, h) or styled (self.w, self.h) of this text box. If h is None and self.h is None then by definintion overflow will allways be empty, as the box is elastic.

(self, w=None, h=None)

Source from the content-addressed store, hash-verified

445 return self.context.textSize(bs, w=self.w) # Context gets full BabelString bs
446
447 def getOverflow(self, w=None, h=None):
448 """Figures out what the overflow of the text is, with the given (w, h)
449 or styled (self.w, self.h) of this text box. If h is None and self.h is
450 None then by definintion overflow will allways be empty, as the box is
451 elastic."""
452 # In case height is undefined, box will always fit the content.
453 if self.h is None and h is None:
454 return ''
455
456 # Otherwise test if there is overflow of text in the given element
457 # size.
458 if w is None:
459 w = self.pw # Padded width
460
461 if h is None:
462 h = self.ph # Padded height
463
464 box = (0, 0, w, h)
465
466 return self.context.textOverflow(self.bs, box, LEFT)
467
468 def _findStyle(self, run):
469 """Answers the name and style that desctibes this run best. If there is

Callers 2

isOverflowMethod · 0.95
overflow2NextMethod · 0.95

Calls 1

textOverflowMethod · 0.45

Tested by

no test coverage detected