Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002495graphvizOutput Generationpublic2014-10-14 04:312014-10-15 17:50
Assigned To 
PlatformLinuxOSDebianOS Versionunstable
Summary0002495: Postscript (PS) output incorrect for fonts that have spaces in their name
I'm trying to export a dot graph to an output that supports links.

When using a font with spaces in its name (e.g. "PT Sans"), `ps` and `ps2` output renderers generate faulty postscript. The postscript fails to load in evince
(crashes), shows an empty document (okular) and returns an error with ps2pdf.

Excerpt from the generate postscript:

14 /PT Sans set_font

Presumably the space between "PT" and "Sans" has to be escaped somehow.

The `ps:cairo` renderer includes the font with its real name:

/FontName /PTSans-Regular def

... so that renderer works fine, but I would like to include the URLs from the dot file, and I think only the `ps2` renderer supports link export at this moment.

I tried to escape the spaces in the postscript output with backslash or quotes, but that's apparently not valid postscript either and I'm not crazy enough to read the full postscript specification.
Steps To ReproduceTo reproduce,

1) change the font:

    graph [fontname = "PT Sans"];
    node [fontname = "PT Sans"];
    edge [fontname = "PT Sans"];

2) export to `ps` or `ps2`.
TagsNo tags attached.
VERSIONdot - graphviz version 2.38.0 (20140413.2041)
Attached Files

- Relationships

-  Notes
User avatar (0000834)
wvh (reporter)
2014-10-14 05:03


I found the Postscript name of the font from `fontconfig`:

$ fc-list -f "%{postscriptname}\n"

Using the Postscript name works for PS export:

graph [fontname = "PTSans-Regular"];
node [fontname = "PTSans-Regular"];
edge [fontname = "PTSans-Regular"];

... but other renderers (e.g. "png") don't seem to find the font then.
User avatar (0000842)
erg (administrator)
2014-10-15 17:50

The argument for findfont has to be literal name, which cannot contain any spaces, so somebody has to convert "PT Sans" into PTSans-Regular. Clearly, the pango code makes this connection, but I don't know if we can get access to it.

Also, the ps:cairo output cheats. It may include /PTSans-Regular, but it is not really used. The text glyphs are embedded in the output.

The ideal solution, of course, would be for cairo to support links.

- Issue History
Date Modified Username Field Change
2014-10-14 04:31 wvh New Issue
2014-10-14 05:03 wvh Note Added: 0000834
2014-10-15 17:50 erg Note Added: 0000842

MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker