]> granicus.if.org Git - graphviz/commitdiff
approximate height and move the text point by a constant
authorIngo Krabbe <ingo.krabbe@protel.net>
Tue, 19 Jul 2016 13:28:36 +0000 (15:28 +0200)
committerIngo Krabbe <ingo.krabbe@protel.net>
Tue, 19 Jul 2016 13:28:36 +0000 (15:28 +0200)
plugin/core/gvrender_core_fig.c

index 67b82112d8ac0d21a80e9101b1c593d0754d313f..06ebecf771986dd011dc8dad96cff9b30dcdbf8a 100644 (file)
@@ -260,8 +260,8 @@ static void fig_textspan(GVJ_t * job, pointf p, textspan_t * span)
  * in the output - but note that dot knows nothing about latex,
  * so the node sizes may be wrong.
  */
-    double height = 0.0;
-    double length = 0.0;
+    double height = font_size;
+    double length = 2.0*font_size/3.0  * (double)strlen(span->str) / 2.0;
 
     pA = span->font->postscript_alias;
     if (pA) /* if it is a standard postscript font */
@@ -280,10 +280,16 @@ static void fig_textspan(GVJ_t * job, pointf p, textspan_t * span)
         break;
     }
 
+/*     object_code     sub_type        color   depth   pen_style       font
+       4                       1               0               1               0               0       
+         font_size     angle   font_flags      height  length  ROUND(p.x)      ROUND(p.y),
+       14.0            0.0000  6               14.0            51.3            1237            570     
+       $A      \\in    M_0$\001
+*/
     gvprintf(job,
             "%d %d %d %d %d %d %.1f %.4f %d %.1f %.1f %d %d %s\\001\n",
             object_code, sub_type, color, depth, pen_style, font,
-            font_size, angle, font_flags, height, length, ROUND(p.x), ROUND(p.y),
+            font_size, angle, font_flags, height, length, ROUND(p.x), ROUND((p.y-72.0)),
             fig_string(span->str));
 }