Closed tyalie closed 2 years ago
Hm, great idea, but I think we should use different entry .py files. Or perhaps we can generate two binaries anyway using pyinstaller/py2exe/py2app. It would also be nice if the CLI could run entirely without QT, but I guess that won't be possible unless the image processing is moved to PIL.
hmh. I like that the CLI is wrapped in the same bianry. It's not uncommon for GUI applications (see firefox, inkscape, gimp, ...)
Regarding the installer scripts: I haven't really looked into the installer scripts at all yet. I feel like that right now they will not work under Linux 😅
I also thought about whether the CLI could run completely without Qt but I feel like that one would loose a lot of shared code base and possibly diverging behaviour in rendering. Moving everything to Pillow is possible, but it feels a bit hmh. Especially in regards to fonts Qt is presumably far more advanced. The current solution is a bit hacky on some parts I admit thoo.
It's not uncommon for GUI applications (see firefox, inkscape, gimp, ...)
Yeah, but all of them open the GUI when started without args. That would be fine as well.
Especially in regards to fonts Qt is presumably far more advanced. The current solution is a bit hacky on some parts I admit thoo.
Indeed, it's always been a bit of a hack and only worked on enough to be able to print what I needed at the moment. I even started rewriting the application for the web: https://dev.p1k.se/pytouch-cube/
Yeah, but all of them open the GUI when started without args. That would be fine as well.
That the application starts without GUI parameter given should already be implemented ^^
You can explicitly specify the gui mode if you wanna send arguments to it (e.g. seeding). but if you leave it blank it works exactly as before.
Indeed, it's always been a bit of a hack
Tbqh I actually like your code. It doesn't feel hacky on many parts. Especially the rendering I honestly quite like. I think what I really do like about Qt here is that they can work with fonts extremely well. In the CLI you cannot align the font, but with some calculations in the background it is now so that a normal upper case letter is centered on the label. I don't know how hard that would have been with other tools. 😮💨
That the application starts without GUI parameter given should already be implemented ^^
Yeah, I just noticed that in the description. I'll take a closer look at this tomorrow.
Thoughts for expansion upon this PR later:
@t,r,b,l
etc.Uh the seed command is a nice idea. But yeah it would require a fully featured CLI. I personally thought rather about maybe being able to add variables to the stored project file in the GUI and be able to replace those in the CLI later on.
The "automatic" font size should be selectable in the GUI as well, and probably be the default.
Yeah that would probably be nice tbqh.
The thing here is thoo that it should be implemented during the rendering of the fonts themselves. Some fonts like Comic Code have a bit weird Ascend and Descent values resulting in a smaller than necessary automatic font sizing. When I was trying to adapt the calculation I noticed sometimes the lower part of the font was cut away as the ascent was large enough to push everything to far down at a sensible font size.
To be clear, I only meant the -t Hello -i image.png:34 -t world
arguments. They would still need to support more stuff, like setting font and font-size (optionally), but I don't think that would be too difficult to add. I might take a stab at it if you don't oppose the idea.
No I like it. I initially decided to not implement them (yet) as it would have required to write custom types for argparse, but along the way I implemented the FILENAME:THRESHOLD syntax and did exactly that 🙈
Integrated a fully fledged CLI that will not start the GUI. One can configure special parameters like chained printing with it. Either print a previously generated p3label project file or completely design your own label (with a few limitations)
Starting GUI can be done by either
pytouch3 gui
or just normalpytouch3
Limitations to designing own file: