diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-01 22:11:17 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-01 22:11:17 +0300 |
| commit | 107cd709bd470e0ef972d2cbd686d8888c3550e4 (patch) | |
| tree | ee054340303d8312d2e48b5e9871ee93fb4caa20 | |
| parent | f942678e7ae91d35278832f3054855269a89be3d (diff) | |
task 9: self-host nukem Web437 font
| -rw-r--r-- | README.md | 4 | ||||
| -rw-r--r-- | integrationtests/integration_test.go | 2 | ||||
| -rw-r--r-- | internal/generator/generator_test.go | 49 | ||||
| -rw-r--r-- | internal/generator/templates/themes/nukem/FONT_LICENSE.txt | 41 | ||||
| -rw-r--r-- | internal/generator/templates/themes/nukem/Web437_IBM_VGA_8x16.woff | bin | 0 -> 9788 bytes | |||
| -rw-r--r-- | internal/generator/templates/themes/nukem/theme.css | 14 |
6 files changed, 92 insertions, 18 deletions
@@ -132,6 +132,10 @@ Bundled web fonts: [Ultimate Oldschool PC Font Pack v2.2](https://int10h.org/oldschool-pc-fonts/), [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). See [internal/generator/templates/themes/dos/FONT_LICENSE.txt](internal/generator/templates/themes/dos/FONT_LICENSE.txt). +- **nukem** — *Web437 IBM VGA 8x16* (.woff) by VileR, from the + [Ultimate Oldschool PC Font Pack v2.2](https://int10h.org/oldschool-pc-fonts/), + [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). + See [internal/generator/templates/themes/nukem/FONT_LICENSE.txt](internal/generator/templates/themes/nukem/FONT_LICENSE.txt). - **biomech** — *Oxanium* Regular + Bold (.woff2, latin+latin-ext) by Tyler Finck, from [Google Fonts](https://fonts.google.com/specimen/Oxanium), [SIL OFL 1.1](https://openfontlicense.org/open-font-license-official-text/). diff --git a/integrationtests/integration_test.go b/integrationtests/integration_test.go index 3b7e4ea..cb1553f 100644 --- a/integrationtests/integration_test.go +++ b/integrationtests/integration_test.go @@ -460,6 +460,7 @@ func TestThemeSelection(t *testing.T) { fontAssets := map[string][]string{ "matrix": {"VT323-Regular.woff2", "FONT_LICENSE.txt"}, "retro": {"VT323-Regular.woff2", "FONT_LICENSE.txt"}, + "nukem": {"Web437_IBM_VGA_8x16.woff", "FONT_LICENSE.txt"}, "retrofuture": { "FONT_LICENSE.txt", "orbitron-v35-latin_latin-ext-700.woff2", @@ -475,6 +476,7 @@ func TestThemeSelection(t *testing.T) { fontURLs := map[string][]string{ "matrix": {"url('VT323-Regular.woff2')"}, "retro": {"url('VT323-Regular.woff2')"}, + "nukem": {"url('Web437_IBM_VGA_8x16.woff')"}, "retrofuture": { "url('orbitron-v35-latin_latin-ext-700.woff2')", "url('orbitron-v35-latin_latin-ext-regular.woff2')", diff --git a/internal/generator/generator_test.go b/internal/generator/generator_test.go index 62b3593..7e2742b 100644 --- a/internal/generator/generator_test.go +++ b/internal/generator/generator_test.go @@ -446,6 +446,32 @@ func TestRun_writesPagesAndAtom(t *testing.T) { func TestRun_writesVolcanoFontAssets(t *testing.T) { t.Parallel() + testRunWritesThemeFontAssets(t, "volcano", []string{ + "bebas-neue-v16-latin_latin-ext-regular.woff2", + "inter-v20-latin_latin-ext-regular.woff2", + "inter-v20-latin_latin-ext-600.woff2", + "FONT_LICENSE.txt", + }, []string{ + "url('bebas-neue-v16-latin_latin-ext-regular.woff2')", + "url('inter-v20-latin_latin-ext-regular.woff2')", + "url('inter-v20-latin_latin-ext-600.woff2')", + }) +} + +func TestRun_writesNukemFontAssets(t *testing.T) { + t.Parallel() + + testRunWritesThemeFontAssets(t, "nukem", []string{ + "Web437_IBM_VGA_8x16.woff", + "FONT_LICENSE.txt", + }, []string{ + "url('Web437_IBM_VGA_8x16.woff')", + }) +} + +func testRunWritesThemeFontAssets(t *testing.T, theme string, assets, localURLs []string) { + t.Helper() + out := t.TempDir() postDir := filepath.Join(out, "posts", "a1") if err := os.MkdirAll(postDir, 0o755); err != nil { @@ -464,19 +490,14 @@ func TestRun_writesVolcanoFontAssets(t *testing.T) { cfg := &config.Config{ OutputDir: out, BaseURL: "https://example.test", - Theme: "volcano", + Theme: theme, } if err := Run(ctx, cfg); err != nil { t.Fatalf("Run: %v", err) } - themeDir := filepath.Join(out, "themes", "volcano") - for _, name := range []string{ - "bebas-neue-v16-latin_latin-ext-regular.woff2", - "inter-v20-latin_latin-ext-regular.woff2", - "inter-v20-latin_latin-ext-600.woff2", - "FONT_LICENSE.txt", - } { + themeDir := filepath.Join(out, "themes", theme) + for _, name := range assets { info, err := os.Stat(filepath.Join(themeDir, name)) if err != nil { t.Fatalf("%s: %v", name, err) @@ -488,21 +509,17 @@ func TestRun_writesVolcanoFontAssets(t *testing.T) { css, err := os.ReadFile(filepath.Join(themeDir, "theme.css")) if err != nil { - t.Fatalf("read volcano theme.css: %v", err) + t.Fatalf("read %s theme.css: %v", theme, err) } got := string(css) - for _, localFont := range []string{ - "url('bebas-neue-v16-latin_latin-ext-regular.woff2')", - "url('inter-v20-latin_latin-ext-regular.woff2')", - "url('inter-v20-latin_latin-ext-600.woff2')", - } { + for _, localFont := range localURLs { if !strings.Contains(got, localFont) { - t.Fatalf("volcano theme.css missing local font reference %q", localFont) + t.Fatalf("%s theme.css missing local font reference %q", theme, localFont) } } for _, forbidden := range []string{"googleapis", "gstatic", "fonts.cdn", "@import url(http"} { if strings.Contains(got, forbidden) { - t.Fatalf("volcano theme.css contains forbidden external font reference %q", forbidden) + t.Fatalf("%s theme.css contains forbidden external font reference %q", theme, forbidden) } } } diff --git a/internal/generator/templates/themes/nukem/FONT_LICENSE.txt b/internal/generator/templates/themes/nukem/FONT_LICENSE.txt new file mode 100644 index 0000000..9ee0193 --- /dev/null +++ b/internal/generator/templates/themes/nukem/FONT_LICENSE.txt @@ -0,0 +1,41 @@ +Web437 IBM VGA 8x16 +=================== + +This directory bundles the web font: + + Web437_IBM_VGA_8x16.woff + +It is taken from "The Ultimate Oldschool PC Font Pack" v2.2 by VileR +(https://int10h.org/oldschool-pc-fonts/) and is used here unmodified. + +Source archive: + + https://int10h.org/oldschool-pc-fonts/download/oldschool_pc_font_pack_v2.2_web.zip + +Source file in archive: + + woff - Web (webfonts)/Web437_IBM_VGA_8x16.woff + +Version/date: + + Ultimate Oldschool PC Font Pack v2.2, archive file timestamp 2020-11-21. + Downloaded for this repository on 2026-05-01. + +The font pack - including this file - is licensed under the Creative +Commons Attribution-ShareAlike 4.0 International License (CC BY-SA 4.0). + + - License summary: https://creativecommons.org/licenses/by-sa/4.0/ + - Full license text: https://creativecommons.org/licenses/by-sa/4.0/legalcode + - Project page: https://int10h.org/oldschool-pc-fonts/ + - Readme & terms: https://int10h.org/oldschool-pc-fonts/readme/ + +Required attribution +-------------------- +Font: "Web437 IBM VGA 8x16" from the Ultimate Oldschool PC Font Pack + by VileR - https://int10h.org/oldschool-pc-fonts/ + Licensed under CC BY-SA 4.0. + +Because this work is distributed under CC BY-SA 4.0, any modified version +of the font itself (not the surrounding snonux code) must be released +under the same license. Embedding/serving the font as part of a web +page is not considered a derivative work of the font. diff --git a/internal/generator/templates/themes/nukem/Web437_IBM_VGA_8x16.woff b/internal/generator/templates/themes/nukem/Web437_IBM_VGA_8x16.woff Binary files differnew file mode 100644 index 0000000..1f1508d --- /dev/null +++ b/internal/generator/templates/themes/nukem/Web437_IBM_VGA_8x16.woff diff --git a/internal/generator/templates/themes/nukem/theme.css b/internal/generator/templates/themes/nukem/theme.css index 060cd08..e780cb8 100644 --- a/internal/generator/templates/themes/nukem/theme.css +++ b/internal/generator/templates/themes/nukem/theme.css @@ -1,8 +1,18 @@ + /* Bundled bitmap font: "Web437 IBM VGA 8x16" by VileR + (https://int10h.org/oldschool-pc-fonts/), used unmodified under + CC BY-SA 4.0. See FONT_LICENSE.txt in this directory. */ + @font-face { + font-family: 'Web437 IBM VGA 8x16'; + src: url('Web437_IBM_VGA_8x16.woff') format('woff'); + font-weight: normal; + font-style: normal; + font-display: swap; + } :root { --duke-red:#ff0000; --duke-gold:#ffd700; --duke-grey:#3a3a3a; --duke-bg:#0a0a0a; --duke-dark:#111111; --duke-yellow:#ffcc00; --duke-blood:#cc0000; --duke-light:#e0e0e0; } * { margin:0; padding:0; box-sizing:border-box; } - body { font-family:'Courier New',monospace; background:var(--duke-bg); + body { font-family:'Web437 IBM VGA 8x16','Courier New',monospace; background:var(--duke-bg); color:var(--duke-light); overflow:hidden; height:100vh; height:100dvh; font-size:18px; } #three-canvas { position:fixed; top:0; left:0; width:100%; height:100%; z-index:1; } .overlay { position:relative; z-index:10; height:100vh; height:100dvh; display:flex; flex-direction:column; } @@ -64,7 +74,7 @@ border:3px solid var(--duke-red); padding:28px; box-shadow:0 0 40px rgba(255,0,0,0.35); } .modal-close { float:right; background:var(--duke-red); border:none; - color:var(--duke-gold); font-family:'Courier New',monospace; + color:var(--duke-gold); font-family:'Web437 IBM VGA 8x16','Courier New',monospace; font-size:1rem; font-weight:bold; cursor:pointer; padding:4px 10px; text-transform:uppercase; letter-spacing:1px; } .modal-close:hover { background:var(--duke-gold); color:var(--duke-bg); |
