Skip to content

feat(logo): add --outline-text for font-independent wordmarks - #21

Merged
bernardladenthin merged 1 commit into
mainfrom
claude/20260717_01
Jul 17, 2026
Merged

feat(logo): add --outline-text for font-independent wordmarks#21
bernardladenthin merged 1 commit into
mainfrom
claude/20260717_01

Conversation

@bernardladenthin

Copy link
Copy Markdown
Owner

Summary

  • Add an opt-in --outline-text mode to both logo generators that emits the wordmark as <path> outlines instead of <text> + a base64-embedded font.
  • The embedded MartianMono-Regular.ttf is ~64 KB — about 98% of each generated SVG. Outlining converts only the glyphs actually used, dropping each file to ~13–16 KB with no font and no <text> at all.
  • New shared helper logolib.text_to_path_d() (fontTools SVGPathPen + TransformPen, y-flipped per-glyph affine; advances from hmtx so glyphs land on the exact same x-positions as the <text> layout). fontTools is imported lazily, so it's only required when --outline-text is used.
  • srcmorph's feGaussianBlur "morph" is preserved by moving the filters from the <text> onto the outlined groups (filters apply to any element).
  • Commit the two generated outlined masters (java-llama-cpp-outlined.svg, srcmorph-outlined.svg) and document the mode + tradeoffs in the logo README.

Default text mode is unchanged — regenerated output is byte-identical to the committed *-generated.svg.

Why

The embedded-font wordmark is already portable, but the outlined variant is ~5× smaller, carries no font binary, and survives renderers that strip <style>/@font-face. It trades away selectable/editable text, so it's opt-in and text stays the default.

Test plan

  • Default (text) mode output byte-identical to committed SVGs (no regression)
  • Outlined SVGs render correctly via resvg with no font present (before/after pixel diff = edge antialiasing only, ~2–3%)
  • srcmorph blur/morph preserved on the outlined m
  • Reviewer visual check of both outlined SVGs

🤖 Generated with Claude Code

https://claude.ai/code/session_01PevG84XGs6qyD1U35LUmpg

Both logo generators embed MartianMono-Regular.ttf as base64 @font-face
(~64 KB, ~98% of each SVG) so the wordmark can stay real <text>. Add an
opt-in --outline-text mode that converts only the used glyphs to <path>
outlines via a shared logolib.text_to_path_d() helper (fontTools
SVGPathPen + TransformPen, baking a y-flipped per-glyph affine). The
result carries no font and no <text>, dropping each file to ~13-16 KB.

For srcmorph the feGaussianBlur morph is preserved by moving the filters
from the <text> onto the outlined groups. Default text mode is unchanged
(byte-identical output) and fontTools is imported lazily, so it is only
required when --outline-text is used.

Also commit the two generated outlined SVGs and document the mode and its
tradeoffs (not selectable/editable, but smaller, font-independent, and
robust in renderers that strip <style>/@font-face) in the logo README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PevG84XGs6qyD1U35LUmpg
@bernardladenthin
bernardladenthin merged commit aacbc6d into main Jul 17, 2026
2 checks passed
@bernardladenthin
bernardladenthin deleted the claude/20260717_01 branch July 17, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant