Add license and generator script

This commit is contained in:
Thomas Lovén 2018-11-14 23:27:30 +01:00
parent 33d7fa1ab2
commit 4bd4039bde
2 changed files with 54 additions and 0 deletions

34
LICENSE.txt Normal file
View File

@ -0,0 +1,34 @@
Font Awesome Free License
-------------------------
Font Awesome Free is free, open source, and GPL friendly. You can use it for
commercial projects, open source projects, or really almost whatever you want.
Full Font Awesome Free license: https://fontawesome.com/license/free.
# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)
In the Font Awesome Free download, the CC BY 4.0 license applies to all icons
packaged as SVG and JS file types.
# Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL)
In the Font Awesome Free download, the SIL OLF license applies to all icons
packaged as web and desktop font files.
# Code: MIT License (https://opensource.org/licenses/MIT)
In the Font Awesome Free download, the MIT license applies to all non-font and
non-icon files.
# Attribution
Attribution is required by MIT, SIL OLF, and CC BY licenses. Downloaded Font
Awesome Free files already contain embedded comments with sufficient
attribution, so you shouldn't need to do anything additional when using these
files normally.
We've kept attribution comments terse, so we ask that you do not actively work
to remove them from files, especially code. They're a great way for folks to
learn about Font Awesome.
# Brand Icons
All brand icons are trademarks of their respective owners. The use of these
trademarks does not indicate endorsement of the trademark holder by Font
Awesome, nor vice versa. **Please do not use brand logos for any purpose except
to represent the company, product, or service to which they refer.**

20
generate.py Normal file
View File

@ -0,0 +1,20 @@
import os
def make_file(directory, name, out):
out.write('<ha-iconset-svg name="{}" size="512"><svg><defs>\n'.format(name))
for f in os.listdir(directory):
with open(os.path.join(directory, f), 'r') as fp:
name = os.path.splitext(f)[0]
data = fp.read()
start = data.find('<path')
out.write('<g id="{}">'.format(name) + data[start:-6] + '</g>\n')
out.write('</defs></svg></ha-iconset-svg>')
# Run this in Font-Awesome/advanced-options/raw-svg/
# with open("hass-fontawesome-brands.html", 'w') as out:
# make_file('brands', 'fab', out)
# with open("hass-fontawesome-regular.html", 'w') as out:
# make_file('regular', 'far', out)
# with open("hass-fontawesome-solid.html", 'w') as out:
# make_file('solid', 'fas', out)