summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-01 10:42:56 +0300
committerPaul Buetow <paul@buetow.org>2026-05-01 10:42:56 +0300
commit999f4198cb97778bd0d52fd0106481c4fb9e525c (patch)
treecb15b5dcb0379eb7f85b7934da1ff427716cdc03
parent36d1f8e17bc1146ed52f6a8bf319b6c06a3be0f5 (diff)
Add retro VT323 webfont for task 1b
-rw-r--r--README.md4
-rw-r--r--integrationtests/integration_test.go18
-rw-r--r--internal/generator/templates/themes/retro/FONT_LICENSE.txt34
-rw-r--r--internal/generator/templates/themes/retro/VT323-Regular.woff2bin0 -> 26820 bytes
-rw-r--r--internal/generator/templates/themes/retro/theme.css14
5 files changed, 59 insertions, 11 deletions
diff --git a/README.md b/README.md
index 4163b2b..9eb5840 100644
--- a/README.md
+++ b/README.md
@@ -136,6 +136,10 @@ Bundled web fonts:
from [Google Fonts](https://fonts.google.com/specimen/VT323),
[SIL OFL 1.1](https://openfontlicense.org/open-font-license-official-text/).
See [internal/generator/templates/themes/matrix/FONT_LICENSE.txt](internal/generator/templates/themes/matrix/FONT_LICENSE.txt).
+- **retro** — *VT323* Regular (.woff2, latin+latin-ext) by Peter Hull,
+ from [Google Fonts](https://fonts.google.com/specimen/VT323),
+ [SIL OFL 1.1](https://openfontlicense.org/open-font-license-official-text/).
+ See [internal/generator/templates/themes/retro/FONT_LICENSE.txt](internal/generator/templates/themes/retro/FONT_LICENSE.txt).
- **synthwave** — *Russo One* Regular (.woff2, latin+latin-ext) by
Jovanny Lemonad and *Share Tech Mono* Regular (.woff2, latin+latin-ext) by
Carrois Apostrophe, from Google Fonts
diff --git a/integrationtests/integration_test.go b/integrationtests/integration_test.go
index 93b3b4e..526816d 100644
--- a/integrationtests/integration_test.go
+++ b/integrationtests/integration_test.go
@@ -457,24 +457,24 @@ func TestThemeSelection(t *testing.T) {
t.Fatalf("theme asset %s is empty", path)
}
}
- if theme == "matrix" {
- matrixDir := filepath.Join(outputDir, "themes", "matrix")
+ if theme == "matrix" || theme == "retro" {
+ themeDir := filepath.Join(outputDir, "themes", theme)
for _, fname := range []string{"VT323-Regular.woff2", "FONT_LICENSE.txt"} {
- path := filepath.Join(matrixDir, fname)
+ path := filepath.Join(themeDir, fname)
info, err := os.Stat(path)
if err != nil {
- t.Fatalf("matrix extra asset missing %s: %v", path, err)
+ t.Fatalf("%s extra asset missing %s: %v", theme, path, err)
}
if info.Size() == 0 {
- t.Fatalf("matrix extra asset %s is empty", path)
+ t.Fatalf("%s extra asset %s is empty", theme, path)
}
}
- matrixCSS := readFile(t, filepath.Join(matrixDir, "theme.css"))
- assertContains(t, matrixCSS, "url('VT323-Regular.woff2')", "matrix local font URL")
+ themeCSS := readFile(t, filepath.Join(themeDir, "theme.css"))
+ assertContains(t, themeCSS, "url('VT323-Regular.woff2')", theme+" local font URL")
for _, forbidden := range []string{"googleapis", "gstatic", "fonts.cdn", "@import url(http"} {
- if strings.Contains(matrixCSS, forbidden) {
- t.Fatalf("matrix theme.css contains runtime third-party font reference %q", forbidden)
+ if strings.Contains(themeCSS, forbidden) {
+ t.Fatalf("%s theme.css contains runtime third-party font reference %q", theme, forbidden)
}
}
}
diff --git a/internal/generator/templates/themes/retro/FONT_LICENSE.txt b/internal/generator/templates/themes/retro/FONT_LICENSE.txt
new file mode 100644
index 0000000..d523252
--- /dev/null
+++ b/internal/generator/templates/themes/retro/FONT_LICENSE.txt
@@ -0,0 +1,34 @@
+VT323
+=====
+
+This directory bundles the web font:
+
+ VT323-Regular.woff2 (weight 400)
+
+Subsets: latin, latin-ext.
+
+Source / version
+----------------
+- Family page : https://fonts.google.com/specimen/VT323
+- Designer : Peter Hull
+- Webfont set : vt323-v18 (latin + latin-ext, woff2)
+- Fetched via : https://gwfh.mranftl.com/fonts/vt323 (Webfonts Helper)
+- Fetched on : 2026-05-01
+
+License
+-------
+SIL Open Font License, Version 1.1.
+
+ - Summary : https://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web
+ - Full text : https://openfontlicense.org/open-font-license-official-text/
+ - Project : https://github.com/phoikoi/VT323
+
+The OFL allows free use, modification, and redistribution of the font,
+including embedding in commercial products. Any standalone modified
+version of the font itself must be released under the same license and
+must not use the Reserved Font Name "VT323".
+
+Required attribution
+--------------------
+Font: "VT323" by Peter Hull - https://github.com/phoikoi/VT323
+ Licensed under the SIL Open Font License 1.1.
diff --git a/internal/generator/templates/themes/retro/VT323-Regular.woff2 b/internal/generator/templates/themes/retro/VT323-Regular.woff2
new file mode 100644
index 0000000..6b2153f
--- /dev/null
+++ b/internal/generator/templates/themes/retro/VT323-Regular.woff2
Binary files differ
diff --git a/internal/generator/templates/themes/retro/theme.css b/internal/generator/templates/themes/retro/theme.css
index 217ea4b..5953698 100644
--- a/internal/generator/templates/themes/retro/theme.css
+++ b/internal/generator/templates/themes/retro/theme.css
@@ -1,6 +1,16 @@
+ /* Self-hosted web font: VT323 by Peter Hull (SIL OFL 1.1).
+ Source: https://fonts.google.com/specimen/VT323
+ See FONT_LICENSE.txt in this directory. */
+ @font-face {
+ font-family: 'VT323';
+ src: url('VT323-Regular.woff2') format('woff2');
+ font-weight: 400;
+ font-style: normal;
+ font-display: swap;
+ }
:root { --amber:#ffb000; --dim:#7a5200; --bg:#0a0800; --bg2:#050300; }
* { margin:0; padding:0; box-sizing:border-box; }
- body { font-family:'Courier New',Courier,monospace; background:var(--bg); color:var(--amber);
+ body { font-family:'VT323','Courier New',Courier,monospace; background:var(--bg); color:var(--amber);
overflow:hidden; height:100vh; height:100dvh; }
/* Phosphor scanlines overlay — sits above WebGL */
body::before { content:''; position:fixed; inset:0; z-index:999; pointer-events:none;
@@ -62,7 +72,7 @@
.modal-close { float:right; background:none; border:none; color:var(--dim);
font-family:monospace; font-size:0.9rem; cursor:pointer; letter-spacing:2px; }
@media(max-width:640px) { .nav-hints{display:none;} header{padding:10px 16px;} .content{padding:10px 16px;} .modal-inner{padding:20px 14px} .transmit-btn{padding-top:11px;padding-bottom:11px;min-height:44px} .modal-close{padding:10px 14px;min-width:44px;min-height:44px;text-align:center} }
- [data-sno-theme="retro"] .splash-overlay { background: var(--bg); font-family:'Courier New',monospace; }
+ [data-sno-theme="retro"] .splash-overlay { background: var(--bg); font-family:'VT323','Courier New',monospace; }
[data-sno-theme="retro"]::after {
content:''; position:absolute; inset:0; pointer-events:none; opacity:0.35;
background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.2) 2px, rgba(0,0,0,0.2) 4px);