Rendering Issues in Reports when going Cross-Platform

Started by tilman, September 23, 2020, 12:56:12 PM

Previous topic - Next topic

tilman

Hi,

and first of all hello. I'm a new forum user and I have been using Archi for quite some time now. I like the tool a lot since it makes working with Archimate standard so easy and straight forward! I think my most used tool is the magic connector - thanks to whomever invited that thing!

Recently, I have been running into an issue with the reports and I'm just posting this because I hope that somebody might know the answer. Based on the collaboration plugin I've built a workflow that checks out an updated archimate model on GIT push and uses the html.createReport CLI to generate a fresh set of diagrams which are in the next step published on a confluence page. This all works great and it was quite easy to get it going. The only thing that's beyond expectations is related to fonts. In it's standard setting, Archi uses the font "Segoe UI Regular 9pt" on my windows machine and this is what I use. When exporting a sample diagram in windows, the exported image matches identical to what one sees in Archi, see export-windows.png.



When running the automated workflow on an ubuntu linux host that has the TTF font installed, the export changes quite a lot, see export-ubuntu.png.Things I have observed were a "bold look" (font seems to be rendered bold), line breaks and text that is wrongly displayed because letters are not fully rendered. Last point you can see in the Business Process "Continuous Improvement Handling" where the lower part of the 'g' is missing. I've seen more radical rendering issues but in the end it boils down to the three points above.



I'm wondering if anybody else has similar issues when going x-platform or even better if there already is a solution for this?

BRTL

Phil Beauvoir

#1
Hi, welcome.

When a default font is set for an object the font that is used is taken from Archi's global preferences. On Linux the default font is "Sans 9".

To use a particular font you have to either set it for each object, or set the preference for the default font in Preferences -> Colours and Fonts -> Fonts -> "Diagram objects and connections". This setting is stored in the file <user_home>/.archi4/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.archimatetool.editor.prefs

Edit: you say you have the TTF installed. Did you check whether this font is being picked up on the Linux installation by running Archi? I know I experienced some issues installing TTF on Linux and Archi did not register them.
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

tilman

Thanks Phil,

based on the insight you shared, I tried two things:

1. echo "defaultViewFont=1|Segoe UI|9.0|0|WINDOWS|1|0|0|0|0|0|0|0|0|1|0|0|0|0|Segoe UI" > $HOME/.archi4/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.archimatetool.editor.prefs
2. Forcefully setting all objects inside the diagram to "Segoe UI Regular 9Pt"

The export behavior is still unchanged though. I noticed that when I select another font inside Windows, the font is indeed picked up when running an export on Ubuntu. But also here the rendered font looks different.

BRTL

tilman

WRT to your edit - yep I'm pretty sure the font is available. fc-list shows them as being in place, see below. Also, other custom fonts that I copied from Windows to Ubuntu somehow work but look slightly different when exported..


$ fc-list | grep Segoe
/usr/share/fonts/truetype/segoeuisl.ttf: Segoe UI,Segoe UI Semilight:style=Semilight,Regular
/usr/share/fonts/truetype/segoeuib.ttf: Segoe UI:style=Fett,Negreta,tučné,fed,Έντονα,Bold,Negrita,Lihavoitu,Gras,Félkövér,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,Полужирный,Fet,Kalın,Krepko,Lodia
/usr/share/fonts/truetype/segoescb.ttf: Segoe Script:style=Bold
/usr/share/fonts/truetype/segoeui.ttf: Segoe UI:style=Standard,Normal,obyčejné,Κανονικά,Regular,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
/usr/share/fonts/truetype/segoesc.ttf: Segoe Script:style=Standard,Normal,obyčejné,Κανονικά,Regular,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
/usr/share/fonts/truetype/segoepr.ttf: Segoe Print:style=Regular
/usr/share/fonts/truetype/segoeuiz.ttf: Segoe UI:style=Fett Kursiv,Negreta cursiva,tučné kurzíva,fed kursiv,Έντονα Πλάγια,Bold Italic,Negrita Cursiva,Lihavoitu Kursivoi,Gras Italique,Félkövér dőlt,Grassetto Corsivo,Vet Cursief,Halvfet Kursiv,Pogrubiona kursywa,Negrito Itálico,Полужирный Курсив,Tučná kurzíva,Fet Kursiv,Kalın İtalik,Krepko poševno,Lodi etzana
/usr/share/fonts/truetype/segoeprb.ttf: Segoe Print:style=Bold
/usr/share/fonts/truetype/segoeuil.ttf: Segoe UI,Segoe UI Light:style=Light,Regular
/usr/share/fonts/truetype/segoeuii.ttf: Segoe UI:style=Italic,Cursiva,kurzíva,kursiv,Πλάγια,Kursivoitu,Italique,Dőlt,Corsivo,Cursief,Kursywa,Itálico,Курсив,İtalik,Poševno,Etzana

Phil Beauvoir

If you do a manual HTML Report in Linux do the fonts look correct?
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

tilman

I just changed the font to Comic Sans MS 9Pt to see if Archi picks up the right font. Indeed it does, as you can see below. But again there are artifacts. In this particular scenario rendering on Linux actually fits better than on Windows. Since I don't have an Xserver on that Ubuntu host I'm unable to run Archi GUI there. I might try to get this running over SSH..


Phil Beauvoir

When Archi creates a HTML report or exports a selected View as an image it renders the View on the current Display and created a PNG file from that. Could it be the virtual Display you are using? Other than that, this is one of those issues that is hard to diagnose.
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

tilman

Okay, so now I used an X11 remote display to run Archi from the server on a Windows X11 server (VcXsrv). The result looks pretty much the same as the automated workflow (which just uses Xvfb), see attached screenshot. Not sure what's causing the issue here but since we now have seen two different Xservers and multiple fonts I would argue it may be a different root cause. The Java JRE versions are both identical - I'm just using the bundled ones AdoptOpenJDK (build 11.0.3+7) of Archi 4.7.1 here. This is mysterious.  :)


Phil Beauvoir

#8
What about if you do a simple "Export View As Image..."? rather than generating a HTML report. Are the fonts different then?

Is the problem only when you generate the report from the CLI?

Another setting to try is in Preferences - > General -> "Export Images at double scale".

Edit - remember that if the font is different than the expected one, then as the font size/kerning/etc is different the text might not fit inside the box.

Edit 2 - fonts will vary to some extent on different OSs. If the font looks different in Archi itself on Linux than Windows then the exported image will reflect that.
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Jean-Baptiste Sarrodie

Hi,

This is not related to Archi but the OS.

Even if fonts are the same, font engines are not the same on different OS (Windows uses ClearType while Linux uses FreeType). This means that actual font rendering is different, leading to the issue you're facing.

Here is an interresting reading on this topic:https://pandasauce.org/post/linux-fonts/

You might try to setup your linux box in such a way that it uses a recent version of FreeType with ClearType rendering activated, but even in this case this is not a real ClearType engine but only a similar approach (there are patents issues behind), so I guess you'll still experience some issues.

MS fonts have usually been designed to work on Windows and not on other OS, so you might want to try other fonts like Roboto and see if the issue is the same.

Regards,

JB
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.