Safari 3.1でWebフォントを利用する--様々な字体を定義する

エ・ビスコム・テック・ラボ
2008/04/04 08:00

Safari 3.1が対応したWebフォント。今回は様々な字体を定義してみよう。

 次のソースではすべての文字を「WebFont」で表示するように設定している。その上で、順にローマン体、イタリック体、ボールド体、ボールドイタリック体で表示するように設定した。

 イタリック体の「a」や「g」の文字を見ると、ローマン体を斜めに変形したものではなく、斜体としてデザインされたフォントで表示されていることがわかる。

Safari 3.1の表示 Safari 3.1の表示
/* =============================================== */
/* フォントの定義                                  */

@font-face	{
	font-family: WebFont;
	src: url('font/Fontin_Sans_R_45b.otf') format("opentype");
	}

@font-face	{
	font-family: WebFont;
	font-style: italic;
	src: url('font/Fontin_Sans_I_45b.otf') format("opentype");
	}

@font-face	{
	font-family: WebFont;
	font-weight: bold;
	src: url('font/Fontin_Sans_B_45b.otf') format("opentype");
	}

@font-face	{
	font-family: WebFont;
	font-style: italic;
	font-weight: bold;
	src: url('font/Fontin_Sans_BI_45b.otf') format("opentype");
	}

/* =============================================== */

div	{
	font-family: WebFont; 
	font-size: 40px;
	}

div#font01	{
	font-style: normal;
	font-weight: normal;
	}

div#font02	{
	font-style: italic;
	font-weight: normal;
	}

div#font03	{
	font-style: normal;
	font-weight: bold;
	}

div#font04	{
	font-weight: bold;
	font-style: italic;
	}
<div id="font01">My Favorite Songs - 12345</div>
<div id="font02">My Favorite Songs - 12345</div>
<div id="font03">My Favorite Songs - 12345</div>
<div id="font04">My Favorite Songs - 12345</div>
ブラウザで表示を確認する
  • コメント(2件)

#1 y2  - 2008/04/04 12:50:19

「字体」の定義が標準的なものとは違うので、混乱する読者がいるかもし... 続きを見る
» 不適切なコメントを報告する

#2 Cee  - 2008/04/07 11:26:24

前回の背景画像複数指定も含め、まずはそれぞれのブラウザによる対応が... 続きを見る
» 不適切なコメントを報告する
記事の感想やご意見をコメントでお寄せください(CNET_IDログインが必要です)
ログイン パスワードを忘れた方  |  新規登録
  • 新着記事
  • 人気記事
  • 特集
  • ブログ
  • 読者投票
    今、使っているマシンのOSは?

    投票受付期間:2008年6月27日 〜 2008年7月11日
  • » 投票しないで結果だけ見る