The problem with specifying fonts in CSS (Cascading Style Sheets) or HTML (Hypertext Markup Language), is your choices will not be honoured unless the user already has that font installed on his operating system/browser. You can ask him to make sure it is installed. If the font is free, you can provide a link to it, and ask him to download and install it, but almost for sure, he will ignore you. What you want is some automatic way of including a crucial font with your web page.
The modern W3C (World Wide Web Consortium) CSS scheme calls the downloadable fonts web fonts. The key is @font-face. You use it like this in your style sheet:
The following font formats may be supported: .eot, .pfb, .pfa, .ttf i.e. embedded-opentype, truetype, opentype, truetype-gx, speedo, Speedo, intellifont, woff. You may need to serve the font in several formats, e.g. ones suitable for Windows, Linux, Mac and the browser decides which one it likes best. For example:
woff is the new W3C font standard. It is basically TrueType or PostScript compressed with a bit of metadata to support web fonts.
Google provides web fonts free. All you have to do is include stylesheets for the fonts you want for the page. You don’t even have to compose the style sheet. Google does it for you. You include a request for a font in your header like this (provided by the Google website.)
It is just an ordinary style sheet link. Google then transparently generates a corresponding style sheet for you like this and provides it directly to your clients:
The contents of the generated *.css seems to be stable, so I suspect it is safe to write your own style sheet with those contents, handling more than one font per style sheet, or incorporating that code in an existing style sheet.
available on the web at:
optional Replicator mirror
Please email your feedback for publication, letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : . If you want your message, your name or email kept confidential, not considered for public posting, please explicitly specify that. Unless you state otherwise, I will treat your message as a letter to the editor that I may or may not publish in the feedback section. After that, it will be too late to retract it. If you disagree with something I said, especially when sending an ad-hominem attack, a rant composed mainly of obscenities or a death threat, please quote the offending passage and cite the web page where you found it, tell me why you think it is wrong, and, if possible, provide some supporting evidence. I can’t very well fix erroneous or ambiguous text if I can’t find it.
Your face IP:[22.214.171.124]
|Feedback||You are visitor number 11.|