#1
  1. Application is what Divides Us
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Dec 2002
    Location
    Titusville, FL
    Posts
    2,179
    Rep Power
    59

    css font-face...


    if i set up a style like the following...
    PHP Code:
    <style...>
    .
    subhead font-facethefontname; }
    </
    style>

    <
    font face="thefontname" size="+1">example text</font
    and thefontname was in a directory on my website, would would I access that font to place in the style tags to apply to my site if the visitor does not have the font?
    Download [ Fx | Op ] Validate [ Markup | Css ]
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2002
    Location
    Seattle WA
    Posts
    863
    Rep Power
    14
    You got a few things wrong there...

    When working with styles, you can set the font-family property. This is a comma seperated list of fonts or families you want. The first valid one is kept. Generally, you go from most specific, to most generic. So, you could have something like this:
    Code:
    <style type="text/css">
    .subhead {
      font-family: SomeObscureFont, Helvetica, Arial, sans-serif;
    }
    </style>
    What I've done is created a class (defined by the period) called 'subhead'. Any element with that class will use the specified font. If the font, 'SomeObscureFont' can not be found, it will look for 'Helvetica'. If not, it looks for 'Arial'. Finally is the 'sans-serif' which is not a font name, but a font family (of which Helvetica and Arial are members of). If none of the specific fonts can be found, the element will be rendered in whatever sans-serif type font the system has set as default.

    To use the style, you need to assign the class to an object. We can even drop the <font> tags entirely, since they're depreciated. You can assign a class to any element, from a <p>, to a <div>, to a <td>, or anything else.

    Applying the font to a paragraph is as simple as:
    Code:
    <p class="subhead">example text</p>
    Last edited by MJEggertson; December 4th, 2003 at 10:18 PM.
  4. #3
  5. Application is what Divides Us
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Dec 2002
    Location
    Titusville, FL
    Posts
    2,179
    Rep Power
    59

    so...


    even with CSS I would be unable to use a font on my site effectively unless the visitor has that font as well?

    even so.. thanks
    Download [ Fx | Op ] Validate [ Markup | Css ]
  6. #4
  7. Über nübe
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Babylon 4
    Posts
    240
    Rep Power
    12
    Is this what you're looking for?

    Code:
    <style>
    @font-face { font-family: "Nueva Roman"; src: url(NUEVAR1.eot)}
    </style>
    Hello, old friend...
  8. #5
  9. No Profile Picture
    El Pollo Loco
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Middle Earth
    Posts
    29
    Rep Power
    0
    The font import function is almost entirely unsupported right now.
  10. #6
  11. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
    yup,
    and it has been removed in css2.1
    http://www.w3.org/TR/CSS21/changes.html#q23
  12. #7
  13. Application is what Divides Us
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Dec 2002
    Location
    Titusville, FL
    Posts
    2,179
    Rep Power
    59

    okay...


    so pretty much using the default settings would work the best... okay.. thanks again everyone
    Download [ Fx | Op ] Validate [ Markup | Css ]
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    35
    Rep Power
    12

    font


    hi jskid,
    i can see that know one got what you mean't, well here is the piece of advice you're looking for.

    No you can't use a font that the visitor doesn't have installed on his pc.
    So even if you have the font on your web directory, it won't help, the only difference it makes is on your pc. You would see the fonts as it is because you have the font installed.

    there are two ways round this problem.

    1. If the font you want to use is just for headers on your page, then try to make a gif image containing the text and use it on your site.
    2. If you need to use this font for the entire content, then the only thing you have to do, is make a script that tells the visitor that you are using a special type of font and for them to view the page as it is supposed to be they should have the font installed. If they want to download it, then they'll have to click ok and the font would be downloaded on to there pc, but they should in turn install the font.

    http://www.templatearchives.com
  16. #9
  17. Application is what Divides Us
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Dec 2002
    Location
    Titusville, FL
    Posts
    2,179
    Rep Power
    59

    thanks...


    i too was unsure if anyone really understood my question at first, but eventually as the forum always does, it did..

    thank you for your input though... i already have imaegs as header/footer for my page, although that leads to too many images on a page make slow loading for visitors, and less page views for the impatient ones (which I'm sure is everyone)..

    i think that I will only use images for logos etc... special paragraph heads.. and the such, for my sites will have pics on them, so the extra pics will only slow the process more, unless somebody here can point me towards "preloaded images" if possible...
    Download [ Fx | Op ] Validate [ Markup | Css ]

IMN logo majestic logo threadwatch logo seochat tools logo