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

Fonts for OSD not found (Pi) #628

Closed
Prutsium opened this issue Nov 21, 2020 · 7 comments
Closed

Fonts for OSD not found (Pi) #628

Prutsium opened this issue Nov 21, 2020 · 7 comments

Comments

@Prutsium
Copy link

Octoprint version: 1.4.2
Octopi version: 0.18
Octolapse version: v0.4.1+u.88aa71f
Python version: 3.7.3

I made recently a fresh install of OctoPi and noticed some issues with fonts as Octolapse dont see any fonts anymore.
Font-Config is installed and fc-list give this result:
pi@octopi:/ $ fc-list
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book

The log of Octolapse reports an error for a font but i cant select or deselect any font:
2020-11-21 15:33:28,677 - octolapse.render - ERROR - An error occurred while opening the selected font
Traceback (most recent call last):
File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_octolapse/render.py", line 115, in preview_overlay
font = ImageFont.truetype(rendering_profile.overlay_font_path, size=50)
File "/home/pi/oprint/lib/python3.7/site-packages/PIL/ImageFont.py", line 836, in truetype
return freetype(font)
File "/home/pi/oprint/lib/python3.7/site-packages/PIL/ImageFont.py", line 833, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/home/pi/oprint/lib/python3.7/site-packages/PIL/ImageFont.py", line 194, in init
font, size, index, encoding, layout_engine=layout_engine
OSError: cannot open resource
2020-11-21 15:33:55,868 - octolapse.render - ERROR - An error occurred while opening the selected font
Traceback (most recent call last):
File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_octolapse/render.py", line 115, in preview_overlay
font = ImageFont.truetype(rendering_profile.overlay_font_path, size=50)
File "/home/pi/oprint/lib/python3.7/site-packages/PIL/ImageFont.py", line 836, in truetype
return freetype(font)
File "/home/pi/oprint/lib/python3.7/site-packages/PIL/ImageFont.py", line 833, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/home/pi/oprint/lib/python3.7/site-packages/PIL/ImageFont.py", line 194, in init
font, size, index, encoding, layout_engine=layout_engine
OSError: cannot open resource
2020-11-21 15:34:17,048 - octolapse.render - ERROR - An error occurred while opening the selected font
Traceback (most recent call last):
File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_octolapse/render.py", line 115, in preview_overlay
font = ImageFont.truetype(rendering_profile.overlay_font_path, size=50)
File "/home/pi/oprint/lib/python3.7/site-packages/PIL/ImageFont.py", line 836, in truetype
return freetype(font)
File "/home/pi/oprint/lib/python3.7/site-packages/PIL/ImageFont.py", line 833, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/home/pi/oprint/lib/python3.7/site-packages/PIL/ImageFont.py", line 194, in init
font, size, index, encoding, layout_engine=layout_engine
OSError: cannot open resource
2020-11-21 15:55:42,957 - octolapse.render - ERROR - An error occurred while opening the selected font
Traceback (most recent call last):
File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_octolapse/render.py", line 115, in preview_overlay
font = ImageFont.truetype(rendering_profile.overlay_font_path, size=50)
File "/home/pi/oprint/lib/python3.7/site-packages/PIL/ImageFont.py", line 836, in truetype
return freetype(font)
File "/home/pi/oprint/lib/python3.7/site-packages/PIL/ImageFont.py", line 833, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/home/pi/oprint/lib/python3.7/site-packages/PIL/ImageFont.py", line 194, in init
font, size, index, encoding, layout_engine=layout_engine
OSError: cannot open resource

How could i fix this?

@FormerLurker
Copy link
Owner

Try installing from this URL in the plugin manager: https://github.com/FormerLurker/Octolapse/archive/devel.zip

Also, what version of python are you running? I need to test this in both versions (2.7 and 3+)

@Prutsium
Copy link
Author

As usual printer is running now but will do when it finishes.

Python version: 3.7.3

@FormerLurker
Copy link
Owner

Sounds good. And use this url instead: https://github.com/FormerLurker/Octolapse/archive/5a4b744dbf6105d426c35eb449076c9c101e9dc2.zip

It's safer since I may be pushing more to devel.

@Prutsium
Copy link
Author

Yeah seems to fix it :)
image

Thanks for the quick reaction and solution.

@FormerLurker
Copy link
Owner

Awesome! If you have a python 2.7 instance, I'd love to see if it works there too. I will eventually get around to it :)

@Prutsium
Copy link
Author

Pitty enough my both systems are Python 3 already :)

@FormerLurker
Copy link
Owner

Tested in python 2.7, and is working! Closed :)

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

No branches or pull requests

2 participants