...

View Full Version : detect font used ...



BubikolRamios
05-27-2009, 03:03 AM
have this code, while style looks ok on windows , does not on fedora linux, presumably because there is font missing, and another one is used.

Any suggestion what to do ?
How to find which font is used ?
How to write conditonal css if another font is used ?

'Courier New' is the one working ok on Windows, is there same looking font on linux ?



*
{
font-family:'Courier New','Andale Mono',Lucidatypewriter,Fixed,Monospace,serif, sans-serif, monospace, cursive,fantasy;
font-size:0;
margin:0;
padding:0;
outline: none;
text-decoration:none;
}

....

_Aerospace_Eng_
05-27-2009, 06:41 AM
You won't be able to use a "conditional" css as its not supported. What you can do is what you are already doing. Provide alternate font families for the user. The browser will pick the first one that it can use and if it can use any of them it default to what has. You can't detect what fonts are installed on their system as least not with html/css. Maybe java but thats probably overkill. Notice I said Java NOT javascript. Supposedly Mono is the closest to Courier New on linux. Many users also install the MS fonts.

BubikolRamios
05-27-2009, 08:21 AM
Many users also install the MS fonts.


Was googlin, none of the fonts are 100% sure on all machines.

Mybe then the best option would be to put link to 'Courier new' font instalation into FAQ section -->
Anyone knows easy way to do that ?

http://www.google.si/search?hl=sl&rlz=1T4SUNA_enSI286SI298&q=%22courier+new%22+for+linux&meta=

second link, can't tell if red hat fits into fedora, allso can't find download link on that page ....

frankle
05-28-2009, 05:53 AM
have this code, while style looks ok on windows , does not on fedora linux, presumably because there is font missing, and another one is used.

Any suggestion what to do ?
How to find which font is used ?
How to write conditonal css if another font is used ?

'Courier New' is the one working ok on Windows, is there same looking font on linux ?



*
{
font-family:'Courier New','Andale Mono',Lucidatypewriter,Fixed,Monospace,serif, sans-serif, monospace, cursive,fantasy;
font-size:0;
margin:0;
padding:0;
outline: none;
text-decoration:none;
}

....


I am not sure but still what you can do is upload the font "courier-new.ttf" into the ftp and using css try calling it. Below is the css sample:


<style type="text/css">
@font-face {
font-family: "Courier New";
src: url(courier-new.ttf);
}
.ace {
font-family: "Courier New";
font-size: 230%;
}
</style>


This way missing font on any machine will be able to display font from the server itself.


Regards.

jlhaslip
05-28-2009, 05:58 AM
I run Linux and use this Font Declaration quite often.



Verdana,Tahoma,Arial,Trebuchet MS,Sans-Serif,Georgia,Courier,Times New Roman,Serif

_Aerospace_Eng_
05-28-2009, 10:17 AM
I am not sure but still what you can do is upload the font "courier-new.ttf" into the ftp and using css try calling it. Below is the css sample:


<style type="text/css">
@font-face {
font-family: "Courier New";
src: url(courier-new.ttf);
}
.ace {
font-family: "Courier New";
font-size: 230%;
}
</style>


This way missing font on any machine will be able to display font from the server itself.


Regards.

Only if the browser supports it. Firefox won't support it until FF3.5. IE does support it. Chrome won't support it till its 2.0 browser.

BubikolRamios
05-29-2009, 02:23 AM
so I stay with FAQ, providing link to font download. For fedora, hope for ewey other linux dist ...

http://www.my-guides.net/en/images/stories/fedora10/msttcore-fonts-2.0-2.noarch.rpm

courier-new seems almost as on windows, not exactly like it, but good enough.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum