"no hard-coded metrics" issue appearing for me on Ubuntu

Hi all, newbie here. I’ve just built Graphviz 8.0.3 from source on Ubuntu 22.04.1 LTS in a Docker image. There were some warnings but it built fine. However when I run one of our test cases I’m getting this error (it says it’s a warning but it’s really an error from what I can tell):

Warning: no hard-coded metrics for 'arial bold'. Falling back to 'Times' metrics

I found an existing issue that matches my problem spurious "no hard-coded metrics" warnings on labels with empty lines (#2179) · Issues · graphviz / graphviz · GitLab and I can confirm that the test case described there is also breaking for me. However the issue is closed and marked fixed (since release 3.0.0 if I am reading the commits correctly).


% cat foo.dot
digraph "" {
  0 -> 1 [fontname="Lato",label=<<br/>1>]
}
% dot -Tsvg foo.dot >/dev/null
Warning: no hard-coded metrics for 'Lato'.  Falling back to 'Times' metrics

This is my first time running Graphviz on Linux. We do have been running Graphviz for years on Windows and haven’t seen that issue there, confirmed on versions 2.38 and 6.0.1

My question is: seeing as this issue isn’t appearing on Windows and also seeing that the issue is closed, could the problem be something I’m not doing correctly in my Linux build? It would be great if anyone else here could confirm the existence of the issue. Also any pointers to a solution would be wonderful!

many thanks

I also note that adding -q to suppress warning doesn’t have any effect here.

I assume you are Brian, the same person from this thread, spurious "no hard-coded metrics" warnings on labels with empty lines (#2179) · Issues · graphviz / graphviz · GitLab.

For anyone following along at home, as mentioned in that thread, the linked issue is only for spuriously issuing the message when operating on an empty string. The string <br/>1 is not empty, so if Graphviz’ font metrics code doesn’t know the font you’re using, issuing the warning is the correct action. Prior to the introduction of the font lookup table (Graphviz 2.50), none of this approximation was done. So you wouldn’t see the warning, but you would also get less accurate text layout.

It is a bug that -q does not suppress these warnings, -q doesn’t silence hard coded metrics fallback warninngs (#2379) · Issues · graphviz / graphviz · GitLab.

Thanks @smattr, yes I’m the same person. As this issue wasn’t happening on Graphviz 6.0.1 on Windows, I was confused as to whether I was missing something in my Linux build. I have a workaround that I can use Arial but ideally I would like to use “Arial Bold” as that would mean not having to update client data.

Thanks for your help.