Number: 1087
Title: Node size badly computed from label text
Submitter: Julien BIBOLLET
Date: Fri Feb 23 16:07:38 2007
Subsys: Output generation
Version: 2.12
System: x86-Linux-Gentoo
Severity: minor
Problem:
It seems that size of nodes is badly computed, probably using the wrong font: size of the node grows as label length increased, but is always smaller than the size it should have (seee attached image for a better idea).
Input:
digraph G
{
  Root [label="LLiiiiiiiiiiLL"]
}
Output file: b1087.png
Comments:
[north] Looks like you're possibly missing some fonts. Did you build your own source? What does "dot -v" say on a trivial graph? Do you have fontconfig?

[julien] Looks like you're possibly missing some fonts.

It's possible, but how do I check it ?

Did you build your own source?

Kind of, my Linux distribution is gentoo, so I simply use 'emerge graphviz' to install dot and the other tools (which in fact dowloads the source tarball and compiles it).

What does "dot -v" say on a trivial graph?


$ cat graph.dot
digraph
{
  A -> B
}

$ dot -v graph.dot The plugin configuration file: /usr/lib/graphviz/config was successfully loaded. render : canon cmap cmapx dia dot fig gd gd2 gif hpgl imap ismap jpeg jpg mif mp pcl pic plain plain-ext png ps ps2 svg svgz vrml vtx wbmp xdot layout : circo dot fdp neato nop nop1 nop2 twopi textlayout : device : loadimage : 2ps gif2fig gif2gd gif2ps gif2svg gif2vrml jpeg2fig jpeg2gd jpeg2ps jpeg2svg jpeg2vrml png2fig png2gd png2ps png2svg png2vrml ps2ps dot: fontname "Times-Roman" resolved to "[internal times]" network simplex: 2 nodes 1 edges 0 iter 0.00 sec mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0 mincross _anonymous_0: 0 crossings, 0.00 secs. network simplex: 3 nodes 2 edges 0 iter 0.00 sec routesplines: 1 edges, 3 boxes 0.00 sec digraph { node [label="N"]; graph [bb="0,0,54,108"]; A [pos="27,90", width=" 0.75", height="0.50"]; B [pos="27,18", width="0.75", height="0.50"]; A -> B [pos="e,27,36 27,72 27,64 27,55 27,46"]; }

Do you have fontconfig?

I have fontconfig version 2.4.2 installed.

A friend of mine has the same problem. I don't know what Linux distribution he has, but it's for sure not a gentoo (if I remember well it's a Fedora); so it might not be a simple gentoo problem.

[north] Yup, Graphviz or fontconfig didn't find any fonts. What's the output of "fc-match Times-Roman"?

[julien] $ fc-match Times-Roman timR12.pcf.gz: "Times" "Regular"

[north] graphviz requires fonts that we believe freetype can load (or that freetype actually loads successfully - at this point I'd have to read the graphviz code to be certain.)

Look in the graphviz FAQ under Q. I have "Font not found" errors, or text labels missing in webdot.

Apparently we need to expand the FAQ since it doesn't directly address your problem.

In any case, my suggestion is to get some Truetype fonts and set DOTFONTPATH so it can find them. At a minimum you need times.ttf

If this works, then the next step will be to work with the people who packaged the release so others don't have to go through this.
Owner: north
Status: Fixed (23 Feb 2007)