| 19 | """Class to store cached information in BabelString._cs.""" |
| 20 | |
| 21 | def __init__(self, builder, doc, page, paragraphs, runs): |
| 22 | self.builder = builder |
| 23 | self.doc = doc # Flat.document instance |
| 24 | self.page = page # Flat.page instance |
| 25 | self.paragraphs = paragraphs |
| 26 | self.txt = builder.text(paragraphs) |
| 27 | self.pt = page.place(self.txt) # Flat.placedText instance |
| 28 | self.runs = runs # List of FlatRunData instances |
| 29 | def __repr__(self): |
| 30 | spans = [span.string for p in self.paragraphs for span in p.spans] |
| 31 | # Show plain string accumulate string, compatible to DrawBotFormattedString |