f

#### How to use my own font names (i.e. a creating font aliases?)

I would like to be able to specific the fonts with my own name, as right now I
have to specify ua1r8r for Arial:

\font\arial10=ua1r8r at 10pt

Instead, I want to be able to write:

\font\arial10=arial at 10pt

Can I change the font name to do that?  Thanks! - Mark

 0
mrl (31)
10/19/2007 4:52:58 PM
comp.text.tex 39027 articles. 3 followers.

4 Replies
1145 Views

Similar Articles

[PageSpeed] 40

Mark London <mrl@psfc.mit.edu> wrote:
: I would like to be able to specific the fonts with my own name, as right now I
: have to specify ua1r8r for Arial:

: \font\arial10=ua1r8r at 10pt

: Instead, I want to be able to write:

: \font\arial10=arial at 10pt

: Can I change the font name to do that?  Thanks! - Mark

Well, that's the font name in your system. You can of course rename your
fonts on disk (be sure to rename the .tfm- and .vf-files). This is prone
to error, though. If you really want to hide the font names, you can do
the following:

\def\arial{ua1r8r}	     % 0. Hide your original font name
%
\font\arialx=\arial\ at 10pt % Two important changes here:
%
% 1. \arial10 is understood by TeX
%    as the command \arial followed
%    by the argument 10; hence \arialx
%
% 2. Watch the additional backslash
%    before the at; if omitted, the 'at'
%    will be concatenated with the font
%    name.

However, since the whole point of the exercise of the following line

: \font\arialx=ua1r8r at 10pt

IS to offer a simple mnemonic to the user for font switching, the variant
above is slightly futile. Defined once, the proper invocation allows you
to say '\arialx' throughout  your whole document ever after, until \bye
parts you.

Oliver.

--
Dr. Oliver Corff              e-mail:    corff@zedat.fu-berlin.de

 0
corff3 (423)
10/20/2007 2:15:09 PM
<corff@zedat.fu-berlin.de> wrote:

> Mark London <mrl@psfc.mit.edu> wrote:
> : I would like to be able to specific the fonts with my own name, as right
> : now I
> : have to specify ua1r8r for Arial:
>
> : \font\arial10=ua1r8r at 10pt
>
> : Instead, I want to be able to write:
>
> : \font\arial10=arial at 10pt
>
> : Can I change the font name to do that?  Thanks! - Mark
>
> Well, that's the font name in your system. You can of course rename your
> fonts on disk (be sure to rename the .tfm- and .vf-files). This is prone
> to error, though. If you really want to hide the font names, you can do
> the following:
>
> \def\arial{ua1r8r}      % 0. Hide your original font name
>             %
> \font\arialx=\arial\ at 10pt % Two important changes here:

Well, no. The command "\ " (control space) is a typesetting
command, so it ends the font specification.

\font\arialx=\arial\space at 10pt

Ciao
Enrico

 0
gregorio (1367)
10/20/2007 2:30:05 PM
Enrico Gregorio <gregorio@math.unipd.it> wrote:
: <corff@zedat.fu-berlin.de> wrote:

: > \font\arialx=\arial\ at 10pt % Two important changes here:

: Well, no. The command "\ " (control space) is a typesetting
: command, so it ends the font specification.

: \font\arialx=\arial\space at 10pt

Dear Enrico,

Thank you for the clarification --- I had tried my example, it compiled
without problems, and I was mistaken to believe it compiled _correctly_.

After sending the example, I thought of:
: \font\arialx=\arial\relax at 10pt

Oliver.
--
Dr. Oliver Corff              e-mail:    corff@zedat.fu-berlin.de

 0
corff3 (423)
10/20/2007 7:03:56 PM
<corff@zedat.fu-berlin.de> wrote:

> Enrico Gregorio <gregorio@math.unipd.it> wrote:
> : <corff@zedat.fu-berlin.de> wrote:
>
> : > \font\arialx=\arial\ at 10pt % Two important changes here:
>
> : Well, no. The command "\ " (control space) is a typesetting
> : command, so it ends the font specification.
>
> : \font\arialx=\arial\space at 10pt
>
> Dear Enrico,
>
> Thank you for the clarification --- I had tried my example, it compiled
> without problems, and I was mistaken to believe it compiled _correctly_.
>
> After sending the example, I thought of:
> : \font\arialx=\arial\relax at 10pt

It doesn't work either, because \relax is unexpandable. TeX expands
tokens after the = (which can be omitted, but it's the same thing)
in order to see if the tfm file name is followed by the keyword "at"
or "scaled"; in the first case it looks for a dimension, in the second
one it looks for a number, expanding tokens.

Since \relax is not expandable, it ends the search. Indeed \relax is
frequently used for the purpose of stopping the search for keywords,
for example with glue specifications like "\hskip 2pt plus 1pt\relax".

Ciao
Enrico

 0
gregorio (1367)
10/20/2007 9:19:20 PM