Можно ли добавить line-height
в @font-face
вместо :root
, body
, *
, div
и других элементов?
У меня есть несколько шрифтов, используемых в сетиприложение.Например, мы использовали шрифты Lato и Roboto.Если применяется шрифт Lato, мне нужно дать line-height: 1.4em
, если применяется шрифт Roboto, мне нужно дать line-height: 1.6em
.Есть ли способ добавить line-height
в @font-face
или еще какие-нибудь хитрости?
* {
margin: 0;
padding: 0;
}
@font-face {
font-family: myFont;
src: url(https://fonts.gstatic.com/s/tangerine/v11/IurY6Y5j_oScZZow4VOxCZZMprNA4A.woff2) format('woff2');
font-weight: 400;
font-style: normal;
line-height: 40px;
}
div {
font-family: myFont;
font-size: 32px;
}
<div>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
<br/><br/><br/>
<p>
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only
</p>