groff
[Top][All Lists]
Advanced

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

Re: [Groff] Bulleted number - How to do???


From: Werner LEMBERG
Subject: Re: [Groff] Bulleted number - How to do???
Date: Fri, 03 Aug 2007 11:00:56 +0200 (CEST)

> I am in the need of bulleted numbers, ie. a filled circle with a
> number in it.  Imortant to me is, that I can use such a bulleted
> numer every where in floating text. But it is not necessary to have
> it in a table for now.
> 
> Three possible solutions came to mind:
> a) a font with special glyphs of this kind

Some Chinese fonts have this up to 100.  Normally very ugly.

> b) pic

This can't produce inline images.

> c) postscript

This works.  See below.


    Werner


======================================================================


.\" The radius of the circle used in `ci' macro.
.\"
.ds ci-radius 0.8m
.
.
.\" .ci <text>
.\"
.\" Emit <text>, written in white and centered within a red circle.
.\"
.de ci-end
..
.
.de ci
.  ds ci-text \\$1\"
.  nr ci-width \w'\\$1'
.  nr ci-height \\n[rst]
.  nr ci-depth \\n[rsb]
.  nr ci-rad \\*[ci-radius]
.
.  de ci-ps ci-end
     ps: exec
       % move to circle center
       \\n[ci-rad] u
         \\n[ci-height] u \\n[ci-depth] u add 2 div neg
           rmoveto
       gsave
         % shift origin to current point temporarily
         currentpoint translate
         1 0 0 setrgbcolor
         0 0 \\n[ci-rad] u 0 360 arc
         fill
         1 1 1 setrgbcolor
         % move to start of text string
         \\n[ci-width] u 2 div neg
           \\n[ci-height] u \\n[ci-depth] u add 2 div
             moveto
         (\\*[ci-text]) show
       grestore
.  ci-end
.
\Y[ci-ps]\h'2u*\\n[ci-rad]u'
..



blah blah blah
.ci 2
blubb blubb blubb

.ps 30
.vs 36
blah blah blah
.ci 12
blubb blubb blubb

Attachment: circlenumbers.pdf
Description: Adobe PDF document


reply via email to

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