Created attachment 1235 [details] Overly cropped SVG The diagram profiles-xstartup.svg (labeled "ThinLinc startup") crops out parts of the /opt/thinlinc/etc/xstartup.d/ and /opt/thinlinc/etc/xlogout.d/ paths. This looks bad and may confuse users. See attached SVG file.
Did some preliminary research: * Building the SVG inside cenbuild results in bad cropping * Building the SVG outside of cenbuild results in a good image (on Fedora 40 running the same dia version as cenbuild) Comparing the "locally" built SVG with the cenbuild built one, the difference is that the everything has been shifted to the right on the cenbuild built one. On the locally built one, there is zero margin on the left hand side of the SVG.
> wilsj@wilsj ➜ ~/w/g/d/external cbrun x86_64 dia --filter=svg --export="bad.svg" images/profiles-xstartup.dia > images/profiles-xstartup.dia --> bad.svg > wilsj@wilsj ➜ ~/w/g/d/external dia --filter=svg --export="good.svg" images/profiles-xstartup.dia > images/profiles-xstartup.dia --> good.svg > wilsj@wilsj ➜ ~/w/g/d/external diff -u bad.svg good.svg > --- bad.svg 2024-09-17 16:46:59.742568338 +0200 > +++ good.svg 2024-09-17 16:47:09.395704556 +0200 > @@ -1,6 +1,6 @@ > <?xml version="1.0" encoding="UTF-8" standalone="no"?> > <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/PR-SVG-20010719/DTD/svg10.dtd"> > -<svg width="28cm" height="31cm" viewBox="60 13 543 610" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> > +<svg width="30cm" height="31cm" viewBox="60 12 591 611" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> > <g> > <rect style="fill: #ffffff" x="61" y="79" width="258" height="60"/> > <rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="61" y="79" width="258" height="60"/>
This seems to be the current situation: When run inside cenbuild, dia miscalculates with width of the "monospace" font and assumes that the monospace text is narrower than it actually becomes when the SVG is rendered. This may possibly be due to missing fonts in cenbuild. Even if the above would be fixed, we'd still be left with a robustness issue. As the font width assumed by dia depends on the fonts available when exporting the SVG and the font width when the SVG is rendered depends on the fonts available to the SVG renderer, it will be down to luck whether or not the SVG is badly cropped. We're therefore left with a choice, either we fix the cenbuild dia issues to provide a better guess of the browser-side font width, or we roll back to using raster images.
A potential quick-fix would be to just force the viewport of the exported SVG to become wider. For example by surrounding the diagram with a box. Maybe such a box could even be transparent?
Before the fix, we could also see the issue. When compared with the recent Jenkins build, the image looks good. We agree that the fix is reasonable, and putting more energy into solving the issue would not have been worth it.