edit README.md and helpers

This commit is contained in:
tcprod 2026-04-06 17:29:28 +02:00
parent 5669433251
commit 9227b09554
3 changed files with 18 additions and 3 deletions

View File

@ -13,8 +13,10 @@ Use `pip install -r requirements.txt` to install the requirements. The use of a
Execute `ezgg_badge_generator.py`. Execute `ezgg_badge_generator.py`.
### Further ### 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.
![activity diagram](activity_diagram.svg) ![activity diagram](activity_diagram.svg)

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
View 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)