Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Custom Fonts in Csss  (Read 4762 times)

4Sandrix

  • Hero Member
  • *****
  • Karma: -13
  • Posts: 597
    • http://fedrick.deviantart.com
Custom Fonts in Csss
« on: January 13, 2007, 03:05:32 pm »

Hi guys..

I've got a question about using custom fonts in css.

I think that it should look like this:

Code: [Select]
@font-face {
font-family: custom_font_name;
src: url(custom_font_name.eot); // open type font
}
but will it work in all browsers?(Well I mean Opera, FF, IE7 and maybe Safari?) I have tested it in my IE 7... works fine, but it doesn't work in Opera/Safari. Maybe there is some documented way to fix that? or maybe some hack? :/
Logged
I'm kind of like Han Solo always strokin' my own Wookiee
I'm the root of all that's evil yeah but you can call me Cookie

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Custom Fonts in Csss
« Reply #1 on: January 13, 2007, 03:37:33 pm »

I think @font-face is one of those IE proprietary things that will not work anywhere except in IE. There are other ways of using custom fonts for HTML text that are more cross-browser and -platform compliant, the best of which is to use the "font" or "font-family" declaration in CSS to specify particular fonts. For example, I sometimes use this family on my own sites:
Code: [Select]
font-family: "Myriad Pro",Geneva,Verdana,sans-serif;Users that have Myriad Pro will see the style as intended, those that don't will not. But then, Myriad Pro is a common face in designer and similar circles as it's distributed with Adobe apps (and available through a number of font shops).

For very custom fonts (as in not readily available anywhere) you can use sIFr, Mir or other replacement technologies, just be aware that these tricks increases the server load rather heavily.
Logged

4Sandrix

  • Hero Member
  • *****
  • Karma: -13
  • Posts: 597
    • http://fedrick.deviantart.com
Custom Fonts in Csss
« Reply #2 on: January 13, 2007, 03:48:16 pm »

Ok I get it.

Thanks for info Agent :)
Logged
I'm kind of like Han Solo always strokin' my own Wookiee
I'm the root of all that's evil yeah but you can call me Cookie

mattonik

  • Full Member
  • ***
  • Karma: 7
  • Posts: 123
    • http://www.mattonik.sk
Custom Fonts in Csss
« Reply #3 on: March 03, 2007, 09:23:55 pm »

hi,
i have found this way of making custom text/fonts (http://www.stewartspeak.com/projects/dtr/) but i have a problem running it with s news, can somebody help please?thanks
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Custom Fonts in Csss
« Reply #4 on: March 04, 2007, 01:44:33 am »

@mattonik: Could you explain with a little more detail what the problem is. Just saying that you have a problem isn't very, um, explanatory, you know?

Generally speaking, if you upload your custom font file (which needs to be a properly formatted  .ttf or .otf file by the way) to the same folder as snews.php, and place replacement.js in your scripts folder (or sNews folder if you don't have a separate scripts folder) and heading.php and the type-cache folder in the sNews folder and if your heading.php file is correctly set up and you've placed the required