Skip to content

refactor(ui): source the Go fonts from go-opentype, not golang.org/x/image - #97

Merged
tannevaled merged 1 commit into
mainfrom
feat/drop-ximage
Aug 8, 2026
Merged

refactor(ui): source the Go fonts from go-opentype, not golang.org/x/image#97
tannevaled merged 1 commit into
mainfrom
feat/drop-ximage

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Why

Deleting the private x/image rasteriser (#96) left the reader importing golang.org/x/image for exactly two things: the Go Regular and Go Bold byte blobs. Font data, not code — and go-opentype/fonts is where this ecosystem keeps font data.

What

go-opentype/fonts v0.7.0 now bundles the family's designed weights, so ui/text.go takes goregular.TTF and goregular.BoldTTF from there.

The reader's own code no longer imports golang.org/x/image anywhere, tests included. It stays in the module graph as an indirect dependency, because go-iconoir/iconoir needs x/image/vector to rasterise its SVG paths — that is iconoir's call, not something this repo can drop.

Rendering is unchanged, provably

The bundled Go-Regular is byte-identical to x/image's (sha256 197d9f37…, 148672 bytes) and Go Bold comes from the same upstream release, so this is a pure sourcing change.

All 45 rendered snapshots are byte-identical before and after — cmp reports 0 differing files, not "0.00% rounded".

Verification

go test -race over the gated packages → 100.0% of statements, race-clean.

🤖 Generated with Claude Code

…image

Deleting the private x/image rasteriser left the reader importing
golang.org/x/image for exactly two things: the Go Regular and Go Bold byte
blobs. Font data, not code — and go-opentype/fonts is where this ecosystem keeps
font data.

go-opentype/fonts v0.7.0 now bundles the family's designed weights, so
ui/text.go takes goregular.TTF and goregular.BoldTTF from there.

The reader's own code no longer imports golang.org/x/image ANYWHERE, tests
included. It stays in the module graph as an indirect dependency, because
go-iconoir/iconoir needs x/image/vector to rasterise its SVG paths — that is
iconoir's call, not something this repo can drop.

Rendering is unchanged, and provably so rather than plausibly: the bundled
Go-Regular is byte-identical to x/image's (sha256 197d9f37…, 148672 bytes) and
Go Bold comes from the same upstream release, so all 45 rendered snapshots are
BYTE-IDENTICAL before and after — 0 differing pixels, not 0.00% rounded.

100% coverage held; race-clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 77f5ca5 into main Aug 8, 2026
11 checks passed
@tannevaled
tannevaled deleted the feat/drop-ximage branch August 8, 2026 21:42
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