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

Class BabelRunInfo

Lib/pagebot/contexts/basecontext/babelrun.py:185–202  ·  view source on GitHub ↗

BabelRunInfo is information decompiled from a native context text line. 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.

Source from the content-addressed store, hash-verified

183
184
185class BabelRunInfo:
186 """BabelRunInfo is information decompiled from a native context text line.
187 It resembles as close a possible to original source that generated the the
188 text line/run, but it will never be the same. E.g. any OT-feature glyph
189 replacement cannot be reconstructed to the original string."""
190
191 def __init__(self, s, style, context, cRun=None):
192 assert isinstance(s, str)
193 self.s = s # Reconstructed string, may not be input for e.g. OT-features
194 self.style = style # Reconstructed style of the run.
195 #print(style)
196 self.context = context # Just in case it is needed
197 # Optional native "context run"
198 # (e.g. DrawBot-->CTRun instance. Flat-->)
199 self.cRun = cRun
200
201 def __repr__(self):
202 return '<%s "%s">' % (self.__class__.__name__, self.s)

Callers 1

getTextLinesMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected