archimatetool / archi

Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
MIT License
914 stars 267 forks source link

Export as Image to SVG/PDF does not render tab characters #975

Closed johmut closed 8 months ago

johmut commented 8 months ago

Version of Archi

5.1.0

Archi Plug-ins

coArchi 0.8.8

Operating System

Windows 10 Professional

Expected Behaviour

Note Label Expression Text formatted (indented/aligned) with tabs should render in the exported .svg in the same way as in the Archi Diagram

Actual Behaviour

All text and parameters are exported, yet the tabbed indentation is ignored and thus the formatting & alignment is lost.

Steps to Reproduce the Behaviour

  1. On a diagram
  2. Export
  3. View as Image

As shown in the Archi Diagram As shown in the exported  svg

Phillipus commented 8 months ago

Can you please supply a simple example model so I can try to reproduce this?

Doe export as png work?

johmut commented 8 months ago

Hi Phil, Export as .PNG works as expected.

I have attached the Label Expression, where you can see the tabs used to align the 2nd column of parameters.

$view{name}     
Document:: $view{property:Object:RMSLocator}        Version: $view{property:Object:Version} 
Responsible Publisher: $view{property:Object:Owned by}  Maintainer: $view{property:Object:Modified by}  
Validation: Status: $view{property:Object:Status}       Governance Body: $view{property:Object:Validated by}    
Architecture Layer: $view{property:Object:Layer}        Plateau: $view{property:Object:Plateau}

I'll try to isolate the diagram in a model I can attach...

edited by JB to add code bloc

Phillipus commented 8 months ago

This is not to do with Label Expressions. I can reproduce this by adding this text directly into a note:

Hello       World

Export to PNG is OK, but it turns out the the SVG adapter is not handling tabs.

I'll search the web to see if this is a known issue, but right now I can't fix this as it uses third-party code.

Phillipus commented 8 months ago

It turns out that the SVG export code (this is third-party code) uses the java.awt.Graphics2D#drawString() method which does not render tabs. Unfortunately, there's nothing I can do about that. A workaround is to use spaces instead of tabs.

Phillipus commented 8 months ago

I'll close this one as I can't fix.