Number: 588
Title: Graphviz-1.16 fails to find Times-Roman font - FontConfig failures
Submitter: Robin Johnson
Date: Tue Dec 14 08:06:29 2004
Subsys: Output generation
Version: 1.16
System: *-Linux-Gentoo
Severity: major
Problem:
Before the FontConfig integration, for each font specified as a name, the system would loop over possible font file extensions, then font pathes, then font filenames.

extensions = ttf,pfa,pfb,dfont
pathes = /usr/X11R6/lib/X11/fonts/TrueType/:/usr/X11R6/lib/X11/fonts/truetype/ (...etc)
names = Times-Roman, Times_New_Roman, Times-New-Roman, TimesNewRoman, Times, times

In 1.16, the FontConfig implementation appears to screw up the last loop and repeatedly checks the first filename (Times-Roman).

The output given is: Error: Could not find/open font : Times-Roman


However, if I use fc-list manually:
curie-int / $ fc-list -V
fontconfig version 2.2.2
curie-int / $ fc-list 'Times-Roman'
Times:style=Bold Italic
Times:style=Bold
Times:style=Italic
Times:style=Regular

Possibly this is an error in how FC is being used?

The only work-around that works is for me to pass fontname=times for each of -N,-E
Input:

digraph G {
"Node1" [ URL="http://link1",label="This is a label",shape="box" ];
"Node2" [ URL="http://link2",fontsize="14" ];
"Node3" [ URL="http://link3",fontsize="20" ];
"Node1" -> "Node2" [ label="Edge Label",color="red" ];
}
Comments:
[ellson] I don't know how Graphviz was configured for Gentoo. Would you please send me the output of: ldd `which dot`

Also the output from: echo 'digraph G {hello->world}' | dot -v

[Alejandro Mery <amery@geeks.cl>]: $ echo 'digraph G {hello->world}' | dot -v dot: fontname=Times-Roman fontpath=[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 G: 0 crossings, 0.00 secs. network simplex: 3 nodes 2 edges 0 iter 0.00 sec routesplines: 1 edges, 3 boxes, 0 splines 0.00 sec digraph G { node [label="N"]; graph [bb="0,0,58,108"]; hello [pos="29,90", width="0.75", height="0.50"]; world [pos="29,18", width="0.81", height="0.50"]; hello -> world [pos="e,29,36 29,72 29,64 29,55 29,46"]; }

$ echo 'digraph G {hello->world}' | dot -Tpng -o test.png Error: fontconfig: Didn't find expected font family. Perhaps URW Type 1 fonts need installing? : Times-Roman

$ fc-list -V fontconfig version 2.2.2

$ fc-list 'Times-Roman' Times:style=Bold Italic Times:style=Bold Times:style=Italic Times:style=Regular

$ ldd `which fc-list` linux-gate.so.1 => (0xffffe000) libfontconfig.so.1 => /usr/X11/lib/libfontconfig.so.1 (0xb7fbe000) libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7f56000) libexpat.so.0 => /usr/lib/libexpat.so.0 (0xb7f37000) libc.so.6 => /lib/libc.so.6 (0xb7e4b000) /lib/ld-linux.so.2 (0xb7fef000)

$ dot -V dot version 2.2.1 (Sat Jun 18 17:04:20 UTC 2005)

$ ldd `which dot` linux-gate.so.1 => (0xffffe000) libcommon.so.0 => /usr/lib/graphviz/libcommon.so.0 (0x40013000) libgvrender.so.0 => /usr/lib/graphviz/libgvrender.so.0 (0x4005f000) libgd.so.2 => /usr/lib/libgd.so.2 (0x4006e000) libXpm.so.4 => /usr/X11/lib/libXpm.so.4 (0x400bf000) libX11.so.6 => /usr/X11/lib/libX11.so.6 (0x400cc000) libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x40181000) libfontconfig.so.1 => /usr/X11/lib/libfontconfig.so.1 (0x4019b000) libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x401be000) libpng12.so.0 => /usr/lib/libpng12.so.0 (0x4021e000) libexpat.so.0 => /usr/lib/libexpat.so.0 (0x4024c000) libdotgen.so.0 => /usr/lib/graphviz/libdotgen.so.0 (0x40267000) libpathplan.so.0 => /usr/lib/graphviz/libpathplan.so.0 (0x40280000) libm.so.6 => /lib/libm.so.6 (0x4028b000) libgraph.so.0 => /usr/lib/graphviz/libgraph.so.0 (0x402ab000) libcdt.so.0 => /usr/lib/graphviz/libcdt.so.0 (0x402b4000) libc.so.6 => /lib/libc.so.6 (0x402b9000) libXext.so.6 => /usr/X11/lib/libXext.so.6 (0x403a4000) libdl.so.2 => /lib/libdl.so.2 (0x403b0000) /lib/ld-linux.so.2 (0x40000000)

[Michail Vidiassov <master@iaas.msu.ru>]: There is code in gd/gdft.c that hardcodes translation from Postcript names of core fonts to fontconfig names of URW fonts (!). (That is where the error message "Didn't find expected font family. Perhaps URW Type 1 fonts need installing?" comes from.)

Thus other fonts capable to act as core Postscript fonts may be ignored (depends on Fontconfig config).

Good news is that the hack is compiled in conditionally, thus easy to disable.

Use the Search, Luke! The problem has already been reported here, see https://mailman.research.att.com/pipermail/graphviz-interest/2005q2/002392.html
Owner: ellson
Status: Fixed