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

Uniform Font Size Across Various Display Types #80

Open
capn-freako opened this issue Feb 26, 2020 · 4 comments
Open

Uniform Font Size Across Various Display Types #80

capn-freako opened this issue Feb 26, 2020 · 4 comments
Assignees

Comments

@capn-freako
Copy link
Owner

capn-freako commented Feb 26, 2020

Describe the desired new or improved feature.
The plot text is very small, on a 4K laptop monitor.
Can the text size of PyBERT labels be regularized across display types somehow?

Expected behavior
Text size appears the same, no matter the display resolution.

Screenshots
(n/a)

Desktop (please complete the following information):

  • OS: Windows 10
  • Python Version 3.7.6
  • PyBERT Version 3.3.2

Additional context
Original Issue on Chaco GitHub site

@capn-freako
Copy link
Owner Author

I've experimented with explicitly specifying the ETS toolkit with varying degrees of success:

from traits.etsconfig.api import ETSConfig
# ETSConfig.toolkit = 'qt.celiagg'  # Yields unacceptably small font sizes in plot axis labels.
# ETSConfig.toolkit = 'qt.qpainter'  # Was causing crash on Mac.

@capn-freako
Copy link
Owner Author

@capn-freako
Copy link
Owner Author

capn-freako commented Oct 3, 2022

Here is some documentation on setting the ETS toolkit:
https://docs.enthought.com/pyface/toolkits.html

It offers this suggestion:

by setting the environment variable ETS_TOOLKIT to the name of the desired toolkit.

So, I tried that:

(pybert-dev)
capnf@DESKTOP-G84ND7C MINGW64 ~/Documents/GitHub/PyBERT (master)
$ echo $ETS_TOOLKIT
qt5

==> See this comment by Corran Webster, re: the use of "qt5".

But, it yields this error:

(pybert-dev)
capnf@DESKTOP-G84ND7C MINGW64 ~/Documents/GitHub/PyBERT (master)
$ python -m pybert &
[1] 3980
(pybert-dev)
capnf@DESKTOP-G84ND7C MINGW64 ~/Documents/GitHub/PyBERT (master)
$ Traceback (most recent call last):
  File "C:\Users\capnf\anaconda3\envs\pybert-dev\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\capnf\anaconda3\envs\pybert-dev\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\capnf\Documents\GitHub\PyBERT\pybert\__main__.py", line 2, in <module>
    from pybert.pybert      import PyBERT
  File "C:\Users\capnf\Documents\GitHub\PyBERT\pybert\pybert.py", line 29, in <module>
    from chaco.api import ArrayPlotData, GridPlotContainer
  File "C:\Users\capnf\anaconda3\envs\pybert-dev\lib\site-packages\chaco\api.py", line 314, in <module>
    from .plots.horizon_plot import BandedMapper
  File "C:\Users\capnf\anaconda3\envs\pybert-dev\lib\site-packages\chaco\plots\horizon_plot.py", line 14, in <module>
    from enable.api import transparent_color_trait
  File "C:\Users\capnf\anaconda3\envs\pybert-dev\lib\site-packages\enable\api.py", line 184, in <module>
    from .base import (
  File "C:\Users\capnf\anaconda3\envs\pybert-dev\lib\site-packages\enable\base.py", line 41, in <module>
    from .colors import color_table, transparent_color
  File "C:\Users\capnf\anaconda3\envs\pybert-dev\lib\site-packages\enable\colors.py", line 287, in <module>
    from traitsui.qt4.color_editor import (
  File "C:\Users\capnf\anaconda3\envs\pybert-dev\Lib\site-packages\shiboken2\files.dir\shibokensupport\feature.py", line 139, in _import
    return original_import(name, *args, **kwargs)
  File "C:\Users\capnf\anaconda3\envs\pybert-dev\lib\site-packages\traitsui\qt4\__init__.py", line 35, in <module>
    from . import toolkit
  File "C:\Users\capnf\anaconda3\envs\pybert-dev\Lib\site-packages\shiboken2\files.dir\shibokensupport\feature.py", line 139, in _import
    return original_import(name, *args, **kwargs)
  File "C:\Users\capnf\anaconda3\envs\pybert-dev\lib\site-packages\traitsui\qt4\toolkit.py", line 31, in <module>
    assert_toolkit_import(["qt4", "qt"])
  File "C:\Users\capnf\anaconda3\envs\pybert-dev\lib\site-packages\traitsui\toolkit.py", line 39, in assert_toolkit_import
    raise RuntimeError(
RuntimeError: Importing from qt4 backend after selecting qt5 backend!

It looks like the enable package might be enforcing usage of Qt4!
I do build a custom version of enable.
Maybe, I need to rebuild it to use Qt5?

==> Nope. See this comment by Corran Webster.

@capn-freako
Copy link
Owner Author

Here's another page on explicitly defining the toolkit, this one from Enable's perspective:
https://docs.enthought.com/enable/enable/toolkit_selection.html

It offers this handy tip:

If you wish to test toolkit/backend combinations without the need for code modifications, you can set the ETS_TOOLKIT environment variable before running your application. ETSConfig will use the value of that environment variable to initialize its toolkit and kiva_backend properties. Here’s what that looks like:

$ export ETS_TOOLKIT=qt.qpainter
$ python kiva/examples/kiva/kiva_explorer.py

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

No branches or pull requests

1 participant