Difficult-Rocket/libs/pyglet/text/formats/plaintext.py

12 lines
264 B
Python
Raw Normal View History

2021-04-16 23:21:06 +08:00
"""Plain text decoder.
"""
import pyglet
class PlainTextDecoder(pyglet.text.DocumentDecoder):
def decode(self, text, location=None):
document = pyglet.text.document.UnformattedDocument()
document.insert_text(0, text)
return document