[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [fonts-ibm-plex] switching from OTF to TTF



Jonas Smedegaard wrote on 25/01/2019:
> Quoting Paride Legovini (2019-01-24 22:38:35)
>> Jonas Smedegaard wrote on 24/01/2019:
>>> Quoting Paride Legovini (2019-01-24 14:23:45)
>>>> Jonas Smedegaard wrote on 24/01/2019:
>>>
>>>>> I noticed recently that some font packages provide both TrueType 
>>>>> and OpenType.  Would be quite interesting to understand what 
>>>>> potential breakage to look out for in such packages, or e.g. which 
>>>>> version of Fontconfig started to treat such scenario sensibly.
>>>>
>>>> Good question: I think packages should not install both TTF and OTF 
>>>> files for the same font. I'd consider it a bug.
>>>
>>> Uhm, could you (or anyone) elaborate what you believe the bug is?
>>
>> Maybe "bug" is not the most appropriate word, but I believe it is a 
>> packaging defect. While the intention of the maintainer is to provide 
>> both the available versions, the result is a situation where AFAIK 
>> there is no way to tell freetype which version to use. Even telling 
>> which version is being used (and if it is used consistently) is not 
>> obvious.
> 
> If difficult to tell which font is used, then it seems to me the word is 
> something related to "superfluous" or "irrelevant".

Packages should not install superfluous or irrelevant files, I am sure
we agree here.

> More detailed, my theory here is that it is harmless in general to ship 
> both TrueType and OpenType with same name - i.e. Fontconfig reports 
> both, most applications simply grab any of them (some maybe randomly, 
> some maybe favoring on or the other format), and the net result is 
> ordinary users don't notice the difference.

This is an example on why I consider it a packaging issue: if the format
is chosen randomly then the users will get inconsistent results for no
apparent reason. There *are* differences in how the two different
formats are rendered (especially on screen), and in how they behave as
vectorial outlines.

> My point is, there are corner cases of applications doing better (or 
> working at all) with one or the other format.  If those corner cases har 
> helped by shipping both formats, and normal cases are not crippled by 
> it, then I'd say it is _not_ superfluous or irrelevant, it is better!
> 
> But I am theorizing here.

You are theorizing, and this is the point. I am not aware of any
application or library which is able to detect that both variants are
available and chose the best one for the specific task. If you can bring
such an example I'll be happy to change my mind. Keep in mind that the
TTF files are normally OpenType fonts too (see below).

> Here are some cases I (vaguely) know about which might be relevant:
> 
> Scribus consults Fontconfig and supports OpenType features
> 
> XeTeX and LuaTeX consults Fontconfig and supports OpenType features

I think there is some confusion here: modern fonts distributed as TTF
files are normally OpenType fonts with TrueType (CFF) outlines, while
the OTF files are OpenType with PostScript/Type1 outlines, which are
based on cubic Bézier curves. So both the TTF and OTF variants have
OpenType features, what changes is the mathematical form used to
describe the outlines (curves). I chose to package the OTF version of
Plex for the following reasons:

1. It matches the way the font has been designed with (cubic Bézier
curves), while the TTF goes thru a conversion process. This conversion
process may slightly change the font shapes.
See: https://github.com/IBM/plex/issues/198#issuecomment-420676025.

2. It is better suited to work with on vector graphics programs
(Inkscape), because of the absence of the superfluous points due to the
bezier->CFF->bezier double conversion.

3. When summed together, the TTF files are about the 50% bigger than the
sum of the OTF files. Not really relevant nowadays, but still.

4. It *may* be easier, one day, to build the OTF files from source with
a free toolchain. In https://github.com/IBM/plex/issues/98 people more
knowledgeable than me identify the main obstacle in handling the complex
TrueType hints, while AFAIK the CFF hints are easier to work with. But I
admit I'm not sure on this point.

Unfortunately it turns out that the OTF version does not render as well
as the TTF one, at least on screen.

Paride


Reply to: