Number: 1947
Title: Parts of characters stripped in PNG, GIF
Submitter: Bolek
Date: Mon May 10 11:41:58 2010
Subsys: Dot
Version: 2.26.3
System: x86-Windows-XP SP3 Eng
Severity: major
Problem:
Hello,

if you try the DOT code below and convert it to PNG or GIF using the following call


dot -Tpng -O file.txt
you get image with part of the last Q and W not shown. When drawing to PDF, the text is displayed correctly.

Also, the underscores are missing in the upper line.
Input:

digraph NAME_000000_component_6{

	graph [concentrate=true,
		margin="0.05",
		nodesep="0.1",
		ranksep="0.2",
		ratio=compress
	];
	node [fontname=Helvetica,
		fontsize=10,
		height=".3",
		shape=ellipse,
		width=".5"
	];
	edge [dir=back];
	 NAME_00000B		 [URL="#LINK2",
			label="(QQQ) WW_WWWW_QQQ"];
		NAME_000021		 [URL="#LINK_WWWW",
			label=WW_WWWW,
			shape=box];
		NAME_00000B -> NAME_000021;
}
Comments:
[ellson] Are you building from source, or using our binaries?

Graphviz uses (or should be using) pango for its text layout. Pango is certainly not assuming fixed width characters.

I'm not seeing any problems with this graph, on Linux. See attached.

Please send stderr output when you run with "dot -v -Tpng file.txt"

[arif] Label is not trimmed , However underscore is not visible because of the magical bottom pixel bug which keeps coming back every other month. See output.
Fix:
Don't remember it exactly but once I run into a similar problem in C or C# (?) The problem was that the system provided with me some average character width which I multiplied by number of chars. I then used GetTextExtent to get the actual size of the text.
Owner: *
Status: *