Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide machine readable metadata for fonts #1578

Closed
3 tasks done
jcgruenhage opened this issue Mar 31, 2024 · 10 comments
Closed
3 tasks done

Provide machine readable metadata for fonts #1578

jcgruenhage opened this issue Mar 31, 2024 · 10 comments

Comments

@jcgruenhage
Copy link

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

@Finii
Copy link
Collaborator

Finii commented Apr 2, 2024

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

@Finii
Copy link
Collaborator

Finii commented Apr 2, 2024

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? 🤔

@Finii
Copy link
Collaborator

Finii commented Apr 4, 2024

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.

@Finii
Copy link
Collaborator

Finii commented Apr 9, 2024

  • 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

@jcgruenhage
Copy link
Author

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.

Finii added a commit that referenced this issue Apr 9, 2024
[why]
It can be hard to find out which license a particular font is using.
Therefore we add a new field to the fonts.json with an SPDX license
identifier (if possible).

[how]
For fonts with a license that has no SPDX identifier we use a free
`LicenseRef-*` identifier, but that reference is not solved in the
fonts.json file.

[note]
Also correct some licensing info given in the license audit.

Related: #1578

Suggested-by:  Jan Christian Gruenhage <[email protected]>
Signed-off-by: Fini Jastrow <[email protected]>
@Finii Finii mentioned this issue Apr 9, 2024
2 tasks
@Finii
Copy link
Collaborator

Finii commented Apr 9, 2024

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?

Finii added a commit that referenced this issue Apr 9, 2024
[why]
It can be hard to find out which license a particular font is using.
Therefore we add a new field to the fonts.json with an SPDX license
identifier (if possible).

[how]
For fonts with a license that has no SPDX identifier we use a free
`LicenseRef-*` identifier, but that reference is not solved in the
fonts.json file.

[note]
Also correct some licensing info given in the license audit.

Related: #1578

Suggested-by:  Jan Christian Gruenhage <[email protected]>
Signed-off-by: Fini Jastrow <[email protected]>
Finii added a commit that referenced this issue Apr 12, 2024
[why]
It can be hard to find out which license a particular font is using.
Therefore we add a new field to the fonts.json with an SPDX license
identifier (if possible).

[how]
For fonts with a license that has no SPDX identifier we use a free
`LicenseRef-*` identifier, but that reference is not solved in the
fonts.json file.

[note]
Also correct some licensing info given in the license audit.

Related: #1578

Suggested-by:  Jan Christian Gruenhage <[email protected]>
Signed-off-by: Fini Jastrow <[email protected]>
@Finii
Copy link
Collaborator

Finii commented Apr 12, 2024

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

@Finii Finii closed this as completed Apr 12, 2024
@jcgruenhage
Copy link
Author

@Finii thanks!

Finii added a commit to Finii/nerd-fonts that referenced this issue Apr 12, 2024
Finii added a commit to Finii/nerd-fonts that referenced this issue Apr 12, 2024
@Finii
Copy link
Collaborator

Finii commented Apr 12, 2024

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!

Finii added a commit that referenced this issue Apr 12, 2024
Fixes: #1578

Signed-off-by: Fini Jastrow <[email protected]>
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants