Add font selector; load all fonts from fonts/ directory; bump to 0.85

All .ttf files in fonts/ are loaded at startup. The web form now has a
font selector dropdown. Glyph-rendering helpers that previously used
module-level font globals now accept a _FontData parameter threaded
through from generate_svg().

Dockerfile updated to copy all of fonts/ into the image rather than a
single hardcoded .ttf path.
This commit is contained in:
2026-07-14 23:51:55 +02:00
parent 8d45a6d10f
commit 62d9f02a82
11 changed files with 152 additions and 168 deletions
+12
View File
@@ -368,6 +368,16 @@
<input name="label_size" type="number" step="any" min="0.5" max="25" value="9" required>
</div>
</div>
<div class="row row-2" style="margin-top:1.25rem">
<div class="field">
<label>Font</label>
<select name="font" id="font-select" style="background:var(--white);border:1px solid var(--rule);border-radius:1px;padding:0.5rem 0.7rem;font-family:var(--f-body);font-size:0.875rem;color:var(--ink);width:100%;outline:none;cursor:pointer">
{% for f in fonts %}
<option value="{{ f.key }}"{% if f.key == default_font %} selected{% endif %}>{{ f.label }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
<div class="actions">
@@ -499,6 +509,8 @@
URL.revokeObjectURL(a.href);
});
document.getElementById('font-select').addEventListener('change', doGenerate);
doGenerate();
</script>
</body>