BabelLineInfo is information decompiled from a native context text line run. It resembles as close a possible to original source that generated the the text line/run, but it will never be the same. E.g. any OT-feature glyph replacement cannot be reconstructed to the original string.
| 163 | return fsStyle, hyphenation |
| 164 | |
| 165 | class BabelLineInfo: |
| 166 | """BabelLineInfo is information decompiled from a native context text line |
| 167 | run. It resembles as close a possible to original source that generated |
| 168 | the the text line/run, but it will never be the same. E.g. any OT-feature |
| 169 | glyph replacement cannot be reconstructed to the original string.""" |
| 170 | |
| 171 | def __init__(self, x, y, context, cLine=None): |
| 172 | """Container for line info, after text wrapping by context.""" |
| 173 | self.x = units(x) |
| 174 | self.y = units(y) |
| 175 | self.runs = [] # List of BabelRunInfo instances. |
| 176 | self.context = context # Just in case it is needed. |
| 177 | # Optional native "context line" (e.g. DrawBot-->CTLine instance. |
| 178 | # Flat-->the result of placedText.layout.runs() looping). |
| 179 | self.cLine = cLine |
| 180 | |
| 181 | def __repr__(self): |
| 182 | return '<%s y=%s>' % (self.__class__.__name__, self.y) |
| 183 | |
| 184 | |
| 185 | class BabelRunInfo: |