Jump to content

custom fonts


killay
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...