asb-plugin-font: Make a priority for Regular style of fonts
This change aims to improve a text in summary and the order of screenshots for Regular style of fonts.
Removing a direct dependency to FreeType as a side-effect.
Fixes https://github.com/hughsie/appstream-glib/issues/493
After this fix:
$ zgrep summary /tmp/repodata/example.xml.gz| wc -l
294
$ zgrep summary /tmp/repodata/example.xml.gz| grep Regular | wc -l
293
$ zgrep -C3 "A Light font from Noto Sans Hebrew" /tmp/repodata/example.xml.gz
<pkgname>google-noto-sans-hebrew-vf-fonts</pkgname>
<source_pkgname>google-noto-fonts</source_pkgname>
<name>Noto Sans Hebrew</name>
<summary>A Light font from Noto Sans Hebrew</summary>
<description><p>(null)</p></description>
<icon type="cached" height="64" width="64">org.fedoraproject.google-noto-sans-hebrew-vf-fonts.png</icon>
<project_license>OFL-1.1</project_license>
$ fc-query -f "%{family}:%{style}\n" /usr/share/fonts/google-noto-vf/NotoSansHebrew\[wght\].ttf
Noto Sans Hebrew,Noto Sans Hebrew Light:Light,Regular
Noto Sans Hebrew,Noto Sans Hebrew Light:Medium
Noto Sans Hebrew,Noto Sans Hebrew Light:SemiBold
Noto Sans Hebrew,Noto Sans Hebrew Light:Bold
Noto Sans Hebrew,Noto Sans Hebrew Light:
So it works as expected.
For screenshots, there was weird behavior that screenshot already exists with hash blahblahblah and it wasn't 100% reproducible. well, it basically always happened but sometimes with font A but sometimes with font B etc.
Without this patch:
$ tar tvfa /tmp/repodata/example-screenshots.tar| wc -l
361
With this patch:
$ tar tvfa /tmp/repodata/example-screenshots.tar| wc -l
2025
This isn't yet everything. The above warning still happens with some fonts. no idea why. we may need to investigate it furthermore.
Noto fonts has at least:
$ fc-scan -f "%{family}:%{style}\n" /usr/share/fonts/google-noto | wc -l
2057
$ fc-scan -f "%{family}:%{style}\n" /usr/share/fonts/google-noto-vf | wc -l
499