Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagrams: Cairo SVG Enforcing Document Sizes? #13

Open
tajmone opened this issue Feb 17, 2021 · 1 comment
Open

Diagrams: Cairo SVG Enforcing Document Sizes? #13

tajmone opened this issue Feb 17, 2021 · 1 comment
Labels
🔨 Dia Tool: Dia Diagram Editor 🔬 research Issue requires further researching ⭐ diagrams Topic: diagram images ⭐ SVG Topic: SVG images
Milestone

Comments

@tajmone
Copy link
Collaborator

tajmone commented Feb 17, 2021

I've noticed that in the Diagrams README (Markdown) the SVG images generated via the Cairo SVG format tend to have specific sizes, whereas before they where shown as large as the page would allow them to.

This seems to indicate that Cairo SVG adds size info to the generated SVG images.

We need to check if this can be a problem in some output formats, and whether in the HTML edition we can simply enforce custom sizes by specifying a width percentage value relative to the contents width.

If not, we might have to enforce some document size in the source Dia projects, and devise a way to preserve some rational proportions between the various diagrams.

Here's the difference, where the first image is in the Cairo SVG format:

default SVG

and the second one in the default Dia SVG format used before:

Cairo SVG

As you can see, the former doesn't stretch to occupy the full available width, while the latter does.

Currently, the AsciiDoc book enforces custom width values on the images, so it's hard to tell whether the SVG diagrams are stretching beyond their predefined sizes; so we'll need to carry out some tests to evaluate the situation and whether we can safely control the diagrams' widths using relative values (page percentage) or not.

@tajmone tajmone added 🔨 Dia Tool: Dia Diagram Editor ⭐ SVG Topic: SVG images ⭐ diagrams Topic: diagram images labels Feb 17, 2021
@tajmone tajmone added this to the Illustrations milestone Feb 17, 2021
@tajmone
Copy link
Collaborator Author

tajmone commented Feb 17, 2021

A first glance at the above diagram in the generated HTML book seems to indicate that AsciiDoc allows us to control the SVGs' effective size by custom width settings, for the above diagram (Figure 6 in the book) is clearly wider than the Cairo SVG image shown in markdown.

In the book source, the diagram is set to scale to 80%:

.Repository Content
image::repository-content.svg[id="fig.repository-content",scaledwidth="80%",width="80%"]

which from the preview document seems to indicate that any size info embedded in the original SVG is being overridden by the custom value shown above.

I'm not sure if the same applies to all other output formats (PDF, etc.).


References

tajmone added a commit that referenced this issue Feb 17, 2021
Update TODOs list in Dia's README:

- Cairo SVG images carrying size info (see #13).
- Annotate diagrams that should only be translated if we decide to also
  translate commits from the book's examples (see #1).
@tajmone tajmone added the 🔬 research Issue requires further researching label Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 Dia Tool: Dia Diagram Editor 🔬 research Issue requires further researching ⭐ diagrams Topic: diagram images ⭐ SVG Topic: SVG images
Projects
None yet
Development

No branches or pull requests

1 participant