Use the JARL wordmark in the header and as the README banner
The header now shows the login page's wordmark letters (without the rule) instead of "Jarl" set in Cinzel, so the bundled Cinzel font, its preload and its licence stanza in the .deb's copyright file are removed: the web UI needs no web font. The README opens with the login page's banner, the logo above the wordmark (artwork/banner.svg). scripts/banner.py builds it from the web UI's logo.js and brand.js, with light and dark colors, and logo.py runs it after tracing the logo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0f04dbb4b1
commit
1afed741bf
13 files changed
+135
-144
No files matched your search
+6
-4
@@ -33,8 +33,7 @@ The first version, to be released as 0.1.0.
|
||||
locks root out. Changes are audited under the system user's name via
|
||||
`socket`. The systemd unit creates `/run/jarl` (0750).
|
||||
- Jarl is released under the MIT License (`LICENSE`), which is installed
|
||||
with the docs and is the Debian package's `copyright` file (with the
|
||||
bundled Cinzel font's OFL).
|
||||
with the docs and is the Debian package's `copyright` file.
|
||||
- A Debian package: `make deb` builds `dist/jarl_<version>_<arch>.deb` with
|
||||
only `dpkg-deb` (no root), for the host or any other architecture
|
||||
(`DEB_ARCH=arm64`). Installing it creates the `jarl` user and directories
|
||||
@@ -84,8 +83,11 @@ The first version, to be released as 0.1.0.
|
||||
appears together with the page.
|
||||
- The login page shows an angular, Norse-style "JARL" wordmark drawn as
|
||||
SVG paths (`assets/brand.js`) above a rule with a "DNS" node; it follows
|
||||
the light and dark themes. The header's "Jarl" uses Cinzel Bold (SIL OFL),
|
||||
self-hosted as a 13 KB Latin subset.
|
||||
the light and dark themes. The header beside the logo shows the same
|
||||
letters, without the rule, so the UI needs no web font.
|
||||
- The README opens with the login page's banner, the logo above the
|
||||
wordmark (`artwork/banner.svg`, built by `scripts/banner.py` from the web
|
||||
UI's own logo and wordmark, with light and dark colors).
|
||||
|
||||
- Web UI: wherever an address match list is entered (server, view and zone
|
||||
options such as allow-query or allow-transfer, view match lists, ACL
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<p align="center"><img src="internal/web/static/assets/logo.svg" width="240" alt="Jarl logo: a bearded Viking jarl in a crown holding a DNS tree"></p>
|
||||
<p align="center"><img src="artwork/banner.svg" width="260" alt="Jarl: a bearded Viking jarl in a crown holding a DNS tree, above the JARL wordmark"></p>
|
||||
|
||||
# Jarl
|
||||
|
||||
@@ -147,15 +147,14 @@ yet ([concepts.md](docs/concepts.md#what-jarl-deliberately-doesnt-do-yet)).
|
||||
|
||||
## License
|
||||
|
||||
Jarl is released under the [MIT License](LICENSE). The bundled Cinzel font
|
||||
is under the SIL Open Font License 1.1 (below).
|
||||
Jarl is released under the [MIT License](LICENSE).
|
||||
|
||||
## Credits
|
||||
|
||||
The "Jarl" name in the web UI's header uses [Cinzel](https://github.com/NDISCOVER/Cinzel) Bold
|
||||
by the Cinzel Project Authors, under the SIL Open Font License 1.1
|
||||
(`internal/web/static/assets/fonts/Cinzel-OFL.txt`). The logo is part of
|
||||
Jarl: a bearded Viking jarl in blue and white, whose crown holds a DNS tree
|
||||
(a root node with its branches). The master is `artwork/logo.png`, which
|
||||
`scripts/logo.py` traces into the vector `assets/logo.svg` and
|
||||
`assets/logo.js`.
|
||||
The logo is part of Jarl: a bearded Viking jarl in blue and white, whose
|
||||
crown holds a DNS tree (a root node with its branches). The master is
|
||||
`artwork/logo.png`, which `scripts/logo.py` traces into the vector
|
||||
`assets/logo.svg` and `assets/logo.js`. The "JARL" wordmark is drawn as SVG
|
||||
paths in `assets/brand.js`, so the web UI needs no font files. The banner at
|
||||
the top of this file, `artwork/banner.svg`, is built from both by
|
||||
`scripts/banner.py`.
|
||||
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 288 311.2" role="img" aria-label="Jarl">
|
||||
<!-- Generated by scripts/banner.py from internal/web/static/assets/logo.js and brand.js. -->
|
||||
<title>Jarl</title><style>.t{fill:#1d2330}.a{fill:#2f5fb3}.l{fill:none;stroke:#2f5fb3;stroke-width:2.6}.d{fill:#2f5fb3;font:700 12.5px system-ui,sans-serif;letter-spacing:.5px}@media (prefers-color-scheme:dark){.t{fill:#e3e7ee}.a,.d{fill:#6d9be8}.l{stroke:#6d9be8}}</style>
|
||||
<svg x="75.95" width="136.1" height="136.1" viewBox="14 14 1226 1226"><g transform="translate(0 1254) scale(1 -1)"><path fill="#1d5287" d="M618 1223 c-16 -21 -83 -110 -94 -126 l-11 -15 0 -37 0 -38 -2 -1 c-2 -2 -33 -20 -80 -47 -12 -7 -25 -14 -29 -17 -11 -6 -33 -19 -33 -19 -1 1 -7 51 -9 71 l-2 19 -30 22 c-51 37 -51 37 -90 66 -8 5 -15 9 -15 9 0 0 2 -8 4 -16 1 -9 5 -22 6 -30 4 -15 10 -42 30 -120 7 -27 15 -62 19 -78 4 -17 9 -37 11 -45 2 -8 8 -31 13 -51 l8 -36 5 0 5 0 -14 -40 c-35 -106 -50 -154 -49 -154 1 0 29 11 42 16 5 2 9 4 9 3 0 0 -5 -12 -12 -28 -6 -15 -14 -34 -18 -42 -7 -19 -30 -75 -30 -76 0 0 21 -30 41 -56 10 -15 41 -59 59 -84 12 -18 14 -20 14 -19 0 0 3 5 7 12 l5 11 3 -12 c1 -6 4 -20 6 -31 l4 -19 9 -9 c5 -5 15 -13 21 -19 44 -42 74 -71 74 -71 1 0 2 7 3 14 2 7 3 14 4 14 0 0 28 -28 63 -62 l62 -62 63 62 63 63 3 -14 c1 -8 3 -15 3 -15 0 0 11 10 24 23 13 12 36 35 52 49 26 26 28 27 29 32 0 2 3 15 5 29 3 13 5 24 6 25 0 2 2 -1 6 -9 4 -6 7 -11 7 -11 1 0 8 10 16 22 14 20 24 35 77 108 l21 29 -8 19 c-8 21 -23 56 -41 101 -7 14 -12 27 -12 27 1 0 12 -4 26 -10 14 -5 26 -10 26 -9 1 0 -31 98 -59 181 l-4 12 5 0 5 0 2 11 c12 48 25 104 43 176 11 42 40 166 46 188 l0 2 -3 -2 c-2 -1 -11 -8 -20 -14 -9 -7 -20 -15 -24 -18 -4 -3 -12 -8 -17 -12 -14 -11 -38 -28 -44 -33 -4 -2 -11 -7 -16 -11 l-10 -7 -6 -45 c-3 -25 -6 -45 -6 -45 -2 0 -45 25 -92 54 -3 1 -15 8 -26 15 -11 6 -22 12 -23 13 l-3 2 0 37 0 38 -18 24 c-10 14 -23 30 -28 38 -21 28 -67 89 -68 89 0 0 -4 -5 -9 -11z"/><path fill="#fff" d="M603 1171 c-13 -17 -34 -46 -46 -63 l-24 -31 0 -38 c0 -21 0 -40 0 -41 -1 -3 -2 -4 -34 -23 -18 -10 -42 -24 -54 -31 -70 -41 -92 -53 -93 -53 0 0 -2 17 -4 38 -9 66 -10 74 -11 75 -1 1 -6 4 -10 7 -8 6 -27 20 -58 43 -7 5 -13 9 -14 9 0 -1 7 -31 43 -173 17 -68 31 -126 31 -128 1 -2 2 -3 2 -3 1 0 16 6 33 13 56 22 87 33 121 41 83 20 165 23 248 8 54 -10 101 -24 162 -51 30 -13 29 -12 30 -8 1 7 20 84 47 192 15 60 27 109 27 109 -1 0 -16 -11 -35 -25 -18 -13 -37 -27 -40 -29 -4 -3 -8 -6 -8 -6 0 -1 -4 -26 -7 -56 -4 -31 -8 -56 -8 -56 -1 0 -41 23 -70 40 -14 9 -32 19 -40 24 -19 11 -67 39 -68 39 -1 0 -1 19 -2 42 l0 41 -19 25 c-57 76 -75 100 -75 100 0 0 -11 -14 -24 -31z m34 -64 c18 -4 31 -18 34 -37 3 -19 -8 -40 -27 -48 l-6 -2 0 -39 0 -38 4 -2 c10 -4 19 -13 23 -24 l2 -6 5 -2 c71 -15 77 -16 78 -15 1 1 3 4 5 6 17 25 56 22 70 -7 10 -21 1 -45 -21 -55 -10 -5 -23 -5 -33 0 -12 5 -21 17 -24 28 0 2 -1 4 -2 4 0 0 -18 4 -39 8 -21 4 -39 8 -40 9 -2 0 -3 -1 -6 -5 -16 -24 -50 -24 -66 0 -3 4 -4 5 -5 5 -2 -1 -20 -5 -42 -9 l-40 -8 -1 -5 c-6 -22 -30 -36 -52 -29 -36 11 -39 61 -5 77 19 9 45 1 53 -17 2 -4 0 -4 28 2 13 3 31 7 40 9 l17 4 2 5 c4 11 12 20 22 25 l5 2 0 38 0 39 -4 1 c-13 4 -25 17 -28 32 -9 32 21 63 53 54z M616 1086 c-15 -8 -19 -28 -7 -40 16 -15 42 -4 42 18 0 18 -18 29 -35 22z M457 894 c-12 -7 -16 -22 -7 -32 14 -16 40 -3 36 18 -3 13 -18 20 -29 14z M780 895 c-16 -7 -17 -29 -2 -37 16 -9 34 4 30 22 -3 12 -17 19 -28 15z M594 809 c-48 -3 -98 -12 -142 -26 -7 -2 -13 -4 -13 -4 -1 0 -4 -9 -8 -19 l-7 -19 5 -1 c2 0 15 0 29 1 l24 1 13 -5 c44 -15 84 -28 86 -28 0 0 5 3 10 7 5 5 10 8 10 8 0 -1 0 -18 -1 -40 -3 -91 -3 -108 -2 -110 1 0 8 -5 15 -9 l14 -9 15 9 14 10 -1 32 c0 17 -1 50 -1 74 -1 23 -1 42 -1 42 0 1 5 -3 10 -7 l10 -8 50 17 50 17 21 -1 c11 -1 24 -1 28 -1 l8 0 -6 16 c-3 8 -6 17 -7 19 l-1 4 -11 3 c-68 22 -143 31 -211 27z M846 767 c0 -1 9 -26 15 -41 l5 -13 0 -20 c0 -23 3 -146 4 -167 0 -10 0 -14 -1 -13 -1 1 -11 27 -23 61 -3 10 -7 19 -7 20 -1 1 -13 -52 -13 -56 0 -3 4 -19 15 -60 l7 -26 14 -25 c7 -14 16 -30 19 -36 3 -6 8 -15 10 -19 l5 -9 -3 -34 c-2 -18 -3 -34 -3 -35 0 -2 7 7 28 37 15 21 36 49 45 62 l17 23 -4 10 c-7 16 -20 47 -34 81 -7 17 -18 44 -25 59 -6 14 -13 31 -15 36 -2 5 -4 9 -4 10 0 0 5 -3 10 -7 15 -12 27 -19 40 -25 6 -3 12 -6 13 -6 1 0 -4 16 -38 120 l-16 48 -16 7 c-22 10 -45 19 -45 18z M377 755 l-29 -13 -16 -47 c-22 -64 -40 -120 -40 -121 1 -1 20 8 29 13 4 3 14 10 21 15 7 6 13 10 13 10 1 0 -12 -30 -27 -66 -15 -37 -34 -81 -41 -98 l-13 -32 5 -7 c7 -9 47 -65 64 -89 7 -10 14 -20 16 -23 l5 -5 0 4 c0 2 -1 14 -2 27 -3 27 -4 35 -4 38 0 2 5 12 11 24 33 59 36 66 38 72 7 23 21 79 21 81 0 3 -12 56 -13 56 0 0 -5 -13 -10 -28 -13 -34 -20 -54 -21 -54 0 1 0 20 1 44 2 94 3 127 3 141 l0 15 8 21 c11 30 12 34 11 34 -1 0 -15 -6 -30 -12z M419 693 c-1 -9 -1 -24 -1 -34 l0 -17 21 -20 21 -19 2 -7 c1 -4 4 -13 6 -19 2 -7 6 -21 10 -31 3 -10 6 -19 6 -19 0 -1 14 9 30 22 l30 24 12 18 c6 9 12 19 14 21 2 3 2 3 3 33 l0 31 -5 -2 c-33 -13 -43 -17 -44 -17 0 1 4 7 10 14 5 7 10 14 10 14 -1 0 -7 -1 -14 -3 -21 -6 -23 -6 -35 -2 -9 3 -10 4 -24 17 l-15 13 -18 0 -19 0 0 -17z M783 697 c-23 -21 -31 -23 -58 -16 -8 2 -14 4 -15 4 0 0 5 -7 10 -14 5 -7 10 -14 10 -14 -1 0 -22 8 -40 15 -5 2 -9 4 -10 4 0 -1 0 -14 1 -31 l1 -29 12 -20 c7 -11 13 -20 14 -21 0 0 4 -4 9 -8 6 -4 19 -15 31 -24 12 -10 21 -17 22 -17 0 1 22 69 23 73 0 2 6 8 22 23 l21 21 0 17 c-1 10 -1 25 -1 34 l0 16 -19 0 -18 0 -15 -13z M568 554 c-20 -7 -21 -8 -50 -30 -59 -44 -59 -44 -70 -59 -26 -37 -37 -54 -53 -86 -11 -22 -11 -24 -11 -28 2 -8 11 -57 18 -92 l7 -34 8 -8 c30 -28 64 -60 65 -60 0 0 -2 11 -4Line truncated
|
||||
<svg y="149.2" width="288" height="162" viewBox="-4 -4 288 162"><g class="t" fill-rule="evenodd"><path transform="translate(0 0)" d="M14 0 H48 V10 H42 V80 L31 100 H5 L0 93 L19 84 H24 V10 H14 Z"/><path transform="translate(60 0)" d="M35 0 L46 10 L64 90 L70 100 H50 L44 76 L35 62 L26 76 L20 100 H0 L6 90 L24 10 Z M35 26 L41 40 L35 54 L29 40 Z"/><path transform="translate(142 0)" d="M0 0 H48 L60 12 V40 L50 50 L66 100 H46 L34 60 H18 V100 H0 Z M18 14 H41 L46 19 V35 L41 46 H18 Z"/><path transform="translate(220 0)" d="M0 0 H18 V84 H40 L58 70 L54 100 H0 Z"/></g><g transform="translate(0 118)"><path d="M2 18 L98 15.6 V20.4 Z M278 18 L182 15.6 V20.4 Z" class="a"/><circle cx="106" cy="18" r="4.6" class="l"/><path d="M110.6 18 H122 M158 18 H169.4" class="l"/><circle cx="140" cy="18" r="17" class="l"/><circle cx="174" cy="18" r="4.6" class="l"/><text x="140" y="22.5" text-anchor="middle" class="d">DNS</text></g></svg>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.1 KiB |
+11
-7
@@ -32,7 +32,8 @@ contrib/lego/ program for lego's exec DNS provider
|
||||
scripts/e2e.sh end-to-end test against a real named
|
||||
scripts/mkdeb.sh builds the Debian package (make deb)
|
||||
scripts/logo.py traces artwork/logo.png into the web UI's logo (logo.svg, logo.js)
|
||||
artwork/ the logo's master image
|
||||
scripts/banner.py builds the README's banner from the web UI's logo and wordmark
|
||||
artwork/ the logo's master image and the README's banner
|
||||
```
|
||||
|
||||
The main flow is in `internal/engine/engine.go` (`applyOps`):
|
||||
@@ -117,16 +118,19 @@ The UI is plain JavaScript modules under `internal/web/static/`, with no
|
||||
framework and no build step. The logo's master is `artwork/logo.png` (blue
|
||||
`#1d5287` and white on a transparent background). `scripts/logo.py` traces it
|
||||
with potrace (needs `potrace` and ImageMagick) into `assets/logo.svg` (the
|
||||
favicon and the README's logo) and `assets/logo.js` (the same paths); change
|
||||
the PNG and rerun the script rather than editing those files. The header and
|
||||
favicon) and `assets/logo.js` (the same paths); change the PNG and rerun the
|
||||
script rather than editing those files. The header and
|
||||
login page draw the logo inline from `logo.js` (`logo()` in `brand.js`), so
|
||||
it appears with the page instead of popping in after a separate download.
|
||||
Static files are served with `Cache-Control: no-cache` and a content ETag,
|
||||
so a reload revalidates them with cheap 304 answers. The
|
||||
login page's "JARL" wordmark is drawn as SVG paths in `assets/brand.js`, so
|
||||
it needs no font and takes the theme's text and accent colors. The header's
|
||||
"Jarl" uses a Latin subset of Cinzel Bold in `assets/fonts/` (SIL OFL; keep
|
||||
`Cinzel-OFL.txt` next to it). All DOM is built with the `h()` helper in
|
||||
"JARL" wordmark is drawn as SVG paths by `wordmark()` in `assets/brand.js`
|
||||
(over a rule on the login page, the letters alone in the header), so the UI
|
||||
needs no web font and the wordmark takes the theme's text and accent colors.
|
||||
The README's banner, `artwork/banner.svg`, is the login page's logo and
|
||||
wordmark, generated by `scripts/banner.py` from `logo.js` and `brand.js`
|
||||
(`logo.py` runs it; run it yourself after editing the wordmark).
|
||||
All DOM is built with the `h()` helper in
|
||||
`ui.js`, which never uses `innerHTML`, so record data and comments can't
|
||||
inject markup. The Content-Security-Policy only allows the app's own
|
||||
scripts and styles. To work on it, run jarld and reload the browser: the
|
||||
|
||||
@@ -93,7 +93,7 @@ function layout() {
|
||||
const header = h("header", { class: "top" },
|
||||
h("a", { class: "brand", href: "#/", title: "Dashboard" },
|
||||
logo(30),
|
||||
h("span", { class: "brand-name" }, "Jarl"),
|
||||
wordmark({ rule: false, height: 19, cls: "brand-name" }),
|
||||
h("span", { class: "brand-version" }, me.version)),
|
||||
navEl,
|
||||
h("div", { class: "spacer" }),
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// The Jarl logo and the login page's wordmark, drawn as inline SVG so they
|
||||
// appear together with the page instead of loading afterwards.
|
||||
//
|
||||
// The "JARL" wordmark for the login page: angular Norse-style letters
|
||||
// drawn as paths (no font needed), over a rule with DNS nodes. The letters
|
||||
// use the text color and the rule the accent color, so it follows the
|
||||
// theme.
|
||||
// The "JARL" wordmark: angular Norse-style letters drawn as paths (no font
|
||||
// needed). The login page shows it over a rule with DNS nodes; the header
|
||||
// shows the letters alone. The letters use the text color and the rule the
|
||||
// accent color, so it follows the theme.
|
||||
import * as logoData from "./logo.js";
|
||||
|
||||
const NS = "http://www.w3.org/2000/svg";
|
||||
@@ -28,19 +28,27 @@ const letters = [
|
||||
{ x: 220, d: "M0 0 H18 V84 H40 L58 70 L54 100 H0 Z" },
|
||||
];
|
||||
|
||||
export function wordmark() {
|
||||
// wordmark returns the login page's wordmark, letters over the rule.
|
||||
// wordmark({ rule: false, height: 19, cls: "brand-name" }) returns just the
|
||||
// letters, height pixels tall.
|
||||
export function wordmark({ rule = true, height, cls = "wordmark" } = {}) {
|
||||
const letterG = el("g", { fill: "currentColor", "fill-rule": "evenodd" },
|
||||
...letters.map((l) => el("path", { d: l.d, transform: `translate(${l.x} 0)` })));
|
||||
if (!rule) {
|
||||
const attrs = { class: cls, viewBox: "-2 -2 282 104", role: "img", "aria-label": "Jarl" };
|
||||
if (height) Object.assign(attrs, { height, width: Math.round(height * 282 / 104) });
|
||||
return el("svg", attrs, el("title", null, "Jarl"), letterG);
|
||||
}
|
||||
// The rule: tapered lines, two nodes and a "DNS" node in the middle.
|
||||
const rule = el("g", { class: "wordmark-rule", transform: "translate(0 118)" },
|
||||
const ruleG = el("g", { class: "wordmark-rule", transform: "translate(0 118)" },
|
||||
el("path", { d: "M2 18 L98 15.6 V20.4 Z M278 18 L182 15.6 V20.4 Z", class: "fill" }),
|
||||
el("circle", { cx: 106, cy: 18, r: 4.6, class: "line" }),
|
||||
el("path", { d: "M110.6 18 H122 M158 18 H169.4", class: "line" }),
|
||||
el("circle", { cx: 140, cy: 18, r: 17, class: "line" }),
|
||||
el("circle", { cx: 174, cy: 18, r: 4.6, class: "line" }),
|
||||
el("text", { x: 140, y: 22.5, "text-anchor": "middle", class: "dns" }, "DNS"));
|
||||
return el("svg", { class: "wordmark", viewBox: "-4 -4 288 162", role: "img", "aria-label": "Jarl" },
|
||||
el("title", null, "Jarl"), letterG, rule);
|
||||
return el("svg", { class: cls, viewBox: "-4 -4 288 162", role: "img", "aria-label": "Jarl" },
|
||||
el("title", null, "Jarl"), letterG, ruleG);
|
||||
}
|
||||
|
||||
// logo returns the Jarl logo (traced from artwork/logo.png by
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
Copyright 2020 The Cinzel Project Authors (https://github.com/NDISCOVER/Cinzel)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Binary file not shown.
@@ -88,19 +88,9 @@ header.top {
|
||||
background: var(--panel); border-bottom: 1px solid var(--border);
|
||||
padding: 8px 16px; position: sticky; top: 0; z-index: 10;
|
||||
}
|
||||
/* The brand face: Cinzel Bold (SIL OFL, assets/fonts/Cinzel-OFL.txt),
|
||||
subset to Latin and served by jarld itself. */
|
||||
@font-face {
|
||||
font-family: "Jarl Cinzel";
|
||||
src: url("fonts/cinzel-bold.woff2") format("woff2");
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
.brand-name { font-family: "Jarl Cinzel", "Cinzel", "Trajan Pro", Georgia, serif; font-weight: 700; letter-spacing: 1.5px; }
|
||||
header.top .brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
|
||||
header.top .brand .logo { display: block; transition: transform 0.15s; }
|
||||
header.top .brand .brand-name { font-size: 20px; line-height: 1; padding-top: 2px; }
|
||||
header.top .brand .brand-name { display: block; color: var(--text); }
|
||||
header.top .brand .brand-version { color: var(--muted); font-size: 12px; align-self: flex-end; padding-bottom: 2px; }
|
||||
header.top .brand:hover { text-decoration: none; }
|
||||
header.top .brand:hover .brand-name { color: var(--accent); }
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Jarl</title>
|
||||
<link rel="icon" href="/assets/logo.svg" type="image/svg+xml">
|
||||
<link rel="preload" href="/assets/fonts/cinzel-bold.woff2" as="font" type="font/woff2" crossorigin>
|
||||
<link rel="stylesheet" href="/assets/style.css">
|
||||
<script type="module" src="/assets/app.js"></script>
|
||||
</head>
|
||||
|
||||
Executable
+79
@@ -0,0 +1,79 @@
|
||||
#!/usr/bin/env python3
|
||||
# Builds artwork/banner.svg, the README's banner: the logo above the "JARL"
|
||||
# wordmark, laid out as on the web UI's login page. It reads both from the
|
||||
# web UI's own sources, so it matches the login page:
|
||||
#
|
||||
# internal/web/static/assets/logo.js the logo's paths (from scripts/logo.py)
|
||||
# internal/web/static/assets/brand.js the wordmark's letters and rule
|
||||
#
|
||||
# The letters and rule take the UI's text and accent colors, switching to
|
||||
# the dark theme's when the viewer prefers dark. Needs only Python; run from
|
||||
# the repository root after changing either file (scripts/logo.py runs it):
|
||||
#
|
||||
# python3 scripts/banner.py
|
||||
import re
|
||||
import sys
|
||||
|
||||
ASSETS = "internal/web/static/assets"
|
||||
OUT = "artwork/banner.svg"
|
||||
|
||||
# The UI's --text and --accent (style.css), light and dark.
|
||||
STYLE = (".t{fill:#1d2330}.a{fill:#2f5fb3}.l{fill:none;stroke:#2f5fb3;stroke-width:2.6}"
|
||||
".d{fill:#2f5fb3;font:700 12.5px system-ui,sans-serif;letter-spacing:.5px}"
|
||||
"@media (prefers-color-scheme:dark){.t{fill:#e3e7ee}.a,.d{fill:#6d9be8}.l{stroke:#6d9be8}}")
|
||||
CLASSES = {"fill": "a", "line": "l", "dns": "d"}
|
||||
|
||||
# The login page's sizes in pixels (style.css): a 104px logo, 10px above a
|
||||
# 220px wordmark whose viewBox is 288 units wide.
|
||||
UNIT = 288 / 220
|
||||
LOGO = round(104 * UNIT, 1)
|
||||
GAP = round(10 * UNIT, 1)
|
||||
|
||||
|
||||
def attrs(src):
|
||||
"""Turns a JS object literal's body ({ cx: 106, "text-anchor": "middle" })
|
||||
into SVG attributes."""
|
||||
out = []
|
||||
for key, val in re.findall(r'"?([\w-]+)"?:\s*("[^"]*"|[\d.]+)', src):
|
||||
val = val.strip('"')
|
||||
out.append(f'class="{CLASSES[val]}"' if key == "class" else f'{key}="{val}"')
|
||||
return " ".join(out)
|
||||
|
||||
|
||||
def main():
|
||||
logo = open(f"{ASSETS}/logo.js").read()
|
||||
view_box = re.search(r'viewBox = "([^"]*)"', logo).group(1)
|
||||
transform = re.search(r'transform = "([^"]*)"', logo).group(1)
|
||||
layers = re.findall(r'\["(#\w+)", "([^"]*)"\]', logo)
|
||||
|
||||
brand = open(f"{ASSETS}/brand.js").read()
|
||||
letters = re.findall(r'\{ x: (\d+), d: "([^"]*)" \}', brand)
|
||||
rule = brand[brand.index("const ruleG"):]
|
||||
rule = rule[:rule.index(");\n")]
|
||||
rule_at = re.search(r'class: "wordmark-rule", transform: "([^"]*)"', rule).group(1)
|
||||
shapes = re.findall(r'el\("(path|circle|text)", \{ ([^}]*) \}(?:, "([^"]*)")?\)', rule)
|
||||
mark_box = re.search(r'viewBox: "(-4 -4 288 162)"', brand).group(1)
|
||||
if len(layers) < 2 or len(letters) != 4 or len(shapes) < 5:
|
||||
sys.exit("banner.py: logo.js or brand.js no longer looks as expected; update the script")
|
||||
|
||||
width, height = 288, LOGO + GAP + 162
|
||||
svg = [f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {width} {height:g}" role="img" aria-label="Jarl">',
|
||||
f"<!-- Generated by scripts/banner.py from {ASSETS}/logo.js and brand.js. -->",
|
||||
f"<title>Jarl</title><style>{STYLE}</style>",
|
||||
f'<svg x="{(width - LOGO) / 2:g}" width="{LOGO:g}" height="{LOGO:g}" viewBox="{view_box}">'
|
||||
f'<g transform="{transform}">'
|
||||
+ "".join(f'<path fill="{fill}" d="{d}"/>' for fill, d in layers) + "</g></svg>",
|
||||
f'<svg y="{LOGO + GAP:g}" width="288" height="162" viewBox="{mark_box}">'
|
||||
'<g class="t" fill-rule="evenodd">'
|
||||
+ "".join(f'<path transform="translate({x} 0)" d="{d}"/>' for x, d in letters) + "</g>"
|
||||
f'<g transform="{rule_at}">'
|
||||
+ "".join(f"<{tag} {attrs(a)}>{text}</{tag}>" if text else f"<{tag} {attrs(a)}/>" for tag, a, text in shapes)
|
||||
+ "</g></svg>",
|
||||
"</svg>"]
|
||||
with open(OUT, "w") as f:
|
||||
f.write("\n".join(svg) + "\n")
|
||||
print(f"{OUT}: {width}x{height:g}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
+5
-2
@@ -3,11 +3,13 @@
|
||||
# and white figure on a transparent background), by tracing it into vector
|
||||
# paths with potrace:
|
||||
#
|
||||
# internal/web/static/assets/logo.svg the favicon, and the README's logo
|
||||
# internal/web/static/assets/logo.svg the favicon
|
||||
# internal/web/static/assets/logo.js the same paths for the web UI, which
|
||||
# draws them inline (brand.js), so the
|
||||
# logo appears together with the page
|
||||
#
|
||||
# and then runs scripts/banner.py to rebuild the README's banner.
|
||||
#
|
||||
# Both are a few KB, where the PNG is 650 KB. Needs potrace and ImageMagick
|
||||
# (convert). Run from the repository root after changing the master:
|
||||
#
|
||||
@@ -65,7 +67,8 @@ def main():
|
||||
+ "".join(f' ["{fill}", "{d}"],\n' for fill, d in layers)
|
||||
+ "];\n")
|
||||
for name in ("logo.svg", "logo.js"):
|
||||
print(f"{OUT}/{name}: {os.path.getsize(os.path.join(OUT, name))} bytes")
|
||||
print(f"{OUT}/{name}: {os.path.getsize(os.path.join(OUT, name))} bytes", flush=True)
|
||||
subprocess.run([sys.executable, "scripts/banner.py"], check=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
+1
-7
@@ -58,8 +58,7 @@ GOOS=linux GOARCH=$goarch GOARM=$goarm CGO_ENABLED=0 go build -ldflags "$LDFLAGS
|
||||
make --no-print-directory install-files DESTDIR="$root" PREFIX=/usr \
|
||||
UNITDIR=/usr/lib/systemd/system JARLD_BIN="$work/jarld" JARL_BIN="$work/jarl" >/dev/null
|
||||
|
||||
# Debian's machine-readable copyright file, from LICENSE and the bundled
|
||||
# font's licence (the font is embedded in jarld's web UI).
|
||||
# Debian's machine-readable copyright file, from LICENSE.
|
||||
indent() { sed -e 's/^$/./' -e 's/^/ /' "$1"; }
|
||||
{
|
||||
echo "Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/"
|
||||
@@ -69,11 +68,6 @@ indent() { sed -e 's/^$/./' -e 's/^/ /' "$1"; }
|
||||
echo "Copyright: $(sed -n 's/^Copyright (c) //p' LICENSE)"
|
||||
echo "License: Expat"
|
||||
indent LICENSE
|
||||
echo
|
||||
echo "Files: internal/web/static/assets/fonts/*"
|
||||
echo "Copyright: 2020 The Cinzel Project Authors"
|
||||
echo "License: OFL-1.1"
|
||||
indent internal/web/static/assets/fonts/Cinzel-OFL.txt
|
||||
} > "$root/usr/share/doc/jarl/copyright"
|
||||
|
||||
for f in postinst prerm postrm; do
|
||||
|
||||
Reference in new issue
Block a user