From bcf947824cac09e09f8e35891a0941980f66b1c5 Mon Sep 17 00:00:00 2001 From: ian Date: Sat, 16 Sep 2006 01:16:42 +0000 Subject: [PATCH] improved D drawing --- layout/layout | 43 +++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/layout/layout b/layout/layout index d201023..b88ac2c 100755 --- a/layout/layout +++ b/layout/layout @@ -165,12 +165,10 @@ our $lmu_marklw= 4; our $lmu_marktpt= 11; our $lmu_txtboxtxty= $lmu_marktpt * 0.300; our $lmu_txtboxh= $lmu_marktpt * 1.100; -our $lmu_lenboxh= $lmu_marktpt * 1.100; our $lmu_txtboxpadx= $lmu_marktpt * 0.335; -our $lmu_lenboxpadx= $lmu_marktpt * 0.005; our $lmu_txtboxoff= $lmu_marklw / 2; -our $lmu_lenboxoff= -$lmu_marklw * 1.0; our $lmu_txtboxlw= 1; +our $lmu_lenlabeloff= -$lmu_marklw * 1.0; our $olu_left= 10 * $scale; our $olu_right= 217 * $scale - $olu_left; @@ -782,7 +780,7 @@ print DEBUG "ps $p0 $p1 $lenperp ($ppu)\n"; ol(" gsave\n". " $pt->{X} $pt->{Y} translate\n". " $ad rotate\n". - " lf setfont 0 $lmu_lenboxoff moveto ($len) show\n". + " lf setfont 0 $lmu_lenlabeloff moveto ($len) show\n". " grestore\n"); } return unless $draw =~ m/[ARS]/; @@ -1475,8 +1473,19 @@ dv("cmd__do $ctx @al ",'$ctx',$ctx); " $lmu_marklw setlinewidth stroke\n"); } if ($draw =~ m/L/) { - ol(" $lmu_txtboxlw $lmu_txtboxh $lmu_txtboxpadx". - " $lmu_txtboxoff ($id) label_in_box\n"); + ol(" /s ($id) def\n". + " lf setfont\n". + " /sx5 s stringwidth pop\n". + " 0.5 mul $lmu_txtboxpadx add def\n". + " -90 rotate 0 $lmu_txtboxoff translate newpath\n". + " sx5 neg 0 moveto\n". + " sx5 neg $lmu_txtboxh lineto\n". + " sx5 $lmu_txtboxh lineto\n". + " sx5 0 lineto closepath\n". + " gsave 1 setgray fill grestore\n". + " $lmu_txtboxlw setlinewidth stroke\n". + " sx5 neg $lmu_txtboxpadx add $lmu_txtboxtxty\n". + " moveto s show\n"); } ol(" grestore\n"); } @@ -1567,28 +1576,6 @@ if ($page_x || $page_y) { o(" -$ps_page_xmul $page_x mul -$ps_page_ymul $page_y mul translate\n". " $ptscale $ptscale scale\n"); -o("/label_in_box {\n". - '% linewidth $lmu_*boxh $lmu_*padx $lmu_*boxoff (s)'. - ' label_in_box => _'."\n". - " /s exch def\n". - " /boxoff exch def\n". - " /padx exch def\n". - " /boxh exch def\n". - " setlinewidth\n". - " lf setfont\n". - " /sx5 s stringwidth pop\n". - " 0.5 mul padx add def\n". - " -90 rotate 0 boxoff translate newpath\n". - " sx5 neg 0 moveto\n". - " sx5 neg boxh lineto\n". - " sx5 boxh lineto\n". - " sx5 0 lineto closepath\n". - " gsave 1 setgray fill grestore\n". - " stroke\n". - " sx5 neg padx add $lmu_txtboxtxty\n". - " moveto s show\n". - "} def\n"); - newctx(); open DEBUG, ($debug ? ">&2" : ">/dev/null") or die $!; -- 2.30.2