Font rendering scripts fail to execute.
See original GitHub issueThe scripts which use fonts from the “fonts” folder included in examples, fail to execute. It raises IOError - unknown file format.
Display: pcd8544
Interface: spi
Dimensions: 128 x 64
----------------------------------------
Traceback (most recent call last):
File "welcome.py", line 233, in <module>
main()
File "welcome.py", line 198, in main
fonts = [make_font("code2000.ttf", sz) for sz in range(24, 8, -2)]
File "welcome.py", line 121, in make_font
return ImageFont.truetype(font_path, size)
File "/usr/local/lib/python2.7/dist-packages/PIL/ImageFont.py", line 238, in truetype
return FreeTypeFont(font, size, index, encoding)
File "/usr/local/lib/python2.7/dist-packages/PIL/ImageFont.py", line 127, in __init__
self.font = core.getfont(font, size, index, encoding)
IOError: unknown file format
It seems, imagefont is unable to load fonts from anywhere else except the default folders, i.e - “/usr/share/fonts/truetype/freefont/” After copying the individual fonts to the above mentioned folder, the script works flawlessly, also the provided “code2000.ttf” font is corrupt, I downloaded a fresh copy of the “code2000.ttf” from internet , after copying to the default folder , it works.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Font rendering fails when code runs under IIS 7.0 - Super User
When the code from the ASP page is run as a VBScript file under an Administrator account the rendering does use the correct...
Read more >The external text renderer plugin failed to render the text string ...
Hi, I'm running Psychtoolbox on Matlab2018b on a Windows machine. When trying to print text to the screen using either DrawText or ...
Read more >messed up indic script rendering in browsers, Any better ...
I tried to willfuly mess up hindi rendering in fedora but failed, i changed every font i can, in fedora but still the...
Read more >Script crashing every other time I initialize it when trying to ...
When I run the script, it either works, or the window just stays black for a few seconds and exits. No error message,...
Read more >Render font error example( text - Designer - Alteryx Community
Changing fonts and scripts in report text tools did not succeed. Can you upload a successful file? ※ According to the survey, arial...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks a lot!, it works after getting the fresh repository. I downloaded the zip file instead of cloning this time(seems like some connection problem or git problem) , and everything works correctly. Also I had to install the pygame through apt-get :
$ sudo apt-get install python-pygame
Installing through the default installer script generates error, “sdl-config” not found.Also in pcd8544.conf the default SPI speed is 32Mhz , but with this setting the display remains blank , it works upto a max of 8Mhz.
Hmm… Ubuntu 16.04, latest git master for examples: