Change icon size to multiple of 48px (960px)

closes #58
This commit is contained in:
Florian Gauger
2024-04-20 15:52:24 +02:00
parent e8f7c4669b
commit 23c2c71732
3 changed files with 8 additions and 8 deletions
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -3,10 +3,10 @@ import icons from './generated/icons.js';
const c = {
canvas: undefined,
ctx: undefined,
canvasSize: 1024,
canvasSize: 960,
};
const heart_icon = icons.find(icon => {
const heart_icon = icons.find((icon) => {
return icon.id === 'heart' && icon.st === 'fas';
});
+5 -5
View File
@@ -12,12 +12,12 @@ def get_font(fonts, style):
if style in fonts.keys():
return fonts[style]
else:
print("Warning: style {0} unkown.".format(style))
print(f"Warning: style {style} unkown.")
def get_max_size(font, icon):
font_size = 1200
max_size = 1024
max_size = 960
width = max_size + 1
height = max_size + 1
@@ -42,7 +42,7 @@ def get_max_size(font, icon):
def load_icons(repo_url, output_path, allow_brands):
with tempfile.TemporaryDirectory(delete=False) as repo_dir:
print(repo_dir)
print(f"writing to: {repo_dir}")
Repo.clone_from(repo_url, repo_dir)
fonts = {
"brands": {"path": repo_dir + "/webfonts/fa-brands-400.woff2", "style": "fab"},
@@ -77,9 +77,9 @@ def load_icons(repo_url, output_path, allow_brands):
result_icon["se"] = search_terms
result.append(result_icon)
idx += 1
print("{0}/{1} icons processed.".format(i + 1, len(icons_json)), end="\r")
print(f"{i + 1}/{len(icons_json)} icons processed.", end="\r")
print("{0}/{1} icons processed.".format(len(icons_json), len(icons_json)))
print(f"{len(icons_json)}/{len(icons_json)}")
js_icons = "export default " + json.dumps(result, separators=(",", ":"))
with open(output_path, "w") as f: