Skip to content

Allow Display.text_pixels() to receive a loaded font or a font string. - #601

Merged
WasabiFan merged 2 commits into
ev3dev:ev3dev-stretchfrom
fractal13:ev3dev-stretch
Mar 20, 2019
Merged

WasabiFan merged 2 commits into
ev3dev:ev3dev-stretchfrom
fractal13:ev3dev-stretch

Conversation

@fractal13

@fractal13 fractal13 commented Mar 20, 2019 •

Copy link
Copy Markdown
Contributor

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

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 WasabiFan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread ev3dev2/display.py Outdated
'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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this a docs link? Something like this, I think:

:meth:`ev3dev2.fonts.load`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this reference link, and fixed the links to fonts, since they are not longer in the other.html, but in display.html.

@fractal13

Copy link
Copy Markdown
Contributor Author

Now passes the sphinx-build. The problem was with the list in the docstring not having a blank line after it.

@WasabiFan WasabiFan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@WasabiFan
WasabiFan merged commit daad42a into ev3dev:ev3dev-stretch Mar 20, 2019
@WasabiFan

Copy link
Copy Markdown
Member

This will be available in the next release.

How would you like to appear in the changelog? (name or username?)

@fractal13

Copy link
Copy Markdown
Contributor Author

Name: [Curtis Larsen]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants