def event_occurred(self, event: Event): if isinstance(event, TextRenderEvent): assert isinstance(event, TextRenderEvent) self.measurands.append({ "text": event.get_text(), "x0": float(event.get_baseline().x0), "x1": float(event.get_baseline().x1), "y": float(event.get_baseline().y0), "length": float(event.get_baseline().length()), })
def event_occurred(self, event: Event) -> None: if isinstance(event, ParagraphRenderEvent): t = event.get_text() print(t)