[Fontinst] Tokens in 6th argument of \DeclareFontShape

Lars Hellström Lars.Hellstrom at residenset.net
Wed May 11 14:52:35 CEST 2016

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.
>> From the manuals (fontinst.pdf&  fntguide.pdf):
> \installfont      {<font-name>} {<metrics-list>} {<etx-list>}
>                    {<encoding>} {<family>} {<series>} {<shape>}
>                    {<size>}
> \DeclareFontShape {<encoding>} {<family>} {<series>} {<shape>}
>                    {<loading-info>} {<loading-settings>}
> Tokens inside \installfont...{<size>} will end up in
> \DeclareFontShape...{<loading-info>}.  I want to have one token in
> {<loading-settings>}, preferably without using `sed'.  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 

I can see two reasons for this:
1. Nobody has (yet) reported an actual use-case for this feature, instead 
being content with using the \DeclareFontFamily loading settings (and even 
that is rare).
2. The per-shape storage of FD data in fontinst uses full expansion, so 
passing arbitrary code that way is not entirely straightforward (but 
certainly doable).

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.

Lars Hellström

> Best, Arash
> PS Please CC me as I'm not subscribed to this list, TIA.

More information about the fontinst mailing list