[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Looping and printing indices in groff
From: |
Werner LEMBERG |
Subject: |
Re: [Groff] Looping and printing indices in groff |
Date: |
Mon, 13 Mar 2006 15:51:03 +0100 (CET) |
> Having installed a new font, I now want to print all characters.
> I thought of having a loop:
>
> for i=1 to 350 do X
> "i" "\N'i'"
> X
>
> But this won't work, of course.
Actually, it works -- see below. I'll update the documentation
(namely that the `c' conditional operator works with \N'...' also).
Werner
PS: Testing the CR font this way with gs 8.53 shows that a lot of
glyphs defined in groff's font description file are actually
missing... I think this is another, very convincing argument to
redo the metrics of the standard PS fonts.
======================================================================
.\"
.\" show-glyphs [font]
.\"
.de show-glyphs
. vs +6
. ps +5
. nop All glyphs in font \\$1
. br
. ps
. vs
.
. nr glyphnum 0
. nr fails 0
. ft \\$1
.
. while (\\n[fails] < 100) \{\
. ie c \N'\\n[glyphnum]' \{\
. nop \f[]\\n[glyphnum]: \f[\\$1]\N'\\n[glyphnum]'
. br
. \}
. el \
. nr fails +1
. nr glyphnum +1
. \}
.
. ft
..
.
.show-glyphs CR
.show-glyphs TR