Forum Moderators: not2easy

Message Too Old, No Replies

Displaying, embedding non-installed fonts

Need help

         

anthonyon

2:23 am on Feb 4, 2005 (gmt 0)

10+ Year Member



Hi all,
I'm new to CSS (actually never used it)

Question: Can I use CSS to display non-installed fonts?

Meaning, if a visitor/user computer does not have a special or specific font on their computer how can I serve the font?

Would it be CSS? or Can I use MIME TYPES?

Anyone with any knowledge of this please help! Thanks.

djclark

2:44 am on Feb 4, 2005 (gmt 0)

10+ Year Member



check out this alternative.

[microsoft.com...]

anthonyon

2:56 am on Feb 4, 2005 (gmt 0)

10+ Year Member



Thanks djclark!

I'm downloading the tool now. I think it is what I'm looking for.

I don't think I've ever been on this side of Microsoft! :)

vkaryl

6:09 am on Feb 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah.... unless things have changed in just the last couple of months, WEFT only works on IE.

anthonyon

2:38 pm on Feb 4, 2005 (gmt 0)

10+ Year Member



Yes, I don't think WEFT is for me.
It does only work with IE.

And I'm looking to make global changes to about 200 pages of content, not one-by-one.

Thanks for introducing me to WEFT, I can possibly use this in the future.

But, for now, can anyone tell me what is best used to make global font, color, style, & theme changes? I'm really most concerned with making global font changes, please advise? Thanks in advance.

mincklerstraat

3:39 pm on Feb 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yeah, WEFT is pretty cool, but ie-only. If you use it, make sure stuff looks nice in standards-compliant browsers too.

To make changes across all your pages, you'll have to have a stlesheet linked in the head of each page.


<head>
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>

and then of course have that file style.css.

If this is too much of a pain for all your pages, you can do it via an auto-prepend file in php using ouput buffering. Make a custom function to replace <head> with <head> + your stylesheet link (assuming you've got one). You make the php file you auto_prepend called prepend.php:


<?php
function myfunction($html){
$html = str_replace('<head>', '<head>'."\n".'<link rel="stylesheet" type="text/css" href="/style.css" />, $html);
return $html;
}
ob_start('myfunction');
?>

then in your .htaccess file you add:

php_value auto_prepend_file /path/to/prepend.php 
AddType application/x-httpd-php .html

The second line is so your html files also are able to use php functionality

and in style.css:


body {
font-face: "Comic Sans MS";
color: #faa;
size: 13px;
}
h1 {
color: #aaf;
size: 15px;
}

Then, since your pages probably haven't been written with css in mind, you can still use css rules, but only as the HTML format as you wrote it allows. I.e., you can change *all* fonts to a given font face, color, size, etc., or all fonts inside a table, a link, or an <h1>. It sounds, though, that that's all you're looking to do.