Jump to content

Using a non-existing font.. ?


Elmacik

Recommended Posts

Hi folks,I am willing to use a non-existing font in the user agent. How can I make the client user agent to auto-download my font and view the page with that?Is there a way by coding? Or the agent will automatically get it if it cant find?This is what I found in w3.org :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><HTML>  <HEAD>    <TITLE>Font test</TITLE>    <STYLE TYPE="text/css" MEDIA="screen, print">      @font-face {        font-family: "Robson Celtic";        src: url("http://site/fonts/rob-celt")      }      H1 { font-family: "Robson Celtic", serif }    </STYLE>  </HEAD>  <BODY>    <H1> This heading is displayed using Robson Celtic</H1>  </BODY></HTML>

Is this exactly what I mean? :) I tried bu no luck..And what does @, # mean in CSS coding?

Link to comment
Share on other sites

You're near :)

some_class {font-family: url(http://site/fonts/rob-celt)}
This would mean the user doesn't download the font to his fonts directory at his computer, but to his internet cache directory. So he has the font only temporarily.I don't know how to force download it as a file via CSS, not possible I think. If you want the user to manualy download it, make a link on your page to the font :)
Link to comment
Share on other sites

Actually, you do it the right way Elmacik.Now all you have to do is to convert the font you want to an EOT file (with Microsoft Weft), upload it to your site and point to its URL instead of http://site/fonts/rob-celt. Though you should know that only IE supports embedding EOT fonts, and that the font-face at-rule has been removed in CSS 2.1 (doesn't mean it's unusable though).EDIT: Your Document Type Declaration has its URL mssing. Should be<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

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
×
×
  • Create New...