ryanoasis / nerd-fonts

Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts: Hack, Source Code Pro, more. Glyph collections: Font Awesome, Material Design Icons, Octicons, & more

Home Page:https://NerdFonts.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide machine readable metadata for fonts

jcgruenhage opened this issue · comments

Requirements

  • I have searched the issues for my request and found nothing related and/or helpful
  • I have searched the FAQ for help
  • I have searched the Wiki for help

Is your feature request related to a problem? Please describe.

I'm currently working on packaging nerd-fonts for a Linux distribution. Right now, packaging nerd-fonts means I have to maintain a list of the fonts myself, check the licenses for the fonts from different places in your docs. Other distros are duplicating a lot of work here as well, and most of them could probably benefit from metadata being provided as well.

Examples of other Distros maintaining lists:

Describe the solution you'd like

It would be immensely helpful for me, and probably other distros as well, if there was a json/csv/whatever file attached as a release artifact, that contained few fields for each font. The fields I've gathered from looking at the other distros packaging nerd-fonts are:

  • original name for the font
  • nerd font name of the font
  • archive name
  • sha256sum of the release archive
  • license, as an SPDX License Expression

Describe alternatives you've considered

A lot of manual labor downstream for each distro that packages nerd-fonts. That's what's happening at the moment.

Additional context

None

commented

Thanks for the suggestion. This sounds useful and not too hard 👍

commented

Do you have an idea how to express a SIL with RFN as SPDX? Just OFL-1.1-RFN or has the reserved name to be put somewhere? 🤔

commented

SO. Needed to finish the release first ;-)

I believe this is a very good idea. We here also 'pack' the Nerd Font release, as Cask, and for that

  • all the archives are fetched (there is a helper script here)
  • calculate all the shas
  • throw away all archives

In principle the shas could be calculated earlier in the release process - when the archives are created we have them and calculating the checksum would be a breeze.

There is other 'metadata' that is strewn around in the repo, which I really hate: the config.cfg and the config.json (:sob:) and the almighty fonts.json. 🤔

Your examples: Thank you for providing the direct insight.
Nice is they all seem to use the tar.xz archives.

commented
  • sha256sum of the release archive

Alpine uses sha512 😬

I believe for

  1. original name for the font
  2. nerd font name of the font
  3. archive name
  4. sha256sum of the release archive
  5. license, as an SPDX License Expression

1, 2, and 3 (implicitely) are already in fonts.json. Here an example entry:

   {
      "unpatchedName": "Bitstream Vera Sans Mono",
      "RFN": true,
      "version": "1.1",    
      "patchedName": "BitstromWera",
      "folderName": "BitstreamVeraSansMono",
      "imagePreviewFont": "BitstromWera Nerd Font",
      "imagePreviewFontSource": "BitstreamVeraSansMono/Regular/VeraMono.ttf",
      "linkPreviewFont": "bitstream-vera",
      "caskName": "bitstream-vera-sans-mono",
      "repoRelease": true,
      "description": "Dotted zero, compact lowercase characters"
    },
  • original name for the font unpatchedName
  • nerd font name of the font patchedName
  • archive name .../releases/download/v{{ site.current_version }}/{{ font.folderName }}.zip (resp .xz)
  • sha256sum of the release archive
  • license, as an SPDX License Expression

Thanks for pointing out fonts.json - I wasn't aware of that and didn't look outside of the repo root. I think if the license expression is added there, the only bit missing is the checksum. I'm fine with that being missing though, that is something I can easily generate myself if necessary. If no one else has capacity to add the SPDX expressions, I can probably do that, but only towards the summer. My next three months are packed.

commented

If no one else has capacity to add the SPDX expressions, I can probably do that, but only towards the summer. My next three months are packed.

Well, my time is also overbooked by a factor of 3 ;-D

Whatever, maybe you @jcgruenhage can have a quick look at the PR

and check if it is useful.

For special licenses (which have no identifier in the SPDX table) I added something along these lines:

@@ -834,6 +898,7 @@
     },
     {
       "unpatchedName": "Ubuntu Sans",
+      "licenseId": "LicenseRef-UbuntuFont",
       "RFN": false,
       "version": "1.004",
       "patchedName": "UbuntuSans",

i.e. I added a LicenseRef- tag, but that is not resolved in the font.json file. Well, it's not a well formed SPDX file anyhow ;-)
But maybe that is useful?

commented

Well, I merged #1599, and set this to solved for the time being. We can improve at any time.

commented

The next release (i.e. 3.2.1) will come with a checksum file, hope that helps:

image

with content similar to this (here the release contained just 3 fonts to make the test faster)

image

Any comment @jcgruenhage ? Thank you!