edit README.md and helpers
This commit is contained in:
parent
5669433251
commit
9227b09554
@ -13,8 +13,10 @@ Use `pip install -r requirements.txt` to install the requirements. The use of a
|
||||
|
||||
Execute `ezgg_badge_generator.py`.
|
||||
|
||||
|
||||
### Further
|
||||
The diagram shows the process of the script.
|
||||
The `helpers/font_converter.py` can be used to convert a font (.otf) to Base64 in case the font needs to be changed in the future.
|
||||
Just replace the base64 `src: url(data:font/ttf;base64,INSERT_BASE64_HERE) format('truetype');` string in `template/template_dynamic_name_size.svg`.
|
||||
|
||||
The diagram shows the process of the ezgg-badge-generator.
|
||||
|
||||

|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 7.5 KiB |
13
helpers/font_converter.py
Normal file
13
helpers/font_converter.py
Normal file
@ -0,0 +1,13 @@
|
||||
import base64
|
||||
|
||||
|
||||
def font_to_base64(path) -> str:
|
||||
with open(path, "rb") as f:
|
||||
encoded = base64.b64encode(f.read()).decode("utf-8")
|
||||
return encoded
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
font = font_to_base64("puffy.otf")
|
||||
with open("font_as_base.txt", "w") as file:
|
||||
file.write(font)
|
||||
Loading…
Reference in New Issue
Block a user