dotty missing labels and context menu is broken

Bug #1016777 reported by Steve Atwell
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
graphviz (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Dotty on Ubuntu 12.04 doesn't really work.

Load a dot graph in dotty (for example, "dotty example.dot" using the attached graph, taken from the Graphviz homepage). There are two problems:

1) The text labels are not drawn, they just show up as dots.
2) The right-click menu doesn't work. It shows up and entries are highlighted as you hover over them, but nothing happens when you select them.

This is with graphviz 2.26.3-10ubuntu1 on Precise.

Revision history for this message
Steve Atwell (satwell) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in graphviz (Ubuntu):
status: New → Confirmed
Revision history for this message
Zelphir (zelphir) wrote :

Running it on Ubuntu 12.04.
For me it doesn't even highlight the menu entries and none of them works.
Also I cannot move the transitions of the graph, only nodes are moveable.
Dotty doesn't redraw at all, if I move anything and drag it over other stuff, the graphical representation of that stuff is destroyed too.

Would be nice if I could move the transitions of graphs a bit, so that arrowheads don't touch each other.

Revision history for this message
Rick Poyner (rico) wrote :

The only symptom I see is (1) from the original description.

The following just renders an ellipse containing a dot:

 $ echo "digraph G { foo; }" |dotty -

"Save graph" seems to work right, so the problem appears to be graphic rendering, rather than reading the dot language input.

Revision history for this message
John Ellson (john-ellson) wrote :

We (graphviz upstream) are unable to reproduce this problem on our build of graphviz-2.30 on ubuntu12.

For us, running:
     $ echo "digraph G { foo; }" |dotty -
renders an ellipse containing the label "foo"

If this problem still occurs for you with graphviz-2.30, please send config.log from the build. It sounds like there may be a problem resolving fonts?

Revision history for this message
John Ellson (john-ellson) wrote :

You could also try running:

    echo "digraph G { foo; }" | dot -v -Tpng -o foo.png

and see if the verbose output contains a line like:

fontname: "Times-Roman" resolved to: (ps:pango Nimbus Roman No9 L, REGULAR) (PangoCairoFcFont) "Nimbus Roman No9 L, Regular" /usr/share/fonts/default/Type1/n021003l.pfb

Revision history for this message
Rick Poyner (rico) wrote :

Having upgraded to the upstream latest 2.31.20130722.0446 from ppa: gviz-adm/graphviz-dev, I still see the missing label problem with dotty. Rendering with 'dot' (to png, svg, ps, etc.) has always worked fine for me.

I have installed all of the Recommended: and Suggested: packages.

FTR, my font resolution while rendering to png matches yours, close enough:
===
$ echo "digraph G { foo; }" | dot -v -Tpng -o foo.png
dot - graphviz version 2.31.20130722.0446 (20130722.0446)
libdir = "/usr/lib/graphviz"
Activated plugin library: libgvplugin_pango.so.6
Using textlayout: textlayout:cairo
Using render: cairo:cairo
Using device: png:cairo:cairo
Activated plugin library: libgvplugin_dot_layout.so.6
Using layout: dot:dot_layout
The plugin configuration file:
 /usr/lib/graphviz/config6
  was successfully loaded.
    render : cairo dot fig gd map pic pov ps svg tk vml vrml xdot
    layout : circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout : textlayout
    device : bmp canon cmap cmapx cmapx_np dot eps fig gd gd2 gif gtk gv ico imap imap_np ismap jpe jpeg jpg pdf pic plain plain-ext png pov ps ps2 svg svgz tif tiff tk vml vmlz vrml wbmp x11 xdot xlib
    loadimage : (lib) eps gd gd2 gif jpe jpeg jpg png ps svg
fontname: "Times-Roman" resolved to: (ps:pango Nimbus Roman No9 L, REGULAR) (PangoCairoFcFont) "Nimbus Roman No9 L, Regular" /usr/share/fonts/type1/gsfonts/n021003l.pfb
network simplex: 1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
Maxrank = 0, minrank = 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross G: 0 crossings, 0.00 secs.
network simplex: 1 nodes 0 edges maxiter=2147483647 balance=2
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
routesplines: 0 edges, 0 boxes 0.00 sec
Using render: cairo:cairo
Using device: png:cairo:cairo
dot: allocating a 19K cairo image surface (83 x 59 pixels)
gvRenderJobs G: 0.00 secs.
===

Revision history for this message
tommy (mesilliac) wrote :

I'm having the problem with text not showing up as well in Ubuntu 13.10 (amd64 gnome3).

http://superuser.com/questions/334625/dotty-shows-all-labels-as-dots-period-instead-of-text
seems to imply that it's an issue with the default font not being available, but I am still unable to determine what the default font is.

I can however confirm that if the font is manually specified inside the .dot file, it is rendered correctly. For example I added "fontname=fixed" to various things and they each displayed correctly, while the untouched entries still displayed dots in stead of text.

So it seems this problem would be fixed by one of the following:

* correctly configure the default font for dotty somehow (I have no idea how to do this)
* add a dependancy on whatever package provides the default font dotty requires (I have no idea what font this is)

Revision history for this message
Emden R. Gansner (erg-7) wrote :

I can describe why this is happening, but I still can't replicate it on our versions of ubuntu, so I'm not sure how best to provide a fix. When given a graph, dotty calls dot -Txdot to get the necessary rendering information. By default, fontname is set to "Times-Roman". When using an X11 interface, dotty maps this to '-*-times-medium-r-*--%d-*-*-*-*-*-*-1', where the %d will be replaced with the desired font size. When text is written, dotty calls XLoadQueryFont (display,fontname). If the call fails with the requested font size, dotty increments and decrements the size to see if a nearby font can be found. If this fails, dotty draws a tiny box for the text.

So on the systems having problems, the call XLoadQueryFont (display,"-*-times-medium-r-*--14-*-*-*-*-*-*-1") is failing. So, why is the match failing on these systems?

As a workaround, the mapping I mentioned is defined in the text file share/graphviz/lefty/dotty.lefty, so a user could fix Times-Roman to map to an available X11 font. One could also set a specific fontname attribute in the graph. This problem with this is that names that XLoadQueryFont will accept won't be handled well by the font resolution in pango. For me, pango maps the request for times-medium to a sans serif font. As long as the font metrics are not too far off, this probably won't matter too much. But why is dotty still being used? If one just wants a single command for drawing and displaying a graph, why not use
  dot -Tx11 ?

For the record, the right-button menus work fine for me on Ubuntu 12.04 with Graphviz 2.36.

Revision history for this message
Rick Poyner (rico) wrote :

Font issue solved for me:

 * sudo apt-get install xfonts-100dpi
 * restart X session (log out and back in, for example)

Perhaps some xfonts package should be added as a dependency, or at least to Recommends:? I did not investigate whether/why fonts-liberation could suffice.

re: context menus in dotty: they are sensitive to the state of num-lock for some reason. If they don't work, toggle num-lock and try again. Dotty has had this problem for a long time.

Revision history for this message
Tom Young (ubnt) wrote :

 * sudo apt-get install xfonts-100dpi
Fixed this for me on Ubuntu 18.04.2 LTS
July 2019

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.