79348747

Date: 2025-01-11 19:37:32
Score: 0.5
Natty:
Report link

Ubuntu doesn't have the Times New Roman font by default. This is the default font used by Graphviz, so I was getting poor results when dot layout was done on Ubuntu as compared to Windows or Mac (which come natively with the correct fonts).

The most important thing is to do if you are generating Grapviz images on Ubuntu is:

sudo apt install ttf-mscorefonts-installer1

Beware that will pop up on your terminal an EULA from Microsoft, and you may not see the prompt to respond 'yes'.

However that may not be enough to get consistent results if you have built GraphViz completely by yourself. You may still get anomalous results results unless you have pre-installed certain libraries. So you should also do:

apt-get install --no-install-recommends -y build-essential clang-format cmake git pkg-config autoconf bison libtool dh-python flex d-shlibs debhelper fakeroot freeglut3-dev libgts-dev swig libgtkglext1-dev libglade2-dev libqt5gui5 qt5-qmake qtbase5-dev libann-dev libaa1-dev libdevil-dev libgd-dev libgtk-3-dev ghostscript libgs-dev liblasi-dev libpoppler-dev libpoppler-glib-dev librsvg2-dev libwebp-dev ruby golang-go guile-3.0 guile-3.0-dev lua5.3 liblua5.3-dev libperl-dev php-dev libsodium-dev libargon2-0-dev libpython3-dev ruby-dev tcl-dev python3-venv gcovr lcov shellcheck

The guidance to help me determine the packages needed came from the Gitlab page with the Dockerfile that is used to build Graphviz for testing: https://gitlab.com/graphviz/graphviz/-/blob/main/ci/ubuntu-22.04/Dockerfile )

Once I had done the above apt installs and rebuilt Graphviz, it generated the same layouts on Ubuntu as it does on Mac and Windows.

The above was tested with Graphviz 12.2.1. I am running on ARM architecture (which was why I needed to rebuild Graphviz from source as there was no up to date deb available).

Reasons:
  • Blacklisted phrase (1): help me
  • Blacklisted phrase (0.5): I need
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Timothy C. Lethbridge