2

For example I could do an import like this:

@import url(http://fonts.googleapis.com/css?family=Roboto:100,400,900);

But could I also do one like this and would it make sense (Are the only valid values 100, 400, 900)?

@import url(http://fonts.googleapis.com/css?family=Roboto:100,200, 300, 400,500, 600, 700, 800, 900);
JJJ
  • 32,902
  • 20
  • 89
  • 102
Ole
  • 41,793
  • 59
  • 191
  • 359
  • Possible duplicate of [Specifying Style and Weight for Google Fonts](http://stackoverflow.com/questions/7256065/specifying-style-and-weight-for-google-fonts) – CodeMonkey Mar 27 '17 at 04:16
  • I did look at specifying style and weight but it did enumerate the possible weights. The answer below that I accepted is the one I'm looking for. – Ole Mar 27 '17 at 06:05
  • Happy that you could find the answer. Cheers..! – CodeMonkey Mar 27 '17 at 06:06

3 Answers3

2

It depends on the font. If you are at Google Fonts and you select a font. Then select the family selected in the bottom right, then click the tab that says customize you can see all the font weights that the font will support.

Your current example is exactly how it will look if those font weights are supported. Here is roboto with all the possible font weights and styles.

@import url('https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i');

The i stands for italic

To use these fonts you then do

.this-is-my-class {
    font-family: 'Roboto';
    font-weight:100; // or 100 - 900
    font-style: italic; // or normal 
 }
Gary Holiday
  • 3,297
  • 3
  • 31
  • 72
1

May be this answer suitable to you

please go through this link

Specifying Style and Weight for Google Fonts

Community
  • 1
  • 1
saiibitta
  • 377
  • 2
  • 18
1

Depends on what is generated when you select a Font enter image description here

This is generated when you select weights: enter image description here

rodelm
  • 331
  • 3
  • 4