Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,982
    Thanks
    120
    Thanked 76 Times in 76 Posts

    detect font used ...

    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 ?

    Code:
    * 
          {
          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;
          }
    
    ....
    Last edited by BubikolRamios; 05-27-2009 at 02:13 AM.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,982
    Thanks
    120
    Thanked 76 Times in 76 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    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&rl...or+linux&meta=

    second link, can't tell if red hat fits into fedora, allso can't find download link on that page ....
    Last edited by BubikolRamios; 05-27-2009 at 07:26 AM.

  • #4
    New Coder
    Join Date
    May 2009
    Posts
    74
    Thanks
    0
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by BubikolRamios View Post
    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 ?

    Code:
    * 
          {
          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.
    Last edited by frankle; 05-28-2009 at 04:57 AM.

  • #5
    Regular Coder
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    924
    Thanks
    10
    Thanked 56 Times in 55 Posts
    I run Linux and use this Font Declaration quite often.

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

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by frankle View Post
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,982
    Thanks
    120
    Thanked 76 Times in 76 Posts
    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/s...0-2.noarch.rpm

    courier-new seems almost as on windows, not exactly like it, but good enough.
    Last edited by BubikolRamios; 05-29-2009 at 01:35 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •