GraphViz: how to get UTF-8 AND external PostScript procedures?

Goal: draw a flowchart which contains non-Latin1 symbols.

Problem: GraphViz does not provide all node shapes necessary for drawing a flowchart (e.g. "Document", "Predefined Process" etc). Fortunately, a person named Jason Brazile created a nice library of missing shapes. However, it works only when using the PostScript driver (dot -Tps).

There are two basic PostScript drivers in GraphViz: built-in driver which does not support Unicode, and Cairo which does, but apparently does not support external PostScript procedures (the user-defined PS shapes are absent in the resulting layout).

Question: How do I use UTF-8 labels and flowchart shapes at the same time?

sorry, this would be very difficult to code

 

We looked at this problem years ago. The native graphviz -Tps Postscript driver does not have any custom font loading capabilites.  As mentioned here:   http://tldp.org/HOWTO/Unicode-HOWTO-5.html   rendering utf-8 fonts in Postscript is a do-it-yourself job. It would probably take weeks or months of work, but if you want to try to make this modification to graphviz, it might be possible to appropriate code from one of the other tools mentioned in that website.  (Make sure it is non-GPL code, otherwise it can't be distributed!)

Another option would be to modify the cairopango driver to render text on top of a user shape after it is loaded. (Do we not already support this? It seems obvious.) Then either find a way to render external graphviz PS shapes after they are loaded and copy the rendered images into the cairopango canvas (hey we already import ghostscript into graphviz) or convert the custom PS shapes externally into images that can be loaded by the cairopango driver.  This might not take as much time. 

Either way, it will take an expert C programmer.

Probably none of us have much time to work on this (our time would be better used trying to get funding to support the project in a more general way, but we all have other jobs now) but you could offer a bounty on bountysource and see what happens....

 

What about GhostScript and lasi?

This [1] bugreport has a mention af a third PostScript driver named Lasi.

It says that this driver has full UTF-8 support and aslo "supports anchors". I don't know what the latter means, but it is something that the internal ps driver supports and Cairo does not, so I figure maybe this "lasi" driver can actually help?

Also this [2] FAQ mentions a fourth PostScript driver - GhostScript (gs). It says that it

  1. "Provides support for usershapes in PostScript that can be embedded in all output formats"
  2. "interprets the format and renders to a cairo surface"

The former can give me neede shapes, and the latter can provide with UTF-8 support. Am I wrong?

I tried to embed links into the text, but got an error "Your submission has triggered the spam filter and will not be accepted."

[1] www <dot> graphviz <dot> org <slash> bugs <slash> b1940 <dot> html

[2] www <dot> graphviz <dot> org <slash> doc <slash> FAQ <dot> html

P.S. I am asking this because I'm not able to make my GraphViz work with either of these. I even tried to compile it from source, but build failed with an "undefined reference" error:

libcgraph.so:
undefined reference to `aglexeof'
undefined reference to `aaglex'
undefined reference to `aagin'
undefined reference to `aglexinit'
undefined reference to `aglexbad'
undefined reference to `aagerror'
libgvc.so:
undefined reference to `agsetfile'

Supports anchors

Supports anchors

Supports anchors

Supports anchors

Recent comments