-
Notifications
You must be signed in to change notification settings - Fork 51
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
Various fixes and improvements #101
Conversation
b18f2ce
to
fdf23e1
Compare
Hi @tomers, thanks so much for the excellent cleanup!!! I have a single request regarding your changes. I don't like adding the entire from dymoprint._vendor.matplotlib.font_manager import findSystemFonts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested this, but it all looks really great.
62d4300
to
9cc331c
Compare
Just wanted to extend the gratitude for this work you're putting into this code. Certainly I'm not qualified to do any of this. I wouldn't mind a limited selection of system fonts, it may become overwhelming if it's too many, and I assume that instant preview of fonts like in LibreOffice may be too much to ask for. |
Let's add it as-is, with all the fonts. I find the overwhelming amount to be preferrable over having missing a desired font. |
90de2f0
to
2ef587a
Compare
@maresb, @tomek-szczesny , can you please merge this now? |
I'm really excited about the live updating of the button when the device is ready or not. Feel free to limit scope on this PR, this is already quite a lot! I tried running it, but I'm getting the following error message, apparently due to inconsistency between Traceback (most recent call last):
File "~/dymoprint/src/dymoprint/q_dymo_label_widgets.py", line 145, in render_label
render = self.render_engine.render_text(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/dymoprint/src/dymoprint/dymo_print_engines.py", line 205, in render_text
font = ImageFont.truetype(font_file_name, font_size_px)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/dymoprint-dev/lib/python3.12/site-packages/PIL/ImageFont.py", line 797, in truetype
return freetype(font)
^^^^^^^^^^^^^^
File "~/dymoprint-dev/lib/python3.12/site-packages/PIL/ImageFont.py", line 794, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/dymoprint-dev/lib/python3.12/site-packages/PIL/ImageFont.py", line 226, in __init__
self.font = core.getfont(
^^^^^^^^^^^^^
TypeError: argument 1 must be str, bytes or bytearray, not PosixPath In order to get this traceback I had to modify
err → traceback.format_exc() . (Also import traceback goes up top.) There are three other instances in this file which should probably be updated accordingly.
|
We could already start merging this in pieces. If I merge the vendoring stuff, then if you rebase it'll trim down quite a bit on the massive number of files modified. |
According to appdirs' website [1], it is a depracated library. [1] https://github.com/ActiveState/appdirs?tab=readme-ov-file
Read all installed TTF fonts and add then
'list' is a reserved Python word, and should not be used for class members
This allows for easier developing in VSCode
This allows for easy execution of the GUI app, and reloading it just by closing it. It is useful when making changes in the code and a reload is needed.
This is sort of a workaround for an issue where in devcontainer the dependant packages are not known to the IDE. This is due to the fact that these packages were installed in postCreateCommand which installed it under /usr/local/py-utils/venvs/dymoprint/lib/python3.12.
This is an alternative to open the preview with Imagemagick
Allow to choose system font by its name. Add '--font' long command line option.
Hide the print button in case of bad status (no device, etc.). Show error label in case of any error. Poll status every 2 seconds.
Allow to choose system font by its name. Add '--font' long command line option.
Show backtrace in warning dialog
Thanks @maresb for this quick and useful feedback. I've fixed all the issues you've reported. |
Looks like you got it @tomers, it's running for me! And I see loads of fonts. I'm on the train at the moment, so I can't test printing myself. @tomek-szczesny, is this something you could try out? If it works for you too, then I'll cut a release. |
@tomers, would you be willing to write the release notes for this? |
@maresb where can I write the release notes? I didn't notice any RELEASES file |
Release notes:
|
I'm sorry I can't do any testing in next 48h either :( |
Perfect @tomers , there is no file in the repo, but I will paste that into the GitHub release notes |
Let's merge for now but delay the release until someone else tests with a device. |
Give some love to this nice tool. I would like to do some changes in it, so I go over the code first, and fix what I think should be fixed. I would be grateful in the maintainer of this tool would accept these changes.