Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10

Thread: Embeding fonts

  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Embeding fonts

    Is it possible to embed a font type into a webpage, so if the visitor does not have that font type it will still work?

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    344
    Thanks
    0
    Thanked 0 Times in 0 Posts
    good question...

    here's the answer - no

    Sorry to be the bearer of bad news... but there's no way to do this. Only work around is to make images - but if you're talking about using the font for all the text - this is not a valid option...

    you could put a link there to download the font - but most users wont do that...

    this question is actually asked quite often.. sorry mav, no can do

    ~Quack

  • #3
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    403
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Actually, yes you can embed custom fonts that go beyond the user's own font collection, though you have to use different methods for different browsers (and remember, this can often dramatically increase your page size):

    Code:
    <style>
    @font-face {
         font-family: "font name";
         src: url("http://www.yoursite.com/font_file_name.ttf");
    }
    .classname {
      font-family: "font name"; 
    }
    </style>
    Example:
    Code:
    <font color="#000000" size="1" face="font name">text using special font</font>
    or:
    Code:
    <p class="classname">text using special font</p>
    or using OpenType (which not all fonts work with):
    Code:
    <link rel="fontdef" src="fontname.prf" />
    and then use
    Code:
    <font face="fontname"/>
    More Info
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Posts
    344
    Thanks
    0
    Thanked 0 Times in 0 Posts
    my niavety has proven me wrong yet again

    I am truly sorry...

    ~Quack

  • #5
    New Coder
    Join Date
    Jun 2002
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i can't seem to get any way to work...

  • #6
    Regular Coder
    Join Date
    May 2002
    Location
    Maine, USA
    Posts
    573
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Assuming you're trying to use the code Feyd provided; did you:

    [list=A][*] Remember to upload the font you wish to use to the proper directory?[*] Did you change the path in this line:
    src: url("http://www.yoursite.com/font_file_name.ttf"); to the correct path where the font you wish to use exsists?[/list=A]

    Have you considered WEFT (just a link, not a recommendation): http://www.microsoft.com/typography/...ft/default.htm
    boxer_1
    CodingForums Moderator
    "How did a fool and his money get together in the first place?"

  • #7
    New Coder
    Join Date
    Jun 2002
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    here's the test code i've used: (yes, i've uploading the .ttf)

    <html>
    <head>
    <style>
    @font-face {
    font-family: "espy.ttf";
    src: url("http://www.freedombigred.com/espy.ttf");
    }
    .espy {
    font-family: "espy.ttf";
    }
    </style>
    </head>
    <body>
    <font color="#000000" size="1" face="espy">ESPY</font>
    <font color="#000000" size="1">REGULAR</font>
    <p class="espy">ESPY</p>

    <span>REGULAR</span>
    <span class="espy">ESPY</span>
    </body>
    </html>

  • #8
    Regular Coder
    Join Date
    May 2002
    Location
    Maine, USA
    Posts
    573
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just a quick guess here (could be missing something), but try changing this:

    .espy {
    font-family: "espy.ttf";
    }

    To this:

    .espy {
    font-family: "espy";
    }

    And this:

    font-family: "espy.ttf";

    To this:

    font-family: "espy";

    Again, just a quick guess, but give it a try .
    boxer_1
    CodingForums Moderator
    "How did a fool and his money get together in the first place?"

  • #9
    New Coder
    Join Date
    Jun 2002
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    nope, still nada

  • #10
    Regular Coder
    Join Date
    May 2002
    Location
    Maine, USA
    Posts
    573
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, perhaps Feyd could sppot the problem. It looks like it should work to me, but I might be missing the obvious .

    In the meantime, [re-stating] have you looked into WEFT?:

    http://www.microsoft.com/typography/...ft/default.htm
    boxer_1
    CodingForums Moderator
    "How did a fool and his money get together in the first place?"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •