GraphViz:如何获取 UTF-8 和外部 PostScript 程序?

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

目标:画一个包含非Latin1符号的流程图。

问题:GraphViz 没有提供绘制流程图所需的所有节点形状(例如"Document"、"Predefined Process" 等)。幸运的是,一个名叫 Jason Brazile 的人创建了 nice library 个缺失的形状。但是,它仅在使用 PostScript 驱动程序 (dot -Tps) 时有效。

GraphViz 中有两个基本的 PostScript 驱动程序:不支持 Unicode 的内置驱动程序和支持但显然不支持外部 PostScript 程序的 Cairo 驱动程序(不存在用户定义的 PS 形状在生成的布局中)。

问题:如何同时使用 UTF-8 标签 流程图形状?

我就此询问了 GraphViz 开发人员,看起来答案是没有办法做到这一点:

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....