Warning: Unable to open font (...)
See original GitHub issueI cannot add label in Cyrillic, such as “Кухня”:
Traceback (most recent call last):
File "E:\HassWP\python-3.7.7\lib\site-packages\homeassistant\helpers\entity.py", line 279, in async_update_ha_state
await self.async_device_update()
File "E:\HassWP\python-3.7.7\lib\site-packages\homeassistant\helpers\entity.py", line 472, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "E:\HassWP\python-3.7.7\lib\concurrent\futures\thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "E:\HassWP\config\custom_components\xiaomi_cloud_map_extractor\camera.py", line 186, in update
self._image_config)
File "E:\HassWP\config\custom_components\xiaomi_cloud_map_extractor\xiaomi_cloud_connector.py", line 105, in get_map
map_data = MapDataParser.parse(unzipped, colors, drawables, texts, sizes, image_config)
File "E:\HassWP\config\custom_components\xiaomi_cloud_map_extractor\map_data_parser.py", line 76, in parse
MapDataParser.draw_elements(colors, drawables, texts, sizes, map_data)
File "E:\HassWP\config\custom_components\xiaomi_cloud_map_extractor\map_data_parser.py", line 237, in draw_elements
ImageHandler.draw_texts(map_data.image, texts)
File "E:\HassWP\config\custom_components\xiaomi_cloud_map_extractor\image_handler.py", line 171, in draw_texts
text_config[CONF_FONT], text_config[CONF_FONT_SIZE])
File "E:\HassWP\config\custom_components\xiaomi_cloud_map_extractor\image_handler.py", line 206, in __draw_text__
w, h = draw.textsize(text, font)
File "E:\HassWP\config\deps\Python37\site-packages\PIL\ImageDraw.py", line 430, in textsize
return font.getsize(text, direction, features, language, stroke_width)
File "E:\HassWP\config\deps\Python37\site-packages\PIL\ImageFont.py", line 128, in getsize
return self.font.getsize(text)
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-6: ordinal not in range(256)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:22 (8 by maintainers)
Top Results From Across the Web
[SOLVED] Unable To Import Fonts? Unable to open assets ...
All my fonts are in file types that should be accessible by Unity, so it couldn't be an error with the fonts themselves,...
Read more >Troubleshoot Font Book problems on Mac
If you try to open a version of the Font Book app that can't be used on your Mac, an alert message is...
Read more >PHP Could not find/open font
I am trying to write text over an image but i get the error : PHP Warning: imagettftext(): Could not find/open font in ......
Read more >Errors And Warnings When Installing Fonts On Mac
A font is built up by coordinates and the font validation fails because the font is programmed with too many coordinates. The font,...
Read more >Does not appear to be a valid font file (can not install font)
Open Fonts by clicking the Start menu, clicking Control Panel, clicking Appearance and Personalization, and then clicking Fonts. Then drag the ...
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
I will try to find a way to attach a font file
Using TTF stored in a config is much better, as it doesn’t require manual changes after every HA update. I will check if it is possible