PDA

View Full Version : embed font


WoGuziczek
04-14-2009, 10:59 AM
Hi!
I wanted to put in my forum external font "Myriad Pro".

I have the code:
@font-face
(
Font-family: "Myriad Pro";
Src: url (path/ fonts/MyriadPro-Regular.otf);
Font-style: normal;
Font-weight: normal;
)

Where do I put it?

TigerC10
04-14-2009, 04:25 PM
You can't do it that way. You have to use either a .pfr font or a .eot font. If you use the .eot font, then it only works with internet explorer, so you should find/use a .pfr instead.

You can use a program like this one to convert the font:
http://www.fontlab.com/font-converter/transtype/


After you have the correct font type...

Use this code (for the PFR fonts) in the headinclude template:

<LINK rel = "fontdef" src="url/YourFontName.pfr">




Use this code (for the EOT fonts) anywhere on the page (headinclude template is best):

<STYLE TYPE="text/css">
<--!
@font-face {
font-family: Arial;
font-style: normal;
font-weight: normal;
src:url(url/EOTfileName.eot);
}
-->
</STYLE>



You should consider that people will have longer download times when viewing your pages, so watch out for large font files. Also, some browsers will complain about security concerns. Embeddable fonts on websites have been a method of attack on a user's computer for years and some browsers will prompt security dialogues about it.