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

Add self-hosting of fonts-com fonts #34

Open
Munter opened this issue Jun 29, 2018 · 11 comments
Open

Add self-hosting of fonts-com fonts #34

Munter opened this issue Jun 29, 2018 · 11 comments

Comments

@Munter
Copy link
Owner

Munter commented Jun 29, 2018

Forked from discussion in #31

What does a typical fonts.com css and fonts setup look like when using their service?

How do we determine if self-hosting is permitted?

How do we get at all the font assets. Do they serve browser specific css like google fonts does?

@papandreou

@papandreou
Copy link
Collaborator

What does a typical fonts.com css and fonts setup look like when using their service?

Looks like we use it by putting something like this in <head>:

<link type="text/css" rel="stylesheet" href="https://fast.fonts.net/cssapi/34d68d8f-2eac-4fb7-b0da-1759668cf274.css" />

That's probably a personalized url that was issued when we signed up and paid for the service.

They use an @import to phone home/track usage

@import url(/t/1.css?apiType=css&projectid=34d68d8f-2eac-4fb7-b0da-1759668cf274);

How do we determine if self-hosting is permitted?

Since some of their packages permit self-hosting, I think it would be OK for subfont not to try to enforce anything on their behalf?

@Munter
Copy link
Owner Author

Munter commented Jun 29, 2018

Hmm. https://fast.fonts.net/cssapi/34d68d8f-2eac-4fb7-b0da-1759668cf274.css doesn't even annotate font-weight and font-style. Would our resolver even work for that?

The stylesheet itself links to all the fonts, so from that perspective its much easier than with google fonts, where you have to fake a user agent to get it to serve the css with links to the right font format

@papandreou
Copy link
Collaborator

How do we get at all the font assets. Do they serve browser specific css like google fonts does?

It looks like their @font-face syntax is "bulletproof". They don't seem to be serving dynamic CSS.

@papandreou
Copy link
Collaborator

doesn't even annotate font-weight and font-style. Would our resolver even work for that?

I think we do support that (I'm fairly sure they just default to their initial value, normal). Would be good to add a test, though.

@papandreou
Copy link
Collaborator

@Munter
Copy link
Owner Author

Munter commented Jun 29, 2018

That seems like a problem though. That CSS you linked to contains a bunch of different variations of Avenir. Light, light + italic, regular, demibold etc. But they are only identified by their unique name. That means that any use of italics or boldness would not enable the browser to switch to a different font-family definition. It would have to faux all of it.

But maybe that's mostly a problem with the font service. If one of those unique font names apply based on our calculations, we should still be adhering to whatever the browser interprets it as

@papandreou
Copy link
Collaborator

Yeah, agreed. It could be that they thought this would be "simpler" for the user, to just use distinct font-faces for each variant.

@papandreou
Copy link
Collaborator

papandreou commented Jun 30, 2018

doesn't even annotate font-weight and font-style. Would our resolver even work for that?

We do support that. Added a test here: assetgraph/assetgraph@47c18dc

@papandreou
Copy link
Collaborator

Turns out we're actually in the process of switching away from fonts.com, so I'm less likely to look into this atm.

@Munter
Copy link
Owner Author

Munter commented Jul 9, 2018

I'll get o it eventually. I have a bunch of changes I want to make in the subset transform anyway

@papandreou
Copy link
Collaborator

@Munter, okay, cool!

Which changes are you planning to make? Just so we don't step on each other's toes :)

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

No branches or pull requests

2 participants