[Output to pdf issues] Fonts

Hi there. Currently having font issues with output to pdf using dot.
ive tried the following:

fontpath="c:/windows/fonts/ARIAL.TFF";
fontname="ARIAL.TTF";

and

fontname="Helvetica";

The output is Times New Roman when viewed in Adobe Reader, however, when you select any text, copy, and paste, the output is not text.
From the looks of the postscript file, it seems that all fonts are by default being overwritten by ISO Latin-1. This is unusable for my purpose unfortunately. Is there anyway that I can get the text to by copy/paste-able? Looking at the pdf document properties it says that a Times-New-Roman font is embedded.

Any help would be appreciated, thanks

[Output to pdf issues] Fonts

Since it seems you are using the Windows version of Graphviz, this is built using fontconfig, so the fontpath has no effect. It should be sufficient to simply say
fontname=arial
  or
fontname=Helvetica
 
If you use -Tps, you are getting the core postscript renderer which only handles Latin-1 characters, but that has nothing directly to do with the font being used. Both arial and helvetica should be resolved to helvetica, and the output should be fine as long as your input consists of Latin-1 characters. To remove the latter limitation, use -Tps:cairo.
If you use -Tpdf, you should be getting the Windows' arial font, and it should be selectable. At least, it works for me.
Try running dot -v and see what font dot believes it is using.
Beyond this, it is hard to know what to say based on your information. You may find it helpful to submit a bug report, so we can find out what version of graphviz you are using, and take a look at your source and the resultant output.

fontname ignored

I am also having this issue.  It doesn't matter what output type I select or what name I use as the fontname, all output is Times-Roman.
Using the following Dot file, fontname is ignored:
 

digraph {

fontsize=8.0;

ranksep=1.0;

node [shape=box];

fontname=Arial;

"BalanceDue" [label=<<b>BalanceDue</b><br align="left" /><br align="left" />return $TotalWithChangeOrders - $TotalPaymentsReceivedToDate;<br align="left" />>];

"TotalWithChangeOrders" [label=<<b>TotalWithChangeOrders</b><br align="left" /><br align="left" />return <br align="left" />    $Total +<br align="left" />    $ChangeOrderSubtotal +<br align="left" />    $ChangeOrderMgmtFee +<br align="left" />    $ChangeOrderEstimate;<br align="left" />>];

    "BalanceDue" -> "TotalWithChangeOrders";

"ChangeOrderEstimate" [label=<<b>ChangeOrderEstimate</b><br align="left" /><br align="left" />double percent;<br align="left" />if ($Bid.Job.Site.Address.Country.IsUSA)<br align="left" />    percent = 10%;<br align="left" />else<br align="left" />    percent = 20%;<br align="left" />    <br align="left" />return ($ChangeOrderSubtotal + $ChangeOrderMgmtFee) * percent;<br align="left" />>];

"ChangeOrderSubtotal" [label=<<b>ChangeOrderSubtotal</b><br align="left" /><br align="left" />return    <br align="left" />    $sum($ProductInstallAndShipping) +<br align="left" />    $sum($:ChangeAmount) + <br align="left" />    $ChangeOrderRemovalAndRecycle +<br align="left" />    $ChangeOrderInstallation +<br align="left" />    $ChangeOrderShipping;<br align="left" />>];

    "ChangeOrderEstimate" -> "ChangeOrderSubtotal";

"ChangeOrderMgmtFee" [label=<<b>ChangeOrderMgmtFee</b><br align="left" /><br align="left" />var fee =     <br align="left" />    $ChangeOrderSubtotal<br align="left" />    * 12%;<br align="left" />    <br align="left" />if (fee &lt; 0.0m)<br align="left" />    fee = 0.0m;<br align="left" />    <br align="left" />return fee;<br align="left" />>];

    "ChangeOrderEstimate" -> "ChangeOrderMgmtFee";

    "ChangeOrderMgmtFee" -> "ChangeOrderSubtotal";

"Estimate" [label=<<b>Estimate</b><br align="left" /><br align="left" />if ($Bid.Job.Site.Address.Country.IsUSA)<br align="left" />    percent = 10%;<br align="left" />else<br align="left" />    percent = 20%;<br align="left" /><br align="left" />return $Subtotal * percent;<br align="left" />>];

"Subtotal" [label=<<b>Subtotal</b><br align="left" /><br align="left" />return <br align="left" />    $sum($Product) + <br align="left" />    $sum($:Item) +  <br align="left" />    $RemovalAndRecycle + <br align="left" />    $Installation + <br align="left" />    $Shipping;<br align="left" />>];

    "Estimate" -> "Subtotal";

"MgmtFee" [label=<<b>MgmtFee</b><br align="left" /><br align="left" />return $Subtotal * 12%;<br align="left" />>];

    "MgmtFee" -> "Subtotal";

"Total" [label=<<b>Total</b><br align="left" /><br align="left" />return <br align="left" />    $Subtotal + <br align="left" />    $MgmtFee + <br align="left" />    $Estimate;<br align="left" />>];

    "Total" -> "Subtotal";

    "Total" -> "MgmtFee";

    "Total" -> "Estimate";

    "TotalWithChangeOrders" -> "Total";

    "TotalWithChangeOrders" -> "ChangeOrderSubtotal";

    "TotalWithChangeOrders" -> "ChangeOrderMgmtFee";

    "TotalWithChangeOrders" -> "ChangeOrderEstimate";

"VendorTotal" [label=<<b>VendorTotal</b><br align="left" /><br align="left" />return <br align="left" />    $Subtotal - $RecDevelopmentFee;<br align="left" />>];

    "VendorTotal" -> "Subtotal";

"VendorTotalWithChangeOrders" [label=<<b>VendorTotalWithChangeOrders</b><br align="left" /><br align="left" />return <br align="left" />    $VendorTotal + $ChangeOrderSubtotal;<br align="left" />>];

    "VendorTotalWithChangeOrders" -> "VendorTotal";

    "VendorTotalWithChangeOrders" -> "ChangeOrderSubtotal";

}

 

Here is the -v output:

 

c:\Dev\>dot -v -Tpdf costItems1.dot > costItems.pdf

dot - graphviz version 2.28.0 (20110507.0327)

libdir = "C:\Program Files\Graphviz 2.28\bin"

Activated plugin library: gvplugin_pango.dll

Using textlayout: textlayout:cairo

Using render: cairo:cairo

Using device: pdf:cairo:cairo

Activated plugin library: gvplugin_dot_layout.dll

Using layout: dot:dot_layout

The plugin configuration file:

        C:\Program Files\Graphviz 2.28\bin\config6

                was successfully loaded.

    render      :  cairo dot fig gd gdiplus map 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 emf emfplus eps fig gd gd2 gif gv imap imap_np ismap jpe jpeg jpg m

etafile pdf plain plain-ext png ps ps2 svg svgz tif tiff tk vml vmlz vrml wbmp xdot

    loadimage   :  (lib) bmp eps gd gd2 gif jpe jpeg jpg png ps svg

fontname: "Times-Roman" resolved to: (ps:pango  Times New Roman, ) (PangoCairoWin32Font) "Times New Roman, 13.9990234375

"

network simplex:  11 nodes 16 edges maxiter=2147483647 balance=1

network simplex: 11 nodes 16 edges 0 iter 0.00 sec

mincross: pass 0 iter 0 trying 0 cur_cross 3 best_cross 3

mincross: pass 0 iter 1 trying 1 cur_cross 9 best_cross 3

mincross: pass 0 iter 2 trying 0 cur_cross 0 best_cross 0

mincross _anonymous_0: 0 crossings, 0.00 secs.

network simplex:  39 nodes 56 edges maxiter=2147483647 balance=2

network simplex: 39 nodes 56 edges 7 iter 0.00 sec

routesplines: 16 edges, 60 boxes 0.00 sec

Using render: cairo:cairo

Using device: pdf:cairo:cairo

 

fontname ignored

The fontsize and fontname assignments
 
digraph {
fontsize=8.0;
ranksep=1.0;
node [shape=box];
fontname=Arial;
 
 are graph attributes, affecting only graph and subgraph labels. If you want nodes to use 8-point arial font, use
 
node[shape=box fontname=Arial fontsize=8]
I'm not sure how this may affect the first poster, as there is not enough context.

fontname ignored

Perfect! Thanks

Recent comments