groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Rotate text in pic


From: Ted Harding
Subject: Re: [Groff] Rotate text in pic
Date: Thu, 26 Sep 2013 09:00:35 +0100 (BST)

On 26-Sep-2013 04:20:44 Volker Wolfram wrote:
> Hi all,
> 
> I'm working on a technical drawing macro in pic on OpenBSD 5.3
> and like to have a value on an arrow line. To get a horizontal
> text is easy, but a vertical text is hard. Can you help me?
> Here is my code for a horizontal output where "dist" is the
> calculated value:
> 
> sprintf("%.2f",dist) at (measure_pos_x, measure_pos_y )
> 
> And here I like to get a vertical output:
> 
> sprintf("%.2f",dist) at last line aligned
> 
> Can anyone help me?
> 
> Volker Wolfram

The reason your code does not work as intended is that "at last line"
only denotes a position, and does not carry any reference to the
direction of "last line", so "aligned" defaults to horizontal.

To make sure that "aligned" has something to refer to, make the
text part of the command to draw the line (and you can use "\"
to continue the command line onto the next input line). For example:

  dist=2.123
  measure_pos_x=2.0 ; measure_pos_y=1.0
  sprintf("%.2f",dist) at (measure_pos_x, measure_pos_y )
  line -> from (0,0) to (0,2) \
  sprintf("%.2f",dist) aligned

This of course has the arrow line going through the middle of the
printed text "2.12". To set it beside the line, use something like

  line -> from (0,0) to (0,2) \
  sprintf("%.2f",dist) aligned above

Note: The use of "\" makes this command equivalent to:

  line -> from (0,0) to (0,2) sprintf("%.2f",dist) aligned above

And, of course, if you just want text set in a particular direction,
but without a visible line, then also use the "invis" attribute.
For example:

  line invis from (0,0) to (2,2) \
  sprintf("%.2f",dist) aligned

Hoping this helps,
Ted.

-------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Date: 26-Sep-2013  Time: 09:00:31
This message was sent by XFMail
-------------------------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]