#10 Can't package a font that has a name that ends with "Black"
Closed by nim. Opened by mavit.

I've been trying to repackage OpenMoji fonts using the new guidelines for https://bugzilla.redhat.com/show_bug.cgi?id=1803059, but kept getting the following error:

error: line 50: %package     -n hfg-gmuend-openmoji-fonts: package hfg-gmuend-openmoji-fonts already exists

There are two versions of the OpenMoji font: OpenMoji Color and OpenMoji Black (where Black isn't a weight, but is short for "black and white"). After much head scratching, I realised that function rpmname() in fonts.lua strips the string "Black" from the name supplied to %fontfamily1, causing %fontpkg -a to explode.


Black is one of the magic common weight keywords in OpenType, and weight qualifiers should not occur in the font family name, that’s why it is stripped by default (otherwise packagers that did not read guidelines kept mis-interpretting what font family means).

In your case Black does not mean Black in the usual OpenType sense, but the automation can not guess that. Such collisions are extremely rare, font makers are very aware of common keywords. They avoid using them in other contexts, because that confuses apps and people.

In such a corner case, after you’ve checked it’s an actual corner case not a packaging mistake, you can override automation and just set fontpkgnameX manually. The automation is very careful to never stomp on variables set by the packager.

This is done for “Cormorant Upright” here (another corner case where upright is deliberately added to the font family name to mark it derives Regular from Italic instead of the usual reverse).

https://src.fedoraproject.org/rpms/catharsis-cormorant-fonts/blob/master/f/catharsis-cormorant-fonts.spec#_83

I don’t think we have another example in the distribution right now. As I wrote, such re-purposing of common keywords in font family names is extremely rare.

Metadata Update from @nim:
- Issue status updated to: Closed (was: Open)

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/i18n/fonts-rpm-macros/issues/10

Please continue any further discussion there.

Metadata