Open joebonrichie opened 1 year ago
Hello, i want to try to help with this one. A few question:
Copyright 2023 Solus Developers <copyright@getsol.us>
, while in commit https://github.com/getsolus/packages/commit/8b48034963aa8dfb329a96ef5ebfe1b1c089252d it says Copyright 2014 Richard Hughes <richard@hughsie.com>
. Where does the copyright info should come from? metainfo.xml
on font-clear-sans-ttf
doesn't really match with the specs given in the example. Also the filename should be clear-sans.metainfo.xml
. Should i also add pull request for this?homepage
should also be included in somefont.metainfo.xml
?1. I see in the example given it just says `Copyright 2023 Solus Developers <copyright@getsol.us>`, while in commit [8b48034](https://github.com/getsolus/packages/commit/8b48034963aa8dfb329a96ef5ebfe1b1c089252d) it says `Copyright 2014 Richard Hughes <richard@hughsie.com>`. Where does the copyright info should come from?
I stole the XML file from the fedora repos for that package.
2. info provided inside `metainfo.xml` on `font-clear-sans-ttf` doesn't really match with the specs given in the example. Also the filename should be `clear-sans.metainfo.xml`. Should i also add pull request for this?
Feel free to do so thanks
3. Is `homepage` should also be included in `somefont.metainfo.xml` ?
Feel free to do so. I will look at ensuring appstream-builder
includes it.
@joebonrichie , @EbonJaeger , @HarveyDevel I can no longer find any fonts that are missing appdata metainfo using the find commands. Please take a second look. We may be able to close this one out.
This is the list of font that i haven't done the last time I added metainfo.xml. I haven't seen a few of these fonts in this thread (maybe merged without mentioning this issue).
The noto fonts have had their metainfo file merged, and reference this issue (I see the mentions above). The others are indeed still missing it. Thanks for the update.
font-noto-cjk |metainfo failed
This one should be fixed now. I added a patch to appstream-builder
to not fail on .ttc
files.
This gets every font that still needs metainfo, except the texlive ones that are provided by texlive.
find . -maxdepth 2 -type d -iname "font-*" -a ! -iname "*-manager" ! -exec sh -c 'test -e "$1"/files/*metainfo.xml' sh {} \; -print
I'm updating the main comment with it.
How are we looking on it issue now, is there any outstanding fonts?
I found a few stragglers, using the same command as above (just added *-util to the exclusions)
~/p/p/packages ❯❯❯ find . -maxdepth 2 -type d -iname "font-*" -a ! -iname "*-manager" -a ! -iname "*-util" ! -exec sh -c 'test -e "$1"/files/*metainfo.xml' sh {} \; -print
./f/font-firago
./f/font-noto-cjk
./f/font-adobe-100dpi
./f/font-terminus-console
./f/font-firacode
./f/font-symbola-ttf
./f/font-weather-icons
./f/font-adobe-75dpi
t/texlive
also has no metainfo file
font-adobe-100dpi
and font-adobe-75dpi
can be ignored/scratch off the list as they contain .bdf
font. Bitmap font cannot be handled by appstream-builder
.
It seems appstream-builder can't handle .otf
and .ttf
file of the same font at the same time. This behaviour can also be replicated on nautilus thumbnail. If you preview .otf
file first then the .ttf
, The .ttf
file thumbnail won't generate. You can try download this https://github.com/bBoxType/FiraGO/archive/1.000.tar.gz. Extract it. Then open FiraGO_TTF folder first, then FiraGO_OTF. See, if the thumbnail successfully generated.
This was tested on font-firago
and font-weather-icons
Document related issue:
Add appstream metainfo to all font packages so font previews show up in Software Centers.
Please see
font-clear-sans-ttf
in the Solus Software Center as an example.Please see this commit for
liberation-fonts-ttf
on how to add appstream metainfo to a packagehttps://github.com/getsolus/packages/commit/8b48034963aa8dfb329a96ef5ebfe1b1c089252d
Finding fonts to update
Originally, all of our fonts except
font-clear-sans-ttf
andliberation-fonts-ttf
were missing appstream data. To search for fonts that have no metainfo.xml file:Method 1: Run this (substitute solus-builds for the directory you have on your system):
Also check t/texlive/files for the texlive fonts
Note: Make sure the package is actually a font. The above commands are provided for convenience.
Method 2: Run this to find all desktop font packages:
eopkg info -c desktop.font
Then pick a font and check its info in the repo. Pick one that has no metadata file to add appstream data to.
Create the metainfo file
Create a file
fontname.metainfo.xml
in thefiles
subdirectory (for the liberation-fonts-ttf font this file is namedfiles/liberation.metainfo.xml
because the font name isliberation
) It should containYou will need a few pieces of data for the file for the placeholders.
eopkg info fontname | grep Name
for idinstall
section of itspackage.yml
file. The font name is the last part of the directory in the install directive.package.yml
, if not please add it as part of your commit.If the font provides translations for the name, add them like this:
See this PR for reference.
Then install it via
package.yml
Build and test
To test the appstream metainfo is valid; after building the package with the appstream data included
Install
appstream-glib
then runappstream-builder --packages-dir=. --include-failed -v
Finally, check that the package doesn't show up in the
example-failed.xml.gz
file. The font preview will then show up in the software center whenappstream-data
is next refreshed.To cleanup after running appstream-builder, run:
rm -fr example* tmp/ cache/
.If a font package provides more than one font
appstream-builder
requires a 1:1 mapping between appstream data and packages. If a package provides several different families of fonts, it must also be sub-packaged if providing more than one appstream metainfo xml file.If a font is sub-packaged you can use the
extends
field in its metadata file so that one font extends another e.g.In the
package.yml
file only use one install directive for the metainfo file for the parent. Use patterns to put the sub-package metainfo.xml files in the right place. Example from noto-sans, which has noto-serif as a sub-package:Further information
Reference: The Freedesktop font metadata spec