Skip to content

Commit

Permalink
refactor(tooling): Swap out hack job to change the sample background …
Browse files Browse the repository at this point in the history
…for an actual SVG tool

Mutool changed its output, so our `sed` trick stopped working to replace
the background. I started futzing with it more and it turns out the
output is radically different, so I just went ahead and used real SVG
tooling. First to add the background and resize to match the old preview
(so tools like `lukaj` can preview the difference) then to compress and
normalize a bit.

I opted against updating the output because it's 1/2 MB of content with
no meaningful changes for this release. We changed lots of stuff in
other languages, but this particular preview is visually identical even
if we re-generate it with the new encodings.
  • Loading branch information
alerque committed Sep 20, 2024
1 parent 302a906 commit 8621553
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fontship.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ endef
_scour_args = --quiet --set-precision=4 --remove-metadata --enable-id-stripping --strip-xml-prolog --strip-xml-space --no-line-breaks --no-renderer-workaround

preview.svg: $(DOCSDIR)/preview.pdf
mutool draw -r 200 -F svg $< 1 |
sed -e '/^<g /a <rect width="100%" height="100%" fill="white" />' > $@
mutool draw -r 266.66 -F svg $< 1 |
rsvg-convert -f svg --background-color=white --page-width=1522 --page-height=1102 |
svgo --pretty --multipass -p 4 - -o $@

install-dist: install-dist-$(PROJECT)

Expand Down

0 comments on commit 8621553

Please sign in to comment.