[gentium] font variants for pdflatex

pavel.farar at centrum.cz pavel.farar at centrum.cz
Wed May 24 21:28:09 CEST 2023


Hi,

probably the easiest way to use the variants like SS01 would be to use
otftotfm to generate TeX support files. I used that tool quite a few years ago
and it's not so difficult to use even for huge font families like Adobe
Garamond with optical sizes.

It uses general *.enc files as a source. You choose OpenType features and it
creates specific *.enc files that correspond to the characters that are used
with those features for that font. For example if you have font with 4 types
of figures (old-style and lining, both tabular and proportional) it creates 4
family names like FontName-OSF and FontName-LF and 4 *.enc files. Then you can
choose which type of figures you prefer.

The package 'otfinst' can help you with creating the *.fd and *.sty files or
you can adapt those in the gentium package.

You can also use otftotfm just to create specific *.enc files without the need
to create them manually. You could use those *.enc files with other tools.


The current state of the gentium package is such that it contains original
TrueType fonts and converted (and approved) Type 1 version of the fonts.
However the Type 1 fonts have some extra kerning pairs (for accented letters,
small caps, Cyrillics). The TeX support files are created from the Type 1
fonts using afm2pl. The *.enc files are manually created.

If you use otftotfm to generate the support files, you will loose these extra
kerning pairs, because it will use the TrueType fonts. If you would like to
keep those extra kerning pairs you should open the TrueType fonts in fontforge
and import the kerning pairs from *.afm. That will create TrueType fonts with
these extra kerns. Than use the new fonts with otftotfm to create the support
files. After that you can delete these changed fonts and use the original
TrueType fonts. The metrics in the TrueType fonts does not matter any more,
because that in the *.tfm is used. I think that it also creates the *pfb files
(probably without *.afm that are not needed), but you can also use the fonts
shipped with the gentium package.


Using SS01 with the current build scripts would be much more difficult.

Unfortunately the substituted letters don't have the same width as the
original ones (I looked at: a -> a.SngStory in SS01). If they had, you could
just change the *.enc files and that would be sufficient.

The *.enc file is used twice. First, to create the *.tfm files. Second, to
decide which character to put to the output document. The first case is when
you build the support files, the second when you actually use the package. You
can even use different *.enc files for those two cases.

When you have the package installed and change e.g. '/a' to '/A' in the file
gentium-ec.enc, than all leters 'a' in the source file will be replaced by
letters 'A' in the output document (but with the metrics of the letter 'a').


I converted the fonts to Type 1, but the Ruby scripts are not writen by me.
They badly need an update (the biggest problem is that they don't run on an
up-to-date Ruby) and I may end up doing that. I'd like to wait for the next
release of the fonts that should add many more kerning pairs. That would
greatly simplify the gentium package.
 
Updating (and maintaining) the Ruby scripts wouldn't be the easiest way for me
(I don't use Ruby). I thought that it might be easier for me to rewrite them
to Python. Now, it seems to me that completely different approach using
otftotfm might have its advantages.

I might refresh my memory and create some basic scripts that would enable
using the SS01 variant of gentium. At the beginning I wouldn't try to imitate
the current state of the package, I would just make it somehow usable. Let me
know if you are interested in it, Thorsten. Just be patient if I do not
respond immediately. I can be slow sometimes.

It might be useful to put those scripts to the repository (probably some
development branch) and see whether they are more flexible than the current
Ruby scripts and whether they have some disadvantages. What do you think about
it, Karl (and Mojca if you are still there)?

All best, Pavel


More information about the gentium mailing list.