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

subset parameter in URL is ignored for resulting CSS #68

Closed
alistairjcbrown opened this issue Jul 2, 2015 · 2 comments
Closed

subset parameter in URL is ignored for resulting CSS #68

alistairjcbrown opened this issue Jul 2, 2015 · 2 comments

Comments

@alistairjcbrown
Copy link

Setting the subset parameter is ignored and all languages are output in the resulting CSS.
These URLs have been generated from the quick use page.

Example

Requesting "Open Sans, Light 300"

Default (Latin)

http://fonts.googleapis.com/css?family=Open+Sans:300

Output contains all languages

/* cyrillic-ext */
  ...
}
/* cyrillic */
  ...
}
/* greek-ext */
  ...
}
/* greek */
  ...
}
/* vietnamese */
  ...
}
/* latin-ext */
  ...
}
/* latin */
  ...
}
Setting specifically (Greek)

http://fonts.googleapis.com/css?family=Open+Sans:300&subset=greek

Output contains all languages

/* cyrillic-ext */
  ...
}
/* cyrillic */
  ...
}
/* greek-ext */
  ...
}
/* greek */
  ...
}
/* vietnamese */
  ...
}
/* latin-ext */
  ...
}
/* latin */
  ...
}
@davelab6
Copy link
Member

davelab6 commented Jul 2, 2015

This is working as intended :)

You're using a browser with support for unicode-range (eg, Chrome) which is in your .... That means the font files are only fetched when the DOM includes characters that require them.

One can be a little misled by page load impact graphics, which show what would happen to browsers for which unicode-range is not supported; but those browsers are always served CSS that enumerates only the subset-requested files.

@davelab6 davelab6 closed this as completed Jul 2, 2015
@davelab6 davelab6 self-assigned this Jul 2, 2015
@alistairjcbrown
Copy link
Author

@davelab6 TIL - thanks!
I'd forgotten that the CSS returned is tailored to the requesting browser.

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