Opened 18 years ago

Closed 17 years ago

#9705 closed defect (fixed)

fontconfig 2.3.2_1+macosx slows down GraphViz

Reported by: sf@… Owned by: gwright@…
Priority: Normal Milestone:
Component: ports Version: 1.2
Keywords: Cc:
Port:

Description

Graphviz currently gives an error: Error: fontconfig: Didn't find expected font family. Perhaps URW Type 1 fonts need installing? : Times-Roman

I tried to see if an upgrade of fontconfig would solve the issue, but it does not. In fact, it only makes the problem worse, because now it takes way more cpu cycles to generate a graph with a non-default font:

# sudo port deactivate fontconfig @2.3.2_1+macosx ---> Deactivating fontconfig 2.3.2_1+macosx # sudo port activate fontconfig @2.3.2_0 ---> Activating fontconfig 2.3.2_0 # time echo 'digraph G {graph [fontname="Verdana"];hello->world}' | dot -v The plugin configuration file:

/opt/local/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 : usershape : png-gd

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.02 sec digraph G {

graph [fontname=Verdana]; 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 {graph [fontname="Verdana"];hello->world}' 0.00s user 0.00s system 8% cpu 0.021 total dot -v 0.20s user 0.07s system 21% cpu 1.269 total # sudo port deactivate fontconfig @2.3.2_0 ---> Deactivating fontconfig 2.3.2_0 # sudo port activate fontconfig @2.3.2_1+macosx ---> Activating fontconfig 2.3.2_1+macosx # time echo 'digraph G {graph [fontname="Verdana"];hello->world}' | dot -v The plugin configuration file:

/opt/local/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 : usershape : png-gd

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.00 sec digraph G {

graph [fontname=Verdana]; 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 {graph [fontname="Verdana"];hello->world}' 0.00s user 0.00s system 6% cpu 0.032 total dot -v 69.82s user 2.66s system 74% cpu 1:36.68 total

Relevant info about my system:

# uname -a Darwin nb-vdham.science.uva.nl 8.7.0 Darwin Kernel Version 8.7.0: Fri May 26 15:20:53 PDT 2006; root:xnu-792.6.76.obj~1/RELEASE_PPC Power Macintosh powerpc # port version Version: 1.211 # port installed | grep graphviz

graphviz @2.6_3+darwin_8 graphviz @2.8_0+darwin_8 (active)

# port installed | grep fontconfig

fontconfig @2.3.2_0 fontconfig @2.3.2_1+macosx (active)

Change History (4)

comment:1 Changed 18 years ago by takanori@…

Graphviz currently gives an error: Error: fontconfig: Didn't find expected font family. Perhaps URW Type 1 fonts need installing? : Times-Roman

It seems that you haven't installed URW Type 1 fonts though graphviz needs that fonts. Here is a way to install 'urw-font' port. I hope this will help you.

1) create your own 'loclal.conf' file.

$ sudo emacs /opt/local/etc/fonts/local.conf

opt/local/etc/fonts/local.conf------- <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig>

<dir>/usr/local/share/fonts</dir> <dir>/opt/local/share/fonts</dir>

</fontconfig> ----------------------------------------

2) install urw-fonts.

$ sudo port install urw-fonts

3) run fc-cache.

$ sudo fc-cache -fv

comment:2 Changed 18 years ago by sf@…

(In reply to comment #1)

It seems that you haven't installed URW Type 1 fonts though graphviz needs that fonts. Here is a way to install 'urw-font' port. I hope this will help you.

Thank you that solved the issue.

However, this raises several questions:

1) Why is the URW-fonts port not registered as dependency for GraphViz? 2) Why do I have to do the manual steps of editting fonts.conf and fc-cache when installing URW-fonts?

comment:3 Changed 18 years ago by gwright@…

Owner: changed from darwinports-bugs@… to gwright@…

I'll take a look at this.

The reason that urw-fonts are not a dependency is that, according the the graphviz developers, they are not a dependency. This is probably an upstream documentation bug.

It should not be necessary to run the fc-cache program manually. (It should be done in a post-activate step in the urw-fonts portfile.) Don't know about editing the fonts.conf file, but it should not require hand editing except for very odd configurations.

-Greg

comment:4 Changed 17 years ago by gwright@…

Resolution: fixed
Status: newclosed

The urw-fonts were added as a dependency so I am closing this bug.

Note: See TracTickets for help on using tickets.