複数のウェイトとスタイル (レギュラー、ボールド、イタリック、ボールド イタリック) を持つ単一のフォント ファイルにフォント ファミリがあり、@font-face タグを使用してフォント フェイスを定義したいと考えています。どうやってやるの?
私がこれを行う場合:
@font-face {
font-family: 'Font Regular';
src: url('font.eot');
src: url('font.eot?#iefix') format('embedded-opentype'),
url('font.woff') format('woff'),
url('font.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Font Bold';
src: url('font.eot');
src: url('font.eot?#iefix') format('embedded-opentype'),
url('font.woff') format('woff'),
url('font.ttf') format('truetype');
font-weight: bold;
font-style: normal;
}
... 通常の書体で、Regular と Bold の両方が表示されます。
h1、h2、h3 などに font-weight: bold を設定すると、これらの要素が電子太字として表示されます。1 つのフォント ファイルから複数の書体を抽出するにはどうすればよいですか?