Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with new Pyface Font class and Trait #896

Closed
corranwebster opened this issue Mar 4, 2022 · 1 comment · Fixed by #929
Closed

Integration with new Pyface Font class and Trait #896

corranwebster opened this issue Mar 4, 2022 · 1 comment · Fixed by #929

Comments

@corranwebster
Copy link
Contributor

At a minimum it would be nice to be able to specify fonts with Pyface Fonts - ideally we might be able to replace the Kiva fonts with Pyface fonts - this needs exploration.

@corranwebster
Copy link
Contributor Author

Some thoughts on this goal:

  • there is a fairly close mapping of the Pyface Font class to a kiva.fonttools FontQuery (there is a difference in the way that stretch is defined, and it is intrinsic because font query values are scores, but font values are size percentages)
  • the Kiva Font class doesn't have the same expressiveness, so conversions from Pyface Font -> Kiva Font -> FontQuery loses information which could be used.
  • we could replace Kiva Font with Pyface Font but that then means that you need Pyface, so that's a non-starter
  • we could make the FontManager Pyface Font aware, but there are toolkits which don't use the FontManager (and many of them are limited in how they express font information)

So options are:

  • make Kiva Font as expressive as Pyface Font (or close to) and add utilities for conversion.
  • have Kiva backends accept Pyface Font objects as well and provide utilities to help interpret them.
  • create an ABC or interface for font-like things and a system of adapters (care needed here, since Kiva also doesn't use Traits in its core).
  • lean in to Kiva depending on Traits/Pyface (just ensure everything works with the null toolkit)

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 a pull request may close this issue.

1 participant