Answer the question
In order to leave comments, you need to log in
How to correctly connect googlefont to the site?
Hello, I am connecting the Lobster font to the site, which is available through googlefonts. I only need Cyrillic characters, but it is not possible to configure (uncheck) the Latin option. You can connect the font using the following method:
<style>
@import url('https://fonts.googleapis.com/css?family=Lobster&subset=cyrillic');
</style>
/* cyrillic */
@font-face {
font-family: 'Lobster';
font-style: normal;
font-weight: 400;
src: local('Lobster'), local('Lobster-Regular'), url(http://fonts.gstatic.com/s/lobster/v18/c28rH3kclCLEuIsGhOg7evY6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'Lobster';
font-style: normal;
font-weight: 400;
src: local('Lobster'), local('Lobster-Regular'), url(http://fonts.gstatic.com/s/lobster/v18/RdfS2KomDWXvet4_dZQehvY6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Lobster';
font-style: normal;
font-weight: 400;
src: local('Lobster'), local('Lobster-Regular'), url(http://fonts.gstatic.com/s/lobster/v18/9NqNYV_LP7zlAF8jHr7f1vY6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Lobster';
font-style: normal;
font-weight: 400;
src: local('Lobster'), local('Lobster-Regular'), url(http://fonts.gstatic.com/s/lobster/v18/cycBf3mfbGkh66G5NhszPQ.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* cyrillic */
@font-face {
font-family: 'Lobster';
font-style: normal;
font-weight: 400;
src: local('Lobster'), local('Lobster-Regular'), url(http://fonts.gstatic.com/s/lobster/v18/c28rH3kclCLEuIsGhOg7evY6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
Answer the question
In order to leave comments, you need to log in
<link href="https://fonts.googleapis.com/css?family=Lobster&subset=cyrillic" rel="stylesheet">
font-family: 'Lobster', cursive;
The fact that GF gave a css file with a bunch of languages, including Vietnamese, is normal.
The fact is that modern browsers can determine which characters from which Unicode ranges are actually in the document. And depending on this, load or not load the desired file. Therefore, manually specifying the language for them has lost its meaning. The browser just needs to give links to all available language versions, and he will figure out what to download and what not.
And GF, in turn, determines which browser the client has and gives him the version of css that is most suitable. If you go from the old browser - there will no longer be "extra", there will be only what is indicated by the link.
At one time, this feature killed me for several hours of debugging:
Why can the ruble sign not work in iOS?
This was the moment when Chrome already supported auto-selection of subsets, but Safari did not yet. Accordingly, my error appeared only on Safari and therefore seemed like a glitch.
In short, everything is fine, leave GF alone.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question