Repository navigation
Conversation
The critique agent rasterized SVGs with cairosvg, which on Windows
installs and then fails at import because there is no libcairo-2.dll.
muriel.rasterize keeps cairosvg first and falls back to ImageMagick 7,
whose Windows build carries librsvg and Cairo itself.
ImageMagick's librsvg 2.40 tries only the first family of a font stack
and rounds weight 600 to Bold. So before the render each stack is
resolved against `magick -list font`, with ui-sans-serif / system-ui /
ui-monospace mapped to the faces a browser picks. On Windows,
intermediate weights become their named faces ("Segoe UI Semibold"),
chosen by the CSS weight-matching rule. The CLI reports the backend,
each substitution, leftover font fallbacks, and a note when <image>
elements are present, since this librsvg drops them.
The critique agent, svg channel, and repo permission allowlist now
point at `python -m muriel.rasterize`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in CHANGELOG.md only: both sides added entries at the top of Unreleased/Added. Kept all of them, the rasterize entry first. muriel/__main__.py merged cleanly (rasterize and collection both registered). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in CHANGELOG.md only: main added the sparklines entry at the top of Unreleased/Added. Kept both, the rasterize entry first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in CHANGELOG.md only: main added the human-capabilities, semantic-zoom and node-CI entries at the top of Unreleased/Added. Kept all of them, the rasterize entry first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The critique agent rasterized SVGs with
cairosvg. On Windows, cairosvg installs and then fails at import because Windows has nolibcairo-2.dll, so SVG audits there lose their visual pass.What
python -m muriel.rasterize in.svg -o out.png(alsomuriel rasterize):OSErrorat import (installed, no Cairo) counts as unavailable, not as a crash.magick) otherwise. Its Windows build carries librsvg and Cairo itself, so it needs nothing else installed.The ImageMagick rung runs a font-pinning pass first, because its librsvg 2.40 has two problems with muriel's output:
font-familystack. muriel's generators lead withui-sans-serif, -apple-system, system-ui, …, which never match, so every label fell back to a generic "Sans" with anexpect ugly outputwarning. Stacks now resolve againstmagick -list font(attributes, inline styles,<style>sheets), and the CSS keywords map to the faces a browser picks (system-ui→ Segoe UI,monospace→ Consolas).<style>sheet sets fonts, or when the family lists only one face (a variable font).The output reports the backend, each substitution with counts, any font fallbacks left in the render, and a note when the SVG has
<image>elements. ImageMagick's librsvg drops or discolors those, so the note points tomuriel capture(Chromium).On boxes where cairosvg works, output is unchanged: pinning applies only on the ImageMagick rung.
Also updated: the critique agent now calls
python -m muriel.rasterizeinstead ofcairosvg, with matching changes to the svg channel doc, thesquintdocstring, the repo's.claude/settings.jsonallowlist, and CHANGELOG.Test plan
tests/test_rasterize.py: 40 tests. Pinning runs against a fixture font list, so it works on any OS. The ImageMagick render tests skip withoutmagick.comparison-pair-serp.svgandcomparison-pair-trace.svgon Windows. Unpinned, the headings fell back to a wide bold Sans (5 fallback warnings). Pinned, they render in Segoe UI Semibold and the mono cells in Consolas, with no warnings.OSErrorcatch around the existing call.🤖 Generated with Claude Code