Closed dhauge closed 3 years ago
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
Are type declarations required for this project? I've gotten several build failures because types were missing or the type of a variable changes:
nion/ui/TestUI.py:38: error: Need type annotation for "font_width_by_char" (hint: "font_width_by_char: Dict[<type>, <type>] = ...")
Is the intent to have everything in the project strictly typed?
Is the intent to have everything in the project strictly typed?
The intent (for now) is to pass the mypy type checking, and there are still spots where type checking is missing. There is a more strict version of typing where everything is declared to have been typed. See this page if you're interested. I don't this this package is to that level yet.
TestFontMetrics
that implements aget_font_metrics
method that has configurable widths that can vary by charactercalculate_font_metric_info_for_tests
that can produce a python code snippet that constructs aTestFontMetrics
instance for a specified font, using the Qt librarymake_font_metrics_for_tests
that constructs aTestFontMetrics
instance for use by automated tests, using the code snippet returned bycalculate_font_metric_info_for_tests
called from a script console for font"normal 11px serif"
TestUI.UserInterface.get_font_metrics
to calculate font metrics using theTestFontMetrics
returned bymake_font_metrics_for_tests