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

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



Hello!
I am working on fonts support for our AppStream metadata generator.
This will allow us to show fonts in software centers like KDE Discover
and GNOME Software and have other tools find them in the archive as
well.

You can find more information on AppStream and how to add metadata to
Debian packages here: https://wiki.debian.org/AppStream

In order to properly display fonts, they need to have an AppStream
metainfo file. Unfortunately, font upstreams do often not provide
those, especially since many font authors just create the font once
and then don't invest time in maintaining it.

While usually metainfo files are shipped by upstream projects, I think
in the case of fonts we need to create them by ourselves.
Fedora did the same a while back when they started to experiment with fonts.

Therefore, it would be awesome if you could add the necessary XML
snippets to font packages you want to have shown in software catalogs.

You can find the specification for font metainfo files here:
https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Fonts.html

An example for the fonts-breip package would be:
```

<?xml version="1.0" encoding="UTF-8"?>
<component type="font">
  <id>com.helloalan.breip/</id> [1]
  <metadata_license>FSFAP</metadata_license> [2]
  <name>Breip</name>
  <summary>An informal handwriting font</summary>
  <provides> [3]
    <font>Breip.ttf</font> [4]
    <font>breipfont.ttf</font>
  </provides>
</component>
```

To explain what these fields mean:

[1]: This is a unique ID for the font, composed of the reverse-DNS
name of upstream's homepage and the name of the font.
Please not that AppStream "font" components are actually more like
"font packages" where multiple fonts belonging to the same font family
are grouped together.

[2]: Metainfo files are usually written by upstream, and this field is
used to make upstream projects declare the license of the metadata
itself. It needs to be permissive, so we can bundle the data with
other metadata in one file without having license collisions.

[3]: The <provides/> tag can be omitted. In that case, the
appstream-generator will just take *all* fonts from the package and
insert them. This is bad if you have multiple fonts in one package,
e.g. this is the case for the "fonts-dustismo" package.

[4]: List the filenames that should be rendered for an image-preview
of the font here. The appstream-generator will take the first font to
render an icon from ("Aa") and use the others to render a preview text
for each of them.

Please keep in mind that I am still working on optimizing the
generator. Unfortunately, to find all the bugs, I need more font
metadata, especially for non-Roman scripts to see if those are dealt
with correctly.
So, any help on adding more metadata is highly appreciated!

Kind regards,
    Matthias Klumpp

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



Reply to: