[Pkg-fonts-devel] Adding AppStream metainfo files for fonts

Matthias Klumpp mak at debian.org
Thu Sep 29 22:13:52 UTC 2016


2016-09-27 4:18 GMT+02:00 Paul Wise <pabs at debian.org>:
> On Tue, Sep 27, 2016 at 12:59 AM, Matthias Klumpp wrote:
>
>> Unfortunately not, because we have no idea about how to generate the
>> unique ID, how to write a proper summary sentence and especially we
>> don't know which fonts should be grouped together, if multiple exist
>> in one package.
>
> Hmm, I see.
>
>> Fedora simply doesn't do that, and using filenames was simply a
>> placeholder for now.
>
> When did they stop doing this? They used to have fully automatic
> metadata extraction and automatic installation of fonts simply based
> on characters in a web page.

Indeed, they embed this information into RPM metadata - the change was
actually wanted by PackageKit and added there.
We don't have something similar for Debian yet.

>> Do you have experience with fonts? We could make this tag a "<family>
>> <style>" combination, so we would have:
>> <font>Libertine Bold</font>
>> <font>Libertine Regular</font>
>> etc.
>> We could also make some kind of ID for the font ("libertine;bold") and
>> add it instead. The only important thing is that we have enough
>> information to associate that name with a font file.
>
> fontconfig is the way to associate font metadata like names or
> languages with the font filenames. I don't think we should reinvent
> that wheel.

That's pretty much the same as Fontconfig does.
I've now read a lot about fonts (more than I ever wanted to) and
especially about how to name them, and this stuff is pretty crazy...
One document from Adobe[1] provides the IMHO best advice for how to
name fonts, but the main culprit is that font authors are always free
to leave out metadata from their font files, and that the "FullName"
suggestion in the docment isn't easy to handle for machines and too
verbose.

So, I looked at what RPM does and what Fontconfig does internally (a
horrible piece of non-threadsafe code...), and came up with what I
think is a good solution.
The spec is already updated and I ran this by a few people who like
the way it is documented now, so this is pretty much the final
solution and won't change anymore. Also, I already implemented the
changes in the AppStream generator, the AppStream libraries support
the metadata already.

See https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Fonts.html

Comments are welcome!
I also tried again to auto-generate metainfo files for fonts (grouping
them by family and synthesizing a unique ID), but that really always
ends up in a huge mess of duplication and confusion. It works for 80%
of all cases, but that's not good enough.

So, we will unfortunately really need font packages to ship at least a
small bit of XML, like Fedora does, in order to make the fonts known
to AppStream.

Cheers,
    Matthias




[1]: https://partners.adobe.com/public/developer/en/font/5088.FontNames.pdf




-- 
I welcome VSRE emails. See http://vsre.info/



More information about the Pkg-fonts-devel mailing list