[Fontinst] Tokens in 6th argument of \DeclareFontShape
Arash Esbati
Esbati at gmx.de
Thu May 12 11:07:44 CEST 2016
"Lars Hellström" <Lars.Hellstrom at residenset.net> writes:
> Arash Esbati skrev 2016-05-10 18.06:
> > Hi all,
> >
> > I can't find a way to insert code into the last argument of
> > \DeclareFontShape in a .fd-file directly from a fontinst driver file.
> > [...]
> > Any hint, or am I missing the obvious?
>
> No, you're not missing anything. Fontinst has an interface for putting
> custom loading-settings in the \DeclareFontFamily declaration (last
> argument of \installfamily), but not for putting such in individual
> \DeclareFontShape declarations. Indeed, \fd_shape (which is
> responsible for generating the \DeclareFontShape declarations) has
> this sixth argument hardwired to being empty.
Thanks for your response and the clarification.
> It's not too hard to implement---easiest would be to have a variant
> macro \fd_shape_with_loadspec to be used instead of \fd_shape---but I
> don't see an obvious user level interface for specifying the extra
> information (\installfont already has a ton of arguments).
>
> Do you have a use-case in mind, or was it just a matter of exploring
> all options? In the former case, I would be interested to hear about
> it.
I worte a small package AnonymousPro supporting the fonts with the
same name [1]. I was thinking about touching the package again and
add an option I saw provided by erewhon.sty [2]. It has an option
`space' to modify the interword spacing:
\DeclareOptionX{space}[1.2]{\DeclareRobustCommand{\erewhon at sf}{%
\fontdimen2\font=##1\fontdimen2\font}}
The command `\erewhon at sf' the is in the sixth argument of
\DeclareFontShape in the .fd files, e.g. [3]
\DeclareFontFamily{T1}{erewhon-OsF}{\providecommand{\erewhon at sf}{}}
\DeclareFontShape{T1}{erewhon-OsF}{m}{n}{
<-> \erewhon@@scale Erewhon-Regular-osf-t1
}{\erewhon at sf}
Do you see a chance to implement something? If not, not a big deal,
there is still `sed'.
Best, Arash
Footnotes:
[1] https://www.ctan.org/pkg/anonymouspro
[2] https://www.ctan.org/pkg/erewhon
[3] http://mirrors.ctan.org/fonts/erewhon/tex/T1erewhon-OsF.fd
More information about the fontinst
mailing list