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

Distribute fonts and css in git repository to make cdnjs work #942

Closed
aymanbagabas opened this issue Apr 8, 2021 · 14 comments
Closed

Distribute fonts and css in git repository to make cdnjs work #942

aymanbagabas opened this issue Apr 8, 2021 · 14 comments

Comments

@aymanbagabas
Copy link

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

Describe the solution you'd like
Distribute fonts in the Git repository at dist/{font-variant}/*.(css|ttf|woff2)

Describe alternatives you've considered
Host distributed fonts in a CDN

Additional context
I've created a draft PR for cdnjs/packages cdnjs/packages#685 to add Iosevka to their CDN, however, currently Iosevka does not distribute the fonts in the Git repository rather in Github releases which cdnjs doesn't support.

cdnjs supports either npm/git package distributions. If we can distribute the fonts in a directory along with tagging each release, we would be able to use cdnjs as a free CDN service at the cost of having the fonts and css assets in the repository. cdnjs/packages/CONTRIBUTING

@be5invis what do you think?

@be5invis
Copy link
Owner

be5invis commented Apr 8, 2021

It will only have Iosevka / Slab / Aile / Etoile, no SS or Term / Fixed variations...

@aymanbagabas
Copy link
Author

aymanbagabas commented Apr 8, 2021

It will only have Iosevka / Slab / Aile / Etoile, no SS or Term / Fixed variations...

It'd also be great if the generated css files are minified.

Lmk if I can help with anything :)

@be5invis
Copy link
Owner

be5invis commented Apr 9, 2021

Alternatively, I think it is possible for you to set up a repository that holds web font versions of Iosevka, and you can grab its contents from Iosevka Releases using a scheduled workflow. I do not want to maintain "packages" on my own since it will reduce the bandwidth that is used in actual font development.

@aymanbagabas
Copy link
Author

@be5invis would you be interested in using GH actions to automate this process? I can come up with a GH actions workflow to build the fonts, tag the release, and push them to another repository.

@Diablo-D3
Copy link

Diablo-D3 commented Apr 9, 2021

I, too, wish there was a repository that just held the most recent release of files.

Edit: I'm slightly hijacking this feature request ticket: I wish to be able to just have a repo I can git submodule as part of my dotfiles. Else, I have no other automated way to keep up to date with the file. I'd prefer one that had the Super TTC, as that is what I use now, but I'll take what I can get.

Either that, or just the raw Super TTC updated on a webserver that I can just wget and overwrite with.

@aymanbagabas
Copy link
Author

Idea: Automate building and publishing the fonts using GitHub actions.

We could use GitHub actions to automatically build the fonts, and then push them back to the repository on every commit to master under a directory such as dist. For releases, we could also create a workflow to trigger when a release is created, and since we already have the fonts built and stored in the repository, we could generate release notes, package the fonts and update the release body to have the notes and the packaged fonts.

I noticed FiraCode font is doing a similar thing but only uploads the font assets to GitHub actions artifacts.

Quick Google search gave me these two actions that would be useful in automating this

@be5invis
Copy link
Owner

It should be better to set up a new repository that grabs releases of Iosevka and once the version is changed, publish its contents.

@aymanbagabas
Copy link
Author

It should be better to set up a new repository that grabs releases of Iosevka and once the version is changed, publish its contents.

@be5invis Do you mind creating a new repository Iosevka-font for instance? If we're going to leverage Github actions, both repositories should have the same owner. Then we'd add a workflow in this repository to trigger on push and/or new release to build the fonts, tag them, and push them to the other repository.

@be5invis
Copy link
Owner

@aymanbagabas I think grabbing releases doesn't need extra auth. It's just an artifact download.

@aymanbagabas
Copy link
Author

@be5invis I've created a new repository iosevka-fonts that contains the releases in dist/ and checks for updates daily using a corn job. Let me know if this looks good. I only included these fonts iosevka iosevka-aile iosevka-curly iosevka-curly-slab iosevka-etoile iosevka-slab iosevka-sparkle

@be5invis
Copy link
Owner

@aymanbagabas LGTM.

@aymanbagabas
Copy link
Author

I think this can be closed now since cdnjs/packages#705 is merged. Anyone can use cdnjs and/or JSDelivr to get the fonts from iosevka-fonts as the example below:

https://cdn.jsdelivr.net/gh/aymanbagabas/iosevka-fonts@v6.1.2/dist/iosevka/iosevka.min.css
https://cdnjs.cloudflare.com/ajax/libs/Iosevka/6.0.0/iosevka-etoile/iosevka-etoile.min.css

Available fonts are iosevka iosevka-aile iosevka-curly iosevka-curly-slab iosevka-etoile iosevka-slab iosevka-sparkle you can replace the font version and variant in the URL.

@be5invis be5invis closed this as completed May 3, 2021
@aymanbagabas
Copy link
Author

@be5invis should we add a short blurb under Installation in the readme?

@be5invis
Copy link
Owner

be5invis commented May 7, 2021

@aymanbagabas Feels free to submit a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants