Repository navigation
Conversation
smithp35
reviewed
Oct 20, 2026
smithp35
left a comment
Contributor
There was a problem hiding this comment.
One small comment on validating the path, but otherwise LGTM. Our SVG files look to be using DejaVuSans.
| # Use matplotlib's bundled font dir as we can't trust the standard host paths | ||
| # to contain the font we want. | ||
| FONT_DIR="$(python3 -c 'from pathlib import Path; import matplotlib; print(Path(matplotlib.get_data_path()) / "fonts" / "ttf")')" | ||
|
|
Contributor
There was a problem hiding this comment.
Although I wouldn't expect the /fonts/ttf dir to change. It could be worth a test that the directory in ${FONT_DIR} exists and exit with an error message if it doesn't. May save us some time debugging if anything goes wrong.
We currently don't specify what font we should use for the PDF documents, and so we use a fallback font. But it depends on your specific environment which font is picked. This doesn't just impact the look of the text. Some fonts don't have glyphs for certain characters. For example Verdana on MacOs doesn't have glyphs for →, ⊂ and ⊆. This was because stdFont and stdBold were not defined in the stylesheet. So we set those to DejaVu Sans, which is what we use in CI, which fixes the above problems.
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.
We currently don't specify what font we should use for the PDF documents, and so we use a fallback font. But it depends on your specific environment which font is picked.
This doesn't just impact the look of the text. Some fonts don't have glyphs for certain characters. For example Verdana on MacOs doesn't have glyphs for →, ⊂ and ⊆.
This was because stdFont and stdBold were not defined in the stylesheet. So we set those to DejaVu Sans, which is what we use in CI, which fixes the above problems.