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

Hosting Libertinus on a CDN #362

Open
ghost opened this issue Sep 20, 2020 · 8 comments
Open

Hosting Libertinus on a CDN #362

ghost opened this issue Sep 20, 2020 · 8 comments
Labels
enhancement pr-welcome A PR contributing towards this issue would be welcome.

Comments

@ghost
Copy link

ghost commented Sep 20, 2020

First, congratulations for your work (and the previous maintainer's). Libertinus is my favorite font for composing in the fields of humanities.

I must, however, always deal with downloading, hosting and maintaining the font files from the releases. I tried to push hosting on Google Fonts, but it seems it will take time.

Is there any way for you to publish the OTF files on a CDN? I would love to have a static URL to the latest release, without having to host the files myself.

Thank you very much for your time.

@lutetiensis
Copy link

lutetiensis commented Sep 26, 2020

Same need. I eventually hosted the OTF on my forked repo. I know this is not the current direction (cf. 213c4b4).

@alerque Do you need some help on this?

@alerque
Copy link
Owner

alerque commented Sep 26, 2020

Thanks for bringing this up. I do understand why it can be a need for people, but there are a number of issues here and it isn't clear to me what the best solution is.

  1. I've been a server admin and have continuously maintained bare metal servers since the '90s and cloud instances since before 'cloud computing' was invented as a term. I both can host things and very definitely don't want to be responsible for this one. I am not in the CDN business.

  2. There are lots of good CDNs out there, it is not unreasonable to post Libertinus on one of them such that there were stable URLs people could use. The catch here is that most of the good ones also cost money, and that usually depends on usage. This project is a time sink, I don't want it to be a money sink as well. I already host the font files for usage on my own sites, but given the high usage this could see I'm not about to open that up to 3rd party sites.

  3. There is an open issue on the Google Fonts repository and there is some hope that Libertinus could land there. Attention to that issue and the releated licensing snafu on fontship from people interested in seeing this could help push it along. That being said there are a number of down-sides to using Google Fonts as a CDN, one of them being that they don't support OpenType Features at all! Their complete lack of any versioning is another downside. It might serve some people okay, but it's not a silver bullet.

  4. Using GitHub is not really an option for this. I know they let it slide a lot, but using raw.githubusercontent.com as a CDN to embed stuff is (last I checked, admittedly a few years ago) against their terms of service. Also the service is rate limited and hence the more people you point at a stable URL the more likely it is everybody is going to get cut off! There have been a number of 3rd party services that have tried to bridge this gap, but most haven't had a business model that allowed them to succeed for the long haul. It's possible using their Pages service for this might have different terms—I know it has higher rate limits. Maybe somebody can look into that.

  5. If somebody knows of a reliable 3rd party CDN service that would be interested in hosting Libertinus for general consumption without it being a financial burden I would be happy to look into publishing to it as a regular part of the release process.

Also ya'll using this online should be using a webfont build, not the OTFs! See #363.

@alerque alerque added the pr-welcome A PR contributing towards this issue would be welcome. label Sep 26, 2020
@lutetiensis
Copy link

lutetiensis commented Sep 26, 2020

Thanks a lot for having shared your insights! I completely understand you don't want to host the service, or pay for it, and I agree with you. Thanks also for commenting on Google and GitHub.

I did some research, and you're right, most of the CDNs aren't free. I found out about jsDelivr however, and people seem to like. You just need to maintain a repository with the binaries.

https://cdn.jsdelivr.net/gh/lutetiensis/libertinus@master/releases/Libertinus-7.000/static/OTF/LibertinusSerif-Regular.otf

It seems too good to be true, so I am probably missing something!

That's worth trying though, with a big disclaimer.

@alerque
Copy link
Owner

alerque commented Sep 26, 2020

Re jsDelivr ... why don't you give that a test run for a while and report back in a month or two how it goes. If all is well I'll look into setting up an official one and wire up the release pipeline to publish to it automatically.

@lutetiensis
Copy link

Sure, let me try!

@lutetiensis
Copy link

lutetiensis commented Oct 3, 2020

WOFF2 files are now available thanks to #365.

https://cdn.jsdelivr.net/gh/lutetiensis/libertinus@master/releases/Libertinus-7.000-r14-gbc8b13/static/WOFF2/LibertinusSerif-Regular.woff2

No issue with jsDelivr so far! One minor note: you cannot access released assets, the files must be in the tree. See this.

@alerque
Copy link
Owner

alerque commented Oct 3, 2020

Thanks for the testing @lutetiensis. This does look like a promising direction. However using a Git repo as a source looks like a dirty hack. Using a published NPM package as a source actually looks like a better direction. My suggestion is to:

  1. Add a make target to Fontship that generates a webfont package. This would bundle just the webfont format, any relevant CSS or supporting files, plus of course the licenses and and meta data. This package should be laid out in a suitable way for web projects that use npm anyway to add as a dependency to their projects and get the appropriate versioned Libertinus fonts suitable for self-hosting in a project.

  2. With that feature available, I'll use it to publish an official Libertinus packages to the NPM registry and/or Github's package registry. This will happen automatically when a release is tagged.

  3. The previous step should make the jsDelivr step to use Libertinus from a CDN rather than a project-local install a walk in the park.

How does that plan sound? Is there anyone with expertise on what the file layout of said NPM package should be for most efficient addition of a webfont to a project? If so please chip in that information on the Fontship issue I'm about to open... theleagueof/fontship#88

@lutetiensis
Copy link

Sounds good to me! Let me know when you need a tester!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement pr-welcome A PR contributing towards this issue would be welcome.
Projects
None yet
Development

No branches or pull requests

2 participants