docs(readme): add wordmark banner and badges to the README header

Replace the small logo and plain title with a banner that pairs the app
icon with a monoline "reims-go" wordmark (light and dark versions picked
by GitHub's theme), a two-line tagline, and status badges.

scripts/brand/wordmark.py draws the wordmark from circles and lines and
writes the banners plus standalone assets/wordmark-{light,dark}.svg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
千川白浪andClaude Opus 5.5 committed 2026-11-29 20:58:43 -07:00
1 parent 464ff5683f
commit 0802f77705
7 files changed
+339 -6

No files matched your search

+68
View File
@@ -0,0 +1,68 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 743 180" width="743" height="180" role="img" aria-label="Reims-Go"><svg x="0" y="0" width="180" height="180" viewBox="0 0 1024 1024">
<defs>
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" stop-color="#3b8cff"/>
<stop offset="0.55" stop-color="#2f5bea"/>
<stop offset="1" stop-color="#3b1fb8"/>
</linearGradient>
<linearGradient id="gloss" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#ffffff" stop-opacity="0.28"/>
<stop offset="0.45" stop-color="#ffffff" stop-opacity="0"/>
</linearGradient>
<linearGradient id="sky" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#6d5dfc"/>
<stop offset="0.45" stop-color="#ff7a9a"/>
<stop offset="0.8" stop-color="#ffb86b"/>
</linearGradient>
<linearGradient id="lake" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#2f6bff"/>
<stop offset="1" stop-color="#1a2a8f"/>
</linearGradient>
<linearGradient id="bolt" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#ffe14d"/>
<stop offset="1" stop-color="#ff9f0a"/>
</linearGradient>
<clipPath id="screen">
<rect x="252" y="372" width="520" height="318" rx="26"/>
</clipPath>
<filter id="shadow" x="-20%" y="-20%" width="140%" height="150%">
<feDropShadow dx="0" dy="22" stdDeviation="26" flood-color="#0b0d3a" flood-opacity="0.35"/>
</filter>
<filter id="iconShadow" x="-10%" y="-10%" width="120%" height="125%">
<feDropShadow dx="0" dy="14" stdDeviation="16" flood-color="#000000" flood-opacity="0.22"/>
</filter>
</defs>
<!-- squircle base -->
<g filter="url(#iconShadow)">
<rect x="80" y="80" width="864" height="864" rx="200" fill="url(#bg)"/>
<rect x="80" y="80" width="864" height="864" rx="200" fill="url(#gloss)"/>
</g>
<!-- VM window -->
<g filter="url(#shadow)">
<rect x="220" y="268" width="584" height="454" rx="52" fill="#f7f8fc"/>
</g>
<circle cx="280" cy="322" r="17" fill="#ff5f57"/>
<circle cx="332" cy="322" r="17" fill="#febc2e"/>
<circle cx="384" cy="322" r="17" fill="#28c840"/>
<!-- guest display: a lake at dusk -->
<g clip-path="url(#screen)">
<rect x="252" y="372" width="520" height="318" fill="url(#sky)"/>
<circle cx="600" cy="540" r="44" fill="#fff3d6" opacity="0.9"/>
<path d="M252 560 L340 470 L400 520 L480 430 L560 505 L620 465 L700 530 L772 480 L772 600 L252 600 Z" fill="#2b2d7a"/>
<path d="M252 585 L330 530 L420 575 L500 520 L590 570 L672 535 L772 580 L772 610 L252 610 Z" fill="#1c1f5e"/>
<rect x="252" y="598" width="520" height="92" fill="url(#lake)"/>
<rect x="560" y="616" width="80" height="6" rx="3" fill="#fff3d6" opacity="0.7"/>
<rect x="574" y="636" width="52" height="6" rx="3" fill="#fff3d6" opacity="0.5"/>
<rect x="586" y="656" width="28" height="6" rx="3" fill="#fff3d6" opacity="0.35"/>
</g>
<!-- GPU acceleration badge -->
<g filter="url(#shadow)">
<circle cx="776" cy="724" r="128" fill="#16182e"/>
</g>
<circle cx="776" cy="724" r="128" fill="none" stroke="#ffffff" stroke-opacity="0.92" stroke-width="16"/>
<path d="M800 628 L708 744 L768 744 L748 822 L846 700 L784 700 Z" fill="url(#bolt)" stroke="#ffcf3a" stroke-width="6" stroke-linejoin="round"/>
</svg><g transform="translate(206 126)"><defs><linearGradient id="wm" gradientUnits="userSpaceOnUse" x1="376" y1="0" x2="531" y2="0"><stop offset="0" stop-color="#3b8cff"/><stop offset="0.5" stop-color="#6d5dfc"/><stop offset="1" stop-color="#ff7a9a"/></linearGradient><linearGradient id="wmb" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#ffd43b"/><stop offset="1" stop-color="#ff9f0a"/></linearGradient></defs><g fill="none" stroke-width="15" stroke-linecap="round" stroke-linejoin="round"><path d="M7.5 -7.5V-36A24 28.5 0 0 1 31.5 -64.5" stroke="#f4f5fa"/><path d="M50.5 -36H107.5A28.5 28.5 0 1 0 100.18 -16.93" stroke="#f4f5fa"/><path d="M133.5 -64.5V-7.5" stroke="#f4f5fa"/><circle cx="133.5" cy="-94" r="9" fill="#ff7a9a"/><path d="M159.5 -7.5V-36A22 28.5 0 0 1 203.5 -36V-7.5M203.5 -36A22 28.5 0 0 1 247.5 -36V-7.5" stroke="#f4f5fa"/><path d="M311.05 -59.02A21 14.25 0 0 0 273.5 -50.25A21 14.25 0 0 0 294.5 -36A21 14.25 0 0 1 315.5 -21.75A21 14.25 0 0 1 277.95 -12.98" stroke="#f4f5fa"/><path d="M340.5 -36H358.5" stroke="#5d6382"/><path d="M440.5 -36A28.5 28.5 0 1 1 440.5 -36.01" stroke="url(#wm)"/><path d="M440.5 -64.5V0A28.5 22.5 0 0 1 387.32 11.25" stroke="url(#wm)"/><path d="M523.5 -36A28.5 28.5 0 1 1 523.5 -36.01" stroke="url(#wm)"/></g></g></svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

+68
View File
@@ -0,0 +1,68 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 743 180" width="743" height="180" role="img" aria-label="Reims-Go"><svg x="0" y="0" width="180" height="180" viewBox="0 0 1024 1024">
<defs>
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" stop-color="#3b8cff"/>
<stop offset="0.55" stop-color="#2f5bea"/>
<stop offset="1" stop-color="#3b1fb8"/>
</linearGradient>
<linearGradient id="gloss" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#ffffff" stop-opacity="0.28"/>
<stop offset="0.45" stop-color="#ffffff" stop-opacity="0"/>
</linearGradient>
<linearGradient id="sky" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#6d5dfc"/>
<stop offset="0.45" stop-color="#ff7a9a"/>
<stop offset="0.8" stop-color="#ffb86b"/>
</linearGradient>
<linearGradient id="lake" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#2f6bff"/>
<stop offset="1" stop-color="#1a2a8f"/>
</linearGradient>
<linearGradient id="bolt" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#ffe14d"/>
<stop offset="1" stop-color="#ff9f0a"/>
</linearGradient>
<clipPath id="screen">
<rect x="252" y="372" width="520" height="318" rx="26"/>
</clipPath>
<filter id="shadow" x="-20%" y="-20%" width="140%" height="150%">
<feDropShadow dx="0" dy="22" stdDeviation="26" flood-color="#0b0d3a" flood-opacity="0.35"/>
</filter>
<filter id="iconShadow" x="-10%" y="-10%" width="120%" height="125%">
<feDropShadow dx="0" dy="14" stdDeviation="16" flood-color="#000000" flood-opacity="0.22"/>
</filter>
</defs>
<!-- squircle base -->
<g filter="url(#iconShadow)">
<rect x="80" y="80" width="864" height="864" rx="200" fill="url(#bg)"/>
<rect x="80" y="80" width="864" height="864" rx="200" fill="url(#gloss)"/>
</g>
<!-- VM window -->
<g filter="url(#shadow)">
<rect x="220" y="268" width="584" height="454" rx="52" fill="#f7f8fc"/>
</g>
<circle cx="280" cy="322" r="17" fill="#ff5f57"/>
<circle cx="332" cy="322" r="17" fill="#febc2e"/>
<circle cx="384" cy="322" r="17" fill="#28c840"/>
<!-- guest display: a lake at dusk -->
<g clip-path="url(#screen)">
<rect x="252" y="372" width="520" height="318" fill="url(#sky)"/>
<circle cx="600" cy="540" r="44" fill="#fff3d6" opacity="0.9"/>
<path d="M252 560 L340 470 L400 520 L480 430 L560 505 L620 465 L700 530 L772 480 L772 600 L252 600 Z" fill="#2b2d7a"/>
<path d="M252 585 L330 530 L420 575 L500 520 L590 570 L672 535 L772 580 L772 610 L252 610 Z" fill="#1c1f5e"/>
<rect x="252" y="598" width="520" height="92" fill="url(#lake)"/>
<rect x="560" y="616" width="80" height="6" rx="3" fill="#fff3d6" opacity="0.7"/>
<rect x="574" y="636" width="52" height="6" rx="3" fill="#fff3d6" opacity="0.5"/>
<rect x="586" y="656" width="28" height="6" rx="3" fill="#fff3d6" opacity="0.35"/>
</g>
<!-- GPU acceleration badge -->
<g filter="url(#shadow)">
<circle cx="776" cy="724" r="128" fill="#16182e"/>
</g>
<circle cx="776" cy="724" r="128" fill="none" stroke="#ffffff" stroke-opacity="0.92" stroke-width="16"/>
<path d="M800 628 L708 744 L768 744 L748 822 L846 700 L784 700 Z" fill="url(#bolt)" stroke="#ffcf3a" stroke-width="6" stroke-linejoin="round"/>
</svg><g transform="translate(206 126)"><defs><linearGradient id="wm" gradientUnits="userSpaceOnUse" x1="376" y1="0" x2="531" y2="0"><stop offset="0" stop-color="#3b8cff"/><stop offset="0.5" stop-color="#6d5dfc"/><stop offset="1" stop-color="#ff7a9a"/></linearGradient><linearGradient id="wmb" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#ffd43b"/><stop offset="1" stop-color="#ff9f0a"/></linearGradient></defs><g fill="none" stroke-width="15" stroke-linecap="round" stroke-linejoin="round"><path d="M7.5 -7.5V-36A24 28.5 0 0 1 31.5 -64.5" stroke="#16182e"/><path d="M50.5 -36H107.5A28.5 28.5 0 1 0 100.18 -16.93" stroke="#16182e"/><path d="M133.5 -64.5V-7.5" stroke="#16182e"/><circle cx="133.5" cy="-94" r="9" fill="#ff7a9a"/><path d="M159.5 -7.5V-36A22 28.5 0 0 1 203.5 -36V-7.5M203.5 -36A22 28.5 0 0 1 247.5 -36V-7.5" stroke="#16182e"/><path d="M311.05 -59.02A21 14.25 0 0 0 273.5 -50.25A21 14.25 0 0 0 294.5 -36A21 14.25 0 0 1 315.5 -21.75A21 14.25 0 0 1 277.95 -12.98" stroke="#16182e"/><path d="M340.5 -36H358.5" stroke="#a3a8bf"/><path d="M440.5 -36A28.5 28.5 0 1 1 440.5 -36.01" stroke="url(#wm)"/><path d="M440.5 -64.5V0A28.5 22.5 0 0 1 387.32 11.25" stroke="url(#wm)"/><path d="M523.5 -36A28.5 28.5 0 1 1 523.5 -36.01" stroke="url(#wm)"/></g></g></svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

+14 -3
View File
@@ -1,13 +1,24 @@
<p align="center">
<a href="https://github.com/Nwflower/Reims-Go">
<img src="./assets/logo.png" width="76" height="76" alt="Reims-Go" />
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./.github/readme/banner-dark.svg" />
<img src="./.github/readme/banner-light.svg" width="440" alt="Reims-Go" />
</picture>
</a>
</p>
<h1 align="center">Reims-Go</h1>
<p align="center">
<strong>Run a GPU-accelerated macOS virtual machine on Windows — prebuilt, ready out of the box.</strong><br />
Built on <a href="https://github.com/steelbrain/reims-vgpu">reims-vgpu</a>: QEMU + WHPX virtualization, with macOS Metal calls run on your Windows GPU through Vulkan.
</p>
<p align="center">
Run a GPU-accelerated macOS virtual machine on Windows — prebuilt, ready out of the box.
<img src="https://img.shields.io/badge/macOS-Tahoe%2026-16182e?logo=apple&logoColor=white" alt="macOS Tahoe 26" />
<img src="https://img.shields.io/badge/host-Windows%2010%20%7C%2011-0078D4?logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0id2hpdGUiIGQ9Ik0wIDMuNCA5LjggMnY5LjRIMHptMTEtMS42TDI0IDB2MTEuM0gxMXpNMCAxMi42aDkuOFYyMkwwIDIwLjZ6bTExIDBoMTNWMjRsLTEzLTEuOHoiLz48L3N2Zz4=" alt="Windows 10 | 11" />
<img src="https://img.shields.io/badge/GPU-Metal%20over%20Vulkan-6d5dfc" alt="Metal over Vulkan" />
<a href="https://github.com/Nwflower/Reims-Go/releases"><img src="https://img.shields.io/github/v/release/Nwflower/Reims-Go?label=release&color=3b8cff" alt="release" /></a>
<a href="https://github.com/Nwflower/Reims-Go/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/Nwflower/Reims-Go/ci.yml?branch=main&label=CI&logo=github" alt="CI" /></a>
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-ff7a9a" alt="license Apache-2.0" /></a>
</p>
<p align="center">
+14 -3
View File
@@ -1,13 +1,24 @@
<p align="center">
<a href="https://github.com/Nwflower/Reims-Go">
<img src="./assets/logo.png" width="76" height="76" alt="Reims-Go" />
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./.github/readme/banner-dark.svg" />
<img src="./.github/readme/banner-light.svg" width="440" alt="Reims-Go" />
</picture>
</a>
</p>
<h1 align="center">Reims-Go</h1>
<p align="center">
<strong>在 Windows 上开一台带 GPU 加速的 macOS 虚拟机——免编译,开箱即用。</strong><br />
基于 <a href="https://github.com/steelbrain/reims-vgpu">reims-vgpu</a>:QEMU + WHPX 虚拟化,macOS 的 Metal 调用经 Vulkan 交给 Windows 显卡执行。
</p>
<p align="center">
在 Windows 上开一台带 GPU 加速的 macOS 虚拟机——免编译,开箱即用。
<img src="https://img.shields.io/badge/macOS-Tahoe%2026-16182e?logo=apple&logoColor=white" alt="macOS Tahoe 26" />
<img src="https://img.shields.io/badge/host-Windows%2010%20%7C%2011-0078D4?logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0id2hpdGUiIGQ9Ik0wIDMuNCA5LjggMnY5LjRIMHptMTEtMS42TDI0IDB2MTEuM0gxMXpNMCAxMi42aDkuOFYyMkwwIDIwLjZ6bTExIDBoMTNWMjRsLTEzLTEuOHoiLz48L3N2Zz4=" alt="Windows 10 | 11" />
<img src="https://img.shields.io/badge/GPU-Metal%20over%20Vulkan-6d5dfc" alt="Metal over Vulkan" />
<a href="https://github.com/Nwflower/Reims-Go/releases"><img src="https://img.shields.io/github/v/release/Nwflower/Reims-Go?label=release&color=3b8cff" alt="release" /></a>
<a href="https://github.com/Nwflower/Reims-Go/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/Nwflower/Reims-Go/ci.yml?branch=main&label=CI&logo=github" alt="CI" /></a>
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-ff7a9a" alt="license Apache-2.0" /></a>
</p>
<p align="center">
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 539 141" width="539" height="141" role="img" aria-label="Reims-Go"><g transform="translate(4 107)"><defs><linearGradient id="wm" gradientUnits="userSpaceOnUse" x1="376" y1="0" x2="531" y2="0"><stop offset="0" stop-color="#3b8cff"/><stop offset="0.5" stop-color="#6d5dfc"/><stop offset="1" stop-color="#ff7a9a"/></linearGradient><linearGradient id="wmb" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#ffd43b"/><stop offset="1" stop-color="#ff9f0a"/></linearGradient></defs><g fill="none" stroke-width="15" stroke-linecap="round" stroke-linejoin="round"><path d="M7.5 -7.5V-36A24 28.5 0 0 1 31.5 -64.5" stroke="#f4f5fa"/><path d="M50.5 -36H107.5A28.5 28.5 0 1 0 100.18 -16.93" stroke="#f4f5fa"/><path d="M133.5 -64.5V-7.5" stroke="#f4f5fa"/><circle cx="133.5" cy="-94" r="9" fill="#ff7a9a"/><path d="M159.5 -7.5V-36A22 28.5 0 0 1 203.5 -36V-7.5M203.5 -36A22 28.5 0 0 1 247.5 -36V-7.5" stroke="#f4f5fa"/><path d="M311.05 -59.02A21 14.25 0 0 0 273.5 -50.25A21 14.25 0 0 0 294.5 -36A21 14.25 0 0 1 315.5 -21.75A21 14.25 0 0 1 277.95 -12.98" stroke="#f4f5fa"/><path d="M340.5 -36H358.5" stroke="#5d6382"/><path d="M440.5 -36A28.5 28.5 0 1 1 440.5 -36.01" stroke="url(#wm)"/><path d="M440.5 -64.5V0A28.5 22.5 0 0 1 387.32 11.25" stroke="url(#wm)"/><path d="M523.5 -36A28.5 28.5 0 1 1 523.5 -36.01" stroke="url(#wm)"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 539 141" width="539" height="141" role="img" aria-label="Reims-Go"><g transform="translate(4 107)"><defs><linearGradient id="wm" gradientUnits="userSpaceOnUse" x1="376" y1="0" x2="531" y2="0"><stop offset="0" stop-color="#3b8cff"/><stop offset="0.5" stop-color="#6d5dfc"/><stop offset="1" stop-color="#ff7a9a"/></linearGradient><linearGradient id="wmb" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#ffd43b"/><stop offset="1" stop-color="#ff9f0a"/></linearGradient></defs><g fill="none" stroke-width="15" stroke-linecap="round" stroke-linejoin="round"><path d="M7.5 -7.5V-36A24 28.5 0 0 1 31.5 -64.5" stroke="#16182e"/><path d="M50.5 -36H107.5A28.5 28.5 0 1 0 100.18 -16.93" stroke="#16182e"/><path d="M133.5 -64.5V-7.5" stroke="#16182e"/><circle cx="133.5" cy="-94" r="9" fill="#ff7a9a"/><path d="M159.5 -7.5V-36A22 28.5 0 0 1 203.5 -36V-7.5M203.5 -36A22 28.5 0 0 1 247.5 -36V-7.5" stroke="#16182e"/><path d="M311.05 -59.02A21 14.25 0 0 0 273.5 -50.25A21 14.25 0 0 0 294.5 -36A21 14.25 0 0 1 315.5 -21.75A21 14.25 0 0 1 277.95 -12.98" stroke="#16182e"/><path d="M340.5 -36H358.5" stroke="#a3a8bf"/><path d="M440.5 -36A28.5 28.5 0 1 1 440.5 -36.01" stroke="url(#wm)"/><path d="M440.5 -64.5V0A28.5 22.5 0 0 1 387.32 11.25" stroke="url(#wm)"/><path d="M523.5 -36A28.5 28.5 0 1 1 523.5 -36.01" stroke="url(#wm)"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

+173
View File
@@ -0,0 +1,173 @@
"""Draws the Reims-Go wordmark and README banners.
The wordmark is monoline lettering: one stroke width, round caps, built
from circles, ellipses and straight lines so it matches the rounded app
icon. Run from the repository root:
python scripts/brand/wordmark.py
It writes assets/wordmark-{light,dark}.svg and
.github/readme/banner-{light,dark}.svg. It needs only the standard library.
"""
import math
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
X = 72.0 # x-height, outer edge to outer edge
INK = {"light": "#16182e", "dark": "#f4f5fa"}
MUTED = {"light": "#a3a8bf", "dark": "#5d6382"}
GRADIENT = ("#3b8cff", "#6d5dfc", "#ff7a9a")
BOLT = ("#ffd43b", "#ff9f0a")
# The style the script writes. Variants used while choosing it:
# joiner: "dash" | "bolt" | "none"; go: "gradient" | "pill"
# dot: "accent" | "ink"; stroke: stroke width.
STYLE = dict(stroke=15.0, joiner="dash", go="gradient", dot="accent")
def f(v):
return ("%.2f" % v).rstrip("0").rstrip(".")
def arc(rx, ry, large, sweep, x, y):
return f"A{f(rx)} {f(ry)} 0 {large} {sweep} {f(x)} {f(y)}"
class Geo:
def __init__(self, w):
self.W, self.H = w, w / 2
self.TOP, self.BOT, self.MID = -X + w / 2, -w / 2, -X / 2
self.R = (X - w) / 2
# Glyphs take the geometry and the left outer edge x, and return
# (outer width, [(role, svg element without paint)]). Roles pick the paint.
def g_r(g, x):
s, rx = x + g.H, 24
return g.W + rx, [("ink", f'<path d="M{f(s)} {f(g.BOT)}V{f(g.MID)}{arc(rx, g.MID - g.TOP, 0, 1, s + rx, g.TOP)}"')]
def g_e(g, x):
c, a = x + g.H + g.R, math.radians(42)
ex, ey = c + g.R * math.cos(a), g.MID + g.R * math.sin(a)
return 2 * g.R + g.W, [("ink", f'<path d="M{f(c - g.R)} {f(g.MID)}H{f(c + g.R)}{arc(g.R, g.R, 1, 0, ex, ey)}"')]
def g_i(g, x):
s = x + g.H
return g.W, [("ink", f'<path d="M{f(s)} {f(g.TOP)}V{f(g.BOT)}"'),
("dot", f'<circle cx="{f(s)}" cy="{f(-X - 22)}" r="{f(g.H + 1.5)}"')]
def g_m(g, x):
s, rx, ry = x + g.H, 22, g.MID - g.TOP
return 4 * rx + g.W, [("ink", f'<path d="M{f(s)} {f(g.BOT)}V{f(g.MID)}{arc(rx, ry, 0, 1, s + 2 * rx, g.MID)}V{f(g.BOT)}'
f'M{f(s + 2 * rx)} {f(g.MID)}{arc(rx, ry, 0, 1, s + 4 * rx, g.MID)}V{f(g.BOT)}"')]
def g_s(g, x):
rx, ry = 21, (g.BOT - g.TOP) / 4
c, up, lo, a = x + g.H + rx, g.TOP + ry, g.BOT - ry, math.radians(38)
sx, sy = c + rx * math.cos(a), up - ry * math.sin(a)
tx, ty = c - rx * math.cos(a), lo + ry * math.sin(a)
return 2 * rx + g.W, [("ink", f'<path d="M{f(sx)} {f(sy)}{arc(rx, ry, 0, 0, c - rx, up)}{arc(rx, ry, 0, 0, c, g.MID)}'
f'{arc(rx, ry, 0, 1, c + rx, lo)}{arc(rx, ry, 0, 1, tx, ty)}"')]
def g_dash(g, x):
return 18 + g.W, [("muted", f'<path d="M{f(x + g.H)} {f(g.MID)}H{f(x + g.H + 18)}"')]
def g_bolt(g, x):
# The icon's bolt, scaled to the x-height and centred on it.
pts = [(800, 628), (708, 744), (768, 744), (748, 822), (846, 700), (784, 700)]
s = (X + 14) / 194
d = "M" + "L".join(f"{f(x + (px - 708) * s)} {f(g.MID + (py - 725) * s)}" for px, py in pts) + "Z"
return 138 * s, [("bolt", f'<path d="{d}"')]
def g_g(g, x):
c, hook, a = x + g.H + g.R, 22.5, math.radians(150)
hx, hy = c + g.R * math.cos(a), hook * math.sin(a)
return 2 * g.R + g.W, [("go", f'<path d="M{f(c + g.R)} {f(g.MID)}{arc(g.R, g.R, 1, 1, c + g.R, g.MID - 0.01)}"'),
("go", f'<path d="M{f(c + g.R)} {f(g.TOP)}V0{arc(g.R, hook, 0, 1, hx, hy)}"')]
def g_o(g, x):
c = x + g.H + g.R
return 2 * g.R + g.W, [("go", f'<path d="M{f(c + g.R)} {f(g.MID)}{arc(g.R, g.R, 1, 1, c + g.R, g.MID - 0.01)}"')]
def wordmark(theme, style=STYLE, gid="wm"):
"""Returns (svg body, width, ascent, descent); the baseline is y=0."""
g = Geo(style["stroke"])
joiner = {"dash": [(g_dash, 10)], "bolt": [(g_bolt, 8)], "none": []}[style["joiner"]]
pill = style["go"] == "pill"
seq = [(g_r, 4), (g_e, 11), (g_i, 11), (g_m, 11), (g_s, 10 if joiner else 14)] + joiner + [(g_g, 11), (g_o, 0)]
paint = {
"ink": f'stroke="{INK[theme]}"',
"muted": f'stroke="{MUTED[theme]}"',
"dot": f'fill="{GRADIENT[2]}"' if style["dot"] == "accent" else f'fill="{INK[theme]}"',
"bolt": f'fill="url(#{gid}b)" stroke="none"',
"go": 'stroke="#ffffff"' if pill else f'stroke="url(#{gid})"',
}
out, x, go0 = [], 0.0, None
for draw, gap in seq:
if draw is g_g:
go0 = x + (14 if pill else 0)
x = go0
width, parts = draw(g, x)
out += [f"{el} {paint[role]}/>" for role, el in parts]
x += width + gap
asc, desc = X + 22 + g.H + 1.5, 22.5 + g.H
pill_el = ""
if pill:
top, bot = -X - 12, desc + 8
x += 14
pill_el = (f'<rect x="{f(go0 - 14)}" y="{f(top)}" width="{f(x - go0 + 14)}" '
f'height="{f(bot - top)}" rx="{f((bot - top) * 0.36)}" fill="url(#{gid})"/>')
asc, desc = max(asc, -top), bot
stops = "".join(f'<stop offset="{i / 2:g}" stop-color="{c}"/>' for i, c in enumerate(GRADIENT))
bolt = "".join(f'<stop offset="{i}" stop-color="{c}"/>' for i, c in enumerate(BOLT))
defs = (f'<defs><linearGradient id="{gid}" gradientUnits="userSpaceOnUse" x1="{f(go0 - (14 if pill else 0))}" '
f'y1="0" x2="{f(x)}" y2="0">{stops}</linearGradient>'
f'<linearGradient id="{gid}b" x1="0" y1="0" x2="0" y2="1">{bolt}</linearGradient></defs>')
body = (f'{defs}{pill_el}<g fill="none" stroke-width="{f(g.W)}" stroke-linecap="round" '
f'stroke-linejoin="round">{"".join(out)}</g>')
return body, x, asc, desc
def standalone(theme, style=STYLE):
body, width, asc, desc = wordmark(theme, style)
pad = 4
w, h = width + 2 * pad, asc + desc + 2 * pad
return (f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {f(w)} {f(h)}" width="{f(w)}" '
f'height="{f(h)}" role="img" aria-label="Reims-Go"><g transform="translate({pad} {f(pad + asc)})">'
f'{body}</g></svg>\n')
def banner(theme, style=STYLE):
logo = (ROOT / "assets/logo.svg").read_text(encoding="utf-8")
icon_body = re.sub(r"^.*?<svg[^>]*>", "", logo, flags=re.S).rsplit("</svg>", 1)[0]
body, width, _, _ = wordmark(theme, style)
icon, gap = 180, 26
w = icon + gap + width + 6
return (f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {f(w)} {icon}" width="{f(w)}" '
f'height="{icon}" role="img" aria-label="Reims-Go">'
f'<svg x="0" y="0" width="{icon}" height="{icon}" viewBox="0 0 1024 1024">{icon_body}</svg>'
f'<g transform="translate({icon + gap} {f(icon / 2 + X / 2)})">{body}</g></svg>\n')
def main():
for theme in ("light", "dark"):
(ROOT / f"assets/wordmark-{theme}.svg").write_text(standalone(theme), encoding="utf-8", newline="\n")
(ROOT / f".github/readme/banner-{theme}.svg").write_text(banner(theme), encoding="utf-8", newline="\n")
if __name__ == "__main__":
main()