css2を使用してサーバーからフォントをロードしたい。サーバーにフォントを保持したい。すべてのブラウザがCSS3をサポートしているわけではないので、CSS3を使用したくないので、css2を使用してそれを行うにはどうすればよいですか。
@font-face
css2を使用してサーバーからフォントをロードしたい。サーバーにフォントを保持したい。すべてのブラウザがCSS3をサポートしているわけではないので、CSS3を使用したくないので、css2を使用してそれを行うにはどうすればよいですか。
@font-face
<style type="text/css">
@font-face {
font-family: 'lucida_sans_unicoderegular';
src: url('font/lsansuni-webfont.eot');
src: url('font/lsansuni-webfont.eot?#iefix') format('embedded-opentype'),
url('font/lsansuni-webfont.woff') format('woff'),
url('font/lsansuni-webfont.ttf') format('truetype'),
url('font/lsansuni-webfont.svg#lucida_sans_unicoderegular') format('svg');
font-weight: normal;
font-style: normal;
}
#menu {
font-family: 'lucida_sans_unicoderegular',Times New Roman, Times, serif;
}
</style>
lsansuni-webfont.eot、lsansuni-webfont.wof、..このファイルをフォントフォルダに配置します
このジェネレータを使用して@fontfaceを作成します
@font-face
はcssルールであり、ユーザーがそのフォントをインストールしていない場合に、サーバーから特定のフォントをダウンロードしてWebページをレンダリングできるようにします。これは、Webデザイナーが、ユーザーがコンピューターにプリインストールした特定の「Webセーフ」フォントのセットに準拠する必要がなくなることを意味します。
@font-face {
font-family: <a-remote-font-name>;
src: <source> [,<source>]*;
[font-weight: <weight>];
[font-style: <style>];
}
@font-face {
font-family: MyHelvetica;
src: local("Helvetica Neue Bold"),
local("HelveticaNeue-Bold"),
url(MgOpenModernaBold.ttf);
font-weight: bold;
}
IE 6、7、8、9、10、Firefox、Chromeでサポートされています。