groff
[Top][All Lists]
Advanced

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

Re: [Groff] pspic: Text around picture?


From: Ted Harding
Subject: Re: [Groff] pspic: Text around picture?
Date: Wed, 24 Feb 2010 10:28:45 -0000 (GMT)

On 24-Feb-10 05:57:33, Patrik Schindler wrote:
> Hi Dan,
> Am 23.02.2010 um 21:47 schrieb Werner LEMBERG:
>> Thank you for the nearly-one-year-old posting at
>> http://www.mail-archive.com/address@hidden/msg04603.html
> 
> For many reasons I still didn't find the time to dig into the  
> excellent example from Werner, so I can't give you advice yet.
> 
>:wq! PoC

The question discussed by Werner in that post concerns how to
get running text to flow around an EPS picture placed on the page.
It does not address Dan's question, which is about how to make
an EPS graphic behave like an element of the running text itself.

I have a method which allows you to define an EPS graphic as a
character (in the gro9ff sense of ".char"), which can then be
planted in running text and behaves like any other character
(e.g. will rescale as current point-size changes, can be shifted
by local motions such as \h'...' and \v'...' and therefore in
particular can be a superscript or subscript, etc. ... ).

Here is an example, in which an EPS graphic created by PS code
in a file "rose.eps" is defined as a character "\[rose]", and
is used as such in text.

## File rose.eps:

%!PS-Adobe-3.0
%%BoundingBox: 172 173 259 260
/inch {72 mul} def
/wedge
{ newpath
%%  rgbR rgbG rgbB setrgbcolor
  0 0 moveto
  1 0 translate
  15 rotate
  0 15 sin translate
  0 0 15 sin -90 90 arc
  closepath
} def
gsave
  3 inch 3 inch translate
  0.5 inch 0.5 inch scale
  0.02 setlinewidth
  1 1 12
  { 12 div setgray
    gsave
      wedge
      gsave fill grestore
      0 setgray stroke
    grestore
    30 rotate
  } for
grestore
showpage

## End of file rose.eps

## groff code to define \[rose] from "rose.eps" and use it in text:

.char \[rose] \Z'\h'+\\n[.ps]u*1u/40u'\v'\\n[.ps]u*10u/42u'\
\X'ps: import rose.eps \
172 173 259 260 \\n[.ps]''\&\h'\\n[.ps]u'

.ps 15
.vs 20p
A Rose \e[rose]\es+8 A Rose \e[rose]\es0
.sp 1
A Rose \[rose]\s+8 A Rose \[rose]\s0

## End of groff code

The above should provide a skeleton for the import of any
EPS graphic, defined in an EPS file, as a text item.

Note the necessity to define a good %%BoundingBox: in the EPS file,
and to pay attention to the local motions used in ".char" to set
the placing of the graphic (these are specific to the particular
graphic used, and so were hand-crafted).

Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 24-Feb-10                                       Time: 10:28:31
------------------------------ XFMail ------------------------------




reply via email to

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