GraphViz: como obter procedimentos PostScript UTF-8 e externos?

1

Meta : desenhe um fluxograma que contenha símbolos não-Latin1.

Problema : O GraphViz não fornece todas as formas de nós necessárias para desenhar um fluxograma (por exemplo, "Documento", "Processo Predefinido", etc.). Felizmente, uma pessoa chamada Jason Brazile criou uma bela biblioteca de formas ausentes. No entanto, funciona apenas quando se utiliza o driver PostScript ( dot -Tps ).

Existem dois drivers PostScript básicos no GraphViz: driver embutido que não suporta Unicode, e Cairo, mas aparentemente não suporta procedimentos PostScript externos (as formas PS definidas pelo usuário estão ausentes no layout resultante).

Pergunta : Como faço para usar as formas de fluxograma e dos rótulos UTF-8 ao mesmo tempo?

    
por ScumCoder 14.03.2016 / 12:34

1 resposta

0

Perguntei aos desenvolvedores do GraphViz sobre isso e parece que a resposta é que não há como fazer isso:

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

    
por 08.07.2016 / 00:06