Bug 8424 - Important info is cropped out from "ThinLinc startup" diagram
Summary: Important info is cropped out from "ThinLinc startup" diagram
Status: RESOLVED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Documentation (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.18.0
Assignee: Bugzilla mail exporter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-11 10:15 CEST by William Sjöblom
Modified: 2024-09-18 14:56 CEST (History)
0 users

See Also:
Acceptance Criteria:


Attachments
Overly cropped SVG (4.13 KB, image/svg+xml)
2024-09-11 10:15 CEST, William Sjöblom
Details

Description William Sjöblom cendio 2024-09-11 10:15:17 CEST
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.
Comment 1 William Sjöblom cendio 2024-09-17 16:43:13 CEST
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.
Comment 2 William Sjöblom cendio 2024-09-17 16:50:00 CEST
> 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"/>
Comment 3 William Sjöblom cendio 2024-09-18 11:18:08 CEST
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.
Comment 4 William Sjöblom cendio 2024-09-18 11:26:45 CEST
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?

Note You need to log in before you can comment on or make changes to this bug.