def event_occurred(self, event: Event): if isinstance(event, ChunkOfTextRenderEvent): assert isinstance(event, ChunkOfTextRenderEvent) self.measurands.append( { "text": event.text, "x0": float(event.get_bounding_box().x), "x1": float( event.get_bounding_box().x + event.get_bounding_box().width ), "y": float(event.get_baseline().y), "length": float(event.get_baseline().width), } )
def event_occurred(self, event: Event) -> None: if isinstance(event, ChunkOfTextRenderEvent): assert isinstance(event, ChunkOfTextRenderEvent) bb: typing.Optional[Rectangle] = event.get_bounding_box() if bb is not None: self._mark_as_unavailable(bb)