1 reply [Last post]
max fancourt
max fancourt's picture
Offline
newbie
UK
Last seen: 12 years 17 weeks ago
UK
Joined: 2007-10-23
Posts: 3
Points: 0

With Safari now supporting @font-face with the use of the font linking method and IE being able to embed fonts (for some time now). I am in the middle of trying to figure out how to target two different font types depending on which browser is being used.
I do have both these systems working in different documents but I cant figure out how to combine it all into one html and one style sheet.
I thought I had seen a way to reference a font in a style sheet in a way that if a browser did not support a specific font type then it would look at the next src refence. So my question is does anyone know where this is or if anywone knows how to write this then any pointers would be great.

cheers max

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 3 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

The font-family property

The font-family property describes a range of fonts that should be used if available on the client; a list is presented of the fonts that are preferred, reading from left to right if the first is not available then the second is sought and on on until you reach the last font which is supposed to be a generic statement i.e in the case of sans-serif fonts one would state sans-serif which just means choose a font that is a sans-serif type. the trick is to identify in the major OS what fonts are generally available by default and then to add a series of fonts that will cater for all those OS.

As for embedded fonts this is an age old specification that never really took off, there were iirc two competing standards and never any clear ratification, so it has never been something that has come to be used, also there are problems inherent even if there were a standard, such as licences to be considered, generally font foundries do not give away fonts they have to be purchased or licensed for use which would present problems, and free fonts are not necessarily an option as few are of sufficient quality to be used, and badly written fonts can cause problems for OS.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me