Closed Rustymage closed 2 days ago
Basic debugging:
-e
causes me the problem. It runs fine if I exclude -e
.
Changing font = ImageFont.load_default(font_size)
to font = ImageFont.load_default()
results in huge text but no errors.
Using guidance from here - https://github.com/python-pillow/Pillow/issues/2695#issuecomment-1047065437
I commented out font = ImageFont.load_default(font_size)
from text.py
and added
font_path = os.path.join(cv2.__path__[0],'qt','fonts','Andale Mono.ttf')
font = ImageFont.truetype(font_path, font_size)
This meant I also needed to import cv2
This limits me to the Andale Mono.ttf
font but it works. I suspect there's a more elegant way to solve this but I ran out of time this AM - https://github.com/python-pillow/Pillow/issues/2695#issuecomment-1367094493
This is great, thanks for debugging and suggesting a fix! I ended up just using the font that ships with this app in the fonts dir.
Fix is up here: https://github.com/stevequinn/photoborder/commit/423f01dfb63fdfa651512f8740211acd3274a545.
If you have any other issues or ideas please feel free to keep posting :)
Thanks for fixing the elegant way 👍
I should note, for anyone who wants to change the font, find your .ttf
folder on your device, locate a font that you like and change FONTNAME
& BOLDFONTNAME
in text.py
- the font must have font type options, otherwise the text will be the same.
Fully appreciate and understand this is a personal script so you may not want or need to answer this. Hopefully, if I manage to resolve it, the answer may help others.
Running on:
Thanks.