-
Notifications
You must be signed in to change notification settings - Fork 5
Tests rely on Helvetica #10
Comments
>>> f = teek.Font(('10x20', 12, ''))
>>> f.family # seems to be a fallback
'DejaVu Sans'
>>> f = teek.Font(('asdasjfioajsf', 12, ''))
>>> f.family
'DejaVu Sans'
>>> A better solution might be to pick a font family from the teek.Font.families list: >>> teek.Font.families()
['Latin Modern Mono Slanted', 'MathJax_Caligraphic', ..., 'DejaVu Sans', ...] Something like |
@PurpleMyst, does >>> for family in teek.Font.families():
... font = teek.Font((family, 42, ''))
... assert font.family == family
... assert font.size == 42
...
>>> |
Is it a problem if Helvetica is not installed? If the given font family does not exist on the system, the most closely matching native font is selected by tk. Besides, it would be a better solution to use @Akuli if the font is not installed on the system, it is not in the list obtained by |
The problem is that when Tk selects the most closely matching font, it may differ from the font passed to
(*) Edit: This is because teek's |
this is now fixed in #11 |
Most of the tests in
tests/test_font.py
rely on the fontHelvetica
being present.This is not the case for all *nix installations, although admittedly it is the case for most Linux personal computers.
A fix for this is to utilize a program such as
xlsfonts
to figure out which fonts are installed and choose one with a correct min/max size bound.The text was updated successfully, but these errors were encountered: