Jump to content

custom fonts


killay

Recommended Posts

Hi,I'm trying to embed a custom font into my website.I made some researches and found out it's possible by converting your font into an ".eot" file and then using following css code:

<style type="text/css">@font-face {font-family: nameoffont;font-style: normal;src: url(nameoffont.eot);}</style>

But how do I call my <div> then? <div id="font"> ?Or is there any other way to do it?

Link to comment
Share on other sites

I've never done this. But it looks like you would just add "nameof font" (font names must contain quotes if they contain spaces) to your style declarations.

#sample {font-family: "nameof font", Arial, "Times New Roman";}

Link to comment
Share on other sites

Oh dear...

Embedded OpenType is a proprietary standard supported exclusively by Internet Explorer.
But anyway, did you just rename the font file with .eot, or did you use the Microsoft WEFT tool? Only the latter method ensures a correct .eot file. Then, after the @font-face declaration you would just name the font when defining font-family, as per ScottR's post.
<style type="text/css">@font-face {	font-family: nameoffont;	font-style: normal;	src: url(nameoffont.eot);}div#font /* or whichever element */ {	font-family:nameoffont;}</style>

Link to comment
Share on other sites

Well I used microsoft WEFT tool.I just saved it on my computer and later uploaded on the webspace.This is the code I have:

<html><head><meta http-equiv="Content-Type" content="text/html;iso-8859-1"><meta name="description" content="FW MX CSS Layer"><style type="text/css">@font-face {font-family: STEREOF0;font-style: normal;src: url(STEREOF0.eot);}div#welcome {font-family: "STEREOF0";}</style></head><body>	<div id="welcome">	:: Welcome to ...::	</div></body></html>

But apperently it doesn't work.

Link to comment
Share on other sites

What browser are you using? Also, you can remove the quotes for single-word font names.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...