| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Graphviz diagrams set Helvetica on every node and schema label, in two hardcoded places, so a caller had no way to ask for another typeface. A new setting, display.diagram_fontname (environment variable DJ_DIAGRAM_FONTNAME), names the face for both. It defaults to Helvetica, so diagrams are unchanged for anyone who does not set it. An empty name is refused, since Graphviz would fall back to Times. The issue proposed a key in the diagram themes; this is a display setting beside diagram_direction and diagram_theme instead, so the themes still change colors only. Graphviz sizes node boxes with the face it finds on the machine doing the rendering, and a face that machine lacks changes the text metrics and so the layout. The setting is for callers who control that environment. For a published figure, restyling the emitted SVG with a CSS font stack remains the safer route. Mermaid output is unchanged. Mermaid has a font option of its own, but make_mermaid() leaves the typeface to the Mermaid host, as it already leaves dark mode, so neither display.diagram_fontname nor display.diagram_theme applies to it. Its docstring listed the Helvetica font among the Graphviz features with no Mermaid equivalent; it now says the typeface is left to the host. The tests check, on MySQL and PostgreSQL, that every fontname in the dot source is Helvetica by default, and that with the setting each is the configured face, in the same number of places, the SVG names that face, and the Mermaid output does not change. Both fail without the change. The docs' guidance that diagram themes do not change fonts stays true; it should also name this setting, with the layout caveat. Closes #1539.
There was a problem hiding this comment.
Thanks @dimitri-yatsenko, clean and well-scoped. Keeping the font out of the themes makes sense, and the layout caveat in the docstring is helpful.
Verified locally:
✅ Both hardcoded Helvetica sites (nodes + schema cluster label) now read display.diagram_fontname; no other fontname is set and edges carry no text labels, so nothing falls back to Times
✅ New fontname unit tests pass
Two small nits, neither blocking:
On the docs side, I'll add display.diagram_fontname (with the layout caveat) when the diagram config docs are updated.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Graphviz diagrams set Helvetica on every node and schema label, in two hardcoded places, so a caller had no way to ask for another typeface. A new setting, display.diagram_fontname (environment variable DJ_DIAGRAM_FONTNAME), names the face for both. It defaults to Helvetica, so diagrams are unchanged for anyone who does not set it. An empty name is refused, since Graphviz would fall back to Times.
The issue proposed a key in the diagram themes; this is a display setting beside diagram_direction and diagram_theme instead, so the themes still change colors only. Graphviz sizes node boxes with the face it finds on the machine doing the rendering, and a face that machine lacks changes the text metrics and so the layout. The setting is for callers who control that environment. For a published figure, restyling the emitted SVG with a CSS font stack remains the safer route.
Mermaid output is unchanged. Mermaid has a font option of its own, but make_mermaid() leaves the typeface to the Mermaid host, as it already leaves dark mode, so neither display.diagram_fontname nor display.diagram_theme applies to it. Its docstring listed the Helvetica font among the Graphviz features with no Mermaid equivalent; it now says the typeface is left to the host.
The tests check, on MySQL and PostgreSQL, that every fontname in the dot source is Helvetica by default, and that with the setting each is the configured face, in the same number of places, the SVG names that face, and the Mermaid output does not change. Both fail without the change.
The docs' guidance that diagram themes do not change fonts stays true; it should also name this setting, with the layout caveat.
Closes #1539.