-
Hi. I love pygbag. I have some difficulty making dynamic text in paragraph look good. When displaying short things like Symbol, Atomic Number, mass and so on, all is ok. But when I try to render longer things, like paragraphs, the text does become cluttered and somewhat unreadable. I realize this has something to do with the browser resolution of the resulting pygame screen surface, and that this surface does not match the pygame local screen size resolution of 1280x720. Is there any suggestions as for how to handle this? Like using freefonts, SysFont, Font and so on? The repository i at https://github.com/larstuff/periodic/ And the online app can be viewed at Hope someone has an answer. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
My suggestion is to use pygame.font.font("somefont.otf") [or ttf] in combinations with wordwrap and a list of sentences for the whole text, and to render each sentence as an image, than blitting these to the display surface, in a suitable distance from eachother, vertically. You could accoplish that by finding the height of a word containing both the "t" and the "y" characters, and use that as the sentence-distance. |
Beta Was this translation helpful? Give feedback.
My suggestion is to use pygame.font.font("somefont.otf") [or ttf] in combinations with wordwrap and a list of sentences for the whole text, and to render each sentence as an image, than blitting these to the display surface, in a suitable distance from eachother, vertically. You could accoplish that by finding the height of a word containing both the "t" and the "y" characters, and use that as the sentence-distance.