Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Change word wrapping render_text()?
-
Is there a way to change how render_text() decides to word wrap the text? I need for it to be not as wide.
-
Does this approach help? If not, please provide some sample code of what you are trying to do.
http://omz-forums.appspot.com/pythonista/post/4848897818099712
-
Hi ccc, The code below creates an image with text and adds it to the root_layer, but the text image always comes with the text wrapped to the width of the width of the screen in landscape orientation. I'm using TextLayer for convenience, but could use render_text() if necessary. What I'd like to be able to do is set the width of the text wrap and make it more narrow so it fits in a section of the display. Does that make sense?
longText = "This is an example of a long text string that needs to be word wrapped and displayed as a multiline body of text. This is an example of a long text string that needs to be word wrapped and displayed as a multiline body of text." self.root_layer = Layer(self.bounds) self.layer = TextLayer(longText,'Helvetica', 40) self.root_layer.add_layer(self.layer)