Repository navigation
Allow Display.text_pixels() to receive a loaded font or a font string. - #601
Conversation
This will allow the users to preload a font and eliminate the constant reloading of fonts, which can produce lag when displaying in a loop.
WasabiFan
left a comment
There was a problem hiding this comment.
Thanks! This looks pretty good to me.
The documentation generator (Sphinx) is unhappy about list formatting:
/home/travis/build/ev3dev/ev3dev-lang-python/ev3dev2/display.py:docstring of ev3dev2.display.Display.text_pixels:14:Definition list ends without a blank line; unexpected unindent.
| 'font' : can be any font displayed here | ||
| http://ev3dev-lang.readthedocs.io/projects/python-ev3dev/en/ev3dev-stretch/other.html#bitmap-fonts | ||
| - If font is a string, it is the name of a font to be loaded. | ||
| - If font is a Font object, returned from fonts.load(), then it is |
There was a problem hiding this comment.
Can you make this a docs link? Something like this, I think:
:meth:`ev3dev2.fonts.load`
There was a problem hiding this comment.
I added this reference link, and fixed the links to fonts, since they are not longer in the other.html, but in display.html.
|
Now passes the sphinx-build. The problem was with the list in the docstring not having a blank line after it. |
|
This will be available in the next release. How would you like to appear in the changelog? (name or username?) |
|
Name: [Curtis Larsen] |
This will allow the users to preload a font and eliminate the constant
reloading of fonts, which can produce lag when displaying in a loop.
Maintainer edit: Fixes #600