Open bersace opened 6 years ago
Thanks for reporting, I'll try to find some time for the Font Awesome 5 compatibility in the next few days to fix both this and #10 and do a release.
I don't understand why there is an
if bbox
as if bbox can be None, butborder_*
lines requiresbbox
to be defined. Can you give me a clue ? I can send you a patch.
Very good point : -) I'm afraid I don't know the answer the the top of my head, but it definitely looks sketchy.
I ran into this issue trying to use Font Awesome 5 as well. I fixed the BBox error but then ended up with blank images, which didn't help. Root problem seems to be because the font-awesome 5 CSS file includes all of the class names but the different TTF files don't contain all of the glyphs. To generate icons based solely on the icon name, I had to alter my script to try the regular TTF file and, if that returned an error, try the solid TTF file.
Hoping for a bump in case @pawelad has a secret branch ready to go, or if @dteirney wouldn't mind sharing his fix! Thanks, all!
Was this ever fixed? I'm getting an error even with a simple usecase:
icon-font-to-png --css ./css/all.css --ttf ./webfonts/fa-regular-400.ttf ALL
Exporting icon '500px' as '500px.png'(16x16 pixels)
Traceback (most recent call last):
File "/usr/local/bin/icon-font-to-png", line 16, in <module>
command_line.run(sys.argv[1:])
File "/usr/local/lib/python3.8/dist-packages/icon_font_to_png/command_line.py", line 160, in run
icon_font.export_icon(icon=icon, filename=filename, size=args.size,
File "/usr/local/lib/python3.8/dist-packages/icon_font_to_png/icon_font.py", line 155, in export_icon
border_w = int((size - (bbox[2] - bbox[0])) / 2)
TypeError: 'NoneType' object is not subscriptable
Hi,
Trying to workaround FontAwesome awkwardness, i hit a bug with bounding box management. Here is the output:
I don't understand why there is an
if bbox
as if bbox can be None, butborder_*
lines requiresbbox
to be defined. Can you give me a clue ? I can send you a patch.