[Fontinst] table figures?

Lars Hellström lars.hellstrom at residenset.net
Mon May 23 18:17:52 CEST 2005


At 17.27 +0200 2005-05-23, Ingo Reich wrote:
>Lars,
>
>>
>>>3. put each numeral centered in a box of width x
>>
>>Yes, that is probably the right thing to do. E.g.
>>
>>\resetglyph{zero}
>>   \moveright{\half{\sub{\int{digitwidth}}{\width{zero}}}}
>>   \glyph{zero}{1000}
>>   \moveright{\otherhalf{\sub{\int{digitwidth}}{\width{zero}}}}
>>\endresetglyph
>>
>
>could you comment a little bit on what this definition actually does?

All commands are documented in the manual (except \moveright, which was a
typo: I meant \movert), but alright...

>(It seems to me that line 2 and 4 center the glyph zero, and line 3
>determines the width of glyph zero which is, in case of 1000, the
>original width.

Lines 2 and 4 indeed serve to center the glyph (fontinst \movert is like
TeX \kern), but line 3 sets the original glyph (fontinst \glyph is kind of
like TeX \char; the 1000 is a scaling factor). What checks the width of the
zero glyph is \width{zero}.

>But isn't it possible/probable that the width of
>glyph zero differs from the width of, say, glyph one?)

Yes. Thus one should use \width{one} for one.

>>(or did you think about doing that using LaTeX macros? That probably
>>wouldn't be easy to make to work with digits from autogenerated numbers,
>>such as page numbers and the like.)
>
>This is what first came to my mind -- though I do not know (yet), what
>such a macro could look like; in the end it should be possible to simply
>write something like \textmono{123} or \textmono[1em]{123} where the
>first argument determines the width of each character. (Sounds a bit
>like letterspacing to me, so maybe I should have a look at uline.sty
>or letterspacing.sty.

That would probably be a good idea if you go the LaTeX macro way, yes,
since letterspacing with TeX is a rather hacky problem.

>Nevertheless, suggestions for possible implementations are very much
>appreciated.) Of course you've got a point concerning autogenerated
>numbers, though an (o.k., ugly) workaround could be to copy and paste
>the relevant definitions and change \thepage to \textmono{\thepage} etc.

Don't be surprised if simple solutions choke on such cases, or treat
\thepage as one digit. There are deep issues concerning moving arguments
and the like lurking around this path, although existing letterspacing
packages probably deal with them. With customised fonts as hinted at above,
one doesn't have those issues.

Lars Hellström




More information about the fontinst mailing list