Comments (3)
One easy (but maybe not good enough?) workaround Google Fonts can take is to include the full font as the very first @font-face
:
/* full font */
@font-face {
font-family: 'Inter Tight';
font-style: italic;
font-weight: 100 900;
font-display: swap;
src: url(https://fonts.gstatic.com/s/intertight/v7/NGSnv5HMAFg6IuGlBNMjxJEL2VmU3NS7Z2mj6AiqWSRToK8EPg.woff2) format('woff2');
/* Note: no unicode-range */
}
/* cyrillic-ext */
@font-face {
font-family: 'Inter Tight';
font-style: italic;
font-weight: 100 900;
font-display: swap;
src: url(https://fonts.gstatic.com/s/intertight/v7/NGSyv5HMAFg6IuGlBNMjxLsCwadkREW-emmbxg.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'Inter Tight';
font-style: italic;
font-weight: 100 900;
font-display: swap;
src: url(https://fonts.gstatic.com/s/intertight/v7/NGSyv5HMAFg6IuGlBNMjxLsCwa5kREW-emmbxg.woff2) format('woff2');
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* ... */
Per the spec, the later @font-face
s take the precedence over the earlier ones. So in this situation, the full font will only be downloaded if the page uses glyphs not present in the subsetted @font-face
s.
from fonts.
@rsheeter, do you have an explanation?
from fonts.
This, while suboptimal, is by design.
For context,
Adding a "whole font" final face with no unicode-range results in an absurdly high volume of downloads to fetch characters the font doesn't support, often downloading several unicode-range faces plus a duplicative and unused whole font.
Generating a subsetting scheme unique to the family would fix this but we have not currently implemented that.
https://www.w3.org/TR/IFT/ is meant to fix this once and for all. We chose to deprioritize improving the existing mechanism to focus on that. In retrospect our estimates for how fast we could ship IFT may have been optimistic.
from fonts.
Related Issues (20)
- Update Oi with Arabic
- Add Forvertz HOT 1
- Improve glyphset viewing and embedding specific characters
- Noto Serif Khmer Font Problem in Microsoft Word
- Fix shaping of the dot in the j caron dot below
- Add Noto Color Emoji Animated
- Add Nithya Ranjana
- Add [Open Sans Condensed] HOT 1
- 18 kubrat musamim
- Update Rubik Moonrocks
- Update Rubik Wet Paint
- Update Rubik Spray Paint HOT 1
- Update Rubik Bubbles
- Update Rubik Maps
- Update Rubik Doodle Shadow
- Update Rubik Burned HOT 1
- Update Rubik Distressed HOT 1
- Add Samsung Color Emoji
- Add OpenMoji
- Add SerenityOS Emoji HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fonts.