Redhat Linux Font problem

vinaykn
vinaykn used Ask the Experts™
on
I am using Redhat Linux 8.  Gnome desktop version 2.  I am not able access my favarite site www.eenadu.net(a regionaal language-telugu-newspaper site) from netscape 7 or netscape 4.7. When i was using windows i able to see in both netscape versions. I am not much familiar with font settings here. I tried many by following others advise. But i couldnt get correctly. The site is using ttf font "eenadu.ttf". It can be downloaded from the site itself.

Can anybody download it, and can tell me what necessary things i need to do to access this?

But please let me tell after you successfully read. I am really frustated by doing many things to get my site. This what i am missing really on linux desktop.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2005
Commented:
That should be easy enough to do. Download the eenadu.ttf file. Then do:

# mkdir /usr/X11R6/lib/X11/fonts/TrueType
# cp eenadu.ttf /usr/X11R6/lib/X11/fonts/TrueType
# ttmkfdir -o fonts.scale
# mkfontdir
# chkfontpath -a `pwd`
# /etc/init.d/xfs restart

If you have a browser up you'll have to re-start it before it can use the font.

Now if you'd like to fix the other "ugly TrueType fonts" that some web site use the following may help

Installing TrueType Fonts


Lousy looking web pages can be solved easily on a RedHat system by getting
the 'Microsoft Core' TrueType fonts. Installing those will make pages that
use those fonts readable, but I find that fonts render a bit smaller on X
(by maybe, one or two points) than they do on Windows. To fix that I've
written a small perl script (ttmkalias) that uses font aliases to adjust the
displayed size. The steps needed to install the TrueType fonts are:

1. Get the Core fonts from a windows box. The Core fonts used to be available
from Microsoft's web site, but not any more. They claim that the download has
been withdrawn since all current windows system include them. Yeah right, like
I believe that since those fonts have been on windows OS's for a long time.

2. You can install the files anywhere, but it makes sense to me to put them
with the rest of the X fonts.  So I create the directory
/usr/X11R6/lib/X11/fonts/TrueType and put them there. Then you should have:

chaos# ls /usr/X11R6/lib/X11/fonts/TrueType
andalemo.ttf  courbd.ttf     georgiai.ttf  trebucbd.ttf
arialbd.ttf   courbi.ttf     georgia.ttf   trebucbi.ttf
arialbi.ttf   couri.ttf      georgiaz.ttf  trebucit.ttf
ariali.ttf    cour.ttf       impact.ttf    trebuc.ttf
arial.ttf     encodings.dir  timesbd.ttf   verdanab.ttf
ariblk.ttf    font.aliases   timesbi.ttf   verdanai.ttf
comicbd.ttf   fontx.aliases  timesi.ttf    verdana.ttf
comic.ttf     georgiab.ttf   times.ttf     verdanaz.ttf

3. Make the fonts available to X with:

chaos# cd /usr/X11R6/lib/X11/fonts/TrueType
chaos# ttmkfdir -o fonts.scale
chaos# mkfontdir
chaos# chkfontpath -a `pwd`
chaos# /etc/init.d/xfs restart

If you want to try using my perl font scaling routine, copy the
ttmkalias file to /usr/X11R6/lib/X11/fonts/TrueType and make it
executable and run the script while you are running X:

chaos# cp ttmkalias /usr/X11R6/lib/X11/fonts/TrueType
chaos# cd /usr/X11R6/lib/X11/fonts/TrueType
chaos# chmod +x ttmkalias
chaos# ./ttmkalias -1
chaos# /etc/init.d/xfs restart

That will make font aliases that display all of the fonts 1 point
larger. See the comments at the top of the script for other options.

And the ttmkalias code referenced above follows

#!/usr/bin/perl
#
# NAME
#       ttmkfalias create TrueType font alises
#
# SYNOPSIS
#       ttmkfalias [-1|-2]
#
# DESCRIPTION
#       Creates a fonts.alias file in the current directory (which must
#       contain the TrueType fonts). This utility knows about the following
#       fonts which are in the Microsoft 'Core' font pack from
#       http://www.microsoft.com/typography/fontpack/default.htm
#         Andale Mono           Georgia
#         Arial                 Impact
#         Arial Black           Times New Roman
#         Comic Sans            Trebuchet MS
#         Courier New           Verdana
#       The font aliases created will define the same font sizes as are
#       normally defined for applications running on a MicroSoft os. Those
#       sizes are:
#         8-12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, & 72pt
#
#       When inovked with the optional argument of '-1' or '-2' the aliases
#       will be adjusted to display the font 1 or 2 point sizes larger.
#
#       Only the aliases for the same encodings as the X server standard
#       fonts provide are generated. If some strange encoding (not an
#       is8859) is in use, the default will be to build iso8859-1 and
#       iso8859-2 aliases.
#
#       This code is based on an idea I ran across somewhere on the web.
#       I've give proper credit, but I didn't book mark the site and
#       have no idea whose idea it was.
#
#       Author: Jim Levie (jim@entrophy-free.net)

#
# Enumerate the font sizes, fonts, and encodings I'm prepared to handle.
#
@pts = (8,9,10,11,12,14,16,18,20,22,24,28,36,48,72);
@fonts = ('Andale Mono', 'Arial', 'Arial Black', 'Comic Sans',
          'Courier New', 'Georgia', 'Impact', 'Times New Roman',
          'Trebuchet MS', 'Verdana');
@iso = ('iso8859-1', 'iso8859-2', 'iso8859-3', 'iso8859-4',
        'iso8859-5', 'iso8859-6', 'iso8859-7', 'iso8859-8',
        'iso8859-9', 'iso8859-10', 'iso8859-15');
#
# Check for an option on the command line and adjust sizes accordingly.
#
$inc = 0;
if($#ARGV==0 && ($ARGV[0]eq'-1' || $ARGV[0]eq'-2'))
{
  # Got an option.
  #
  $inc = $ARGV[0];
  $inc =~ s/-//;
}
elsif($#ARGV==0)
{
  print "ttmkfalias-F-Unknown option\n";
  print "Usage: ttmkfalias [-1|-2]\n";
  print "       -1  alias to fonts 1pt larger\n";
  print "       -2  alias to fonts 2pt larger\n";
  exit(1);
}
for($i=0; $i<=$#pts; $i++)
{
  $spts[$i] = $pts[$i]+$inc;
}
#
# Now find out what encoding this X server is using by checking the
# available encodings for Courier.
#
open(DIR, "xlsfonts -fn \"-urw-courier-medium-r-normal*-p*\"|") ||
  die "ttmkfalias-F-Error enumerating X11 courer font encodings\n";
$i = 0;
while(<DIR>)
{
  chop;
  $_ =~ s/.*(iso8859-\d+)/\1/;
  #
  # Check the list of encodings that the TrueType fonts have.
  # Only put it in my list if it also exists as a TrueType.
  #
  for($e=0;  $e<=$#iso; $e++)
  {
    if($iso[$e]eq$_)
    {
      $enc[$i] = $_;
      $i += 1;
      last;
    }
  }
}
if($i==0)
{
  # Whoops, default to is08859-1 & iso8859-2
  #
  print "ttmkfalias-W-The X font encoding doesn't match any of the\n";
  print "             TrueType font encodings. Defaulting to iso8858-1\n";
  print "             and iso8859-2\n";
  $enc[0] = 'iso8859-1';
  $enc[1] = 'iso8859-2';
}
#
# Open the requisite files. Toss our cookies if either fails.
#
open(DIR, "<fonts.dir") || die "ttmkfalias-F-File fonts.dir doesn't exist\n";
open(OUT, ">fonts.alias") || die "ttmkfalias-F-Can't create fonts.aliases\n";

#
# Okay, read each line from the fonts.dir. If the font mentioned is one
# I'm prepared to handle I'll build the alias definition.
# Oh Yeah, I need to skip the first line of the file.
#
$_ = <DIR>;
$line = 1;
$cnt = 0;
while(<DIR>)
{
  chop;
  $line++;
  #
  # Start by separating the font name from the XLFD font definition. Then
  # strip the leading '-'.
  #
  ($name, $spec) = split(' ', $_, 2);
  $spec =~ s/^-//;
  #
  # Now split the font definition up into separate fields. The font name
  # (second field) must be in my list and there must be 14 fields.
  #
  @fields = split('-', $spec, 14);
  if($#fields==13)
  {
    for($f=0; $f<=$#fonts; $f++)
    {
      if($fields[1]eq$fonts[$f])
      {
        # Font name is okay, check encoding.
        #
        for($e=0; $e<=$#enc; $e++)
        {
          if($fields[12].'-'.$fields[13]eq$enc[$e])
          {
            # This is one I know, build the first and last parts of the
            # XLFD. They can contain spaces, so quote 'em.
            #
            $pre = sprintf("\"-%s-%s-%s-%s-%s-%s", $fields[0], $fields[1],
                           $fields[2], $fields[3], $fields[4], $fields[5]);
            $post = sprintf("%s-%s-%s-%s\"", $fields[10], $fields[11],
                            $fields[12], $fields[13]);
            for($p=0; $p<=$#pts; $p++)
            {
              #
              # Generate the name & alias for each size and write
              # that out to the fonts.alias file.
              #
              $name = sprintf("%s-%d-%d-75-75-%s", $pre, $pts[$p],
                              $pts[$p]*10, $post);
              $alias = sprintf("%s-%d-%d-0-0-%s", $pre, $spts[$p],
                               $spts[$p]*10, $post);
              print OUT "$name $alias\n";
              $cnt++;
            }
            last;
          }
        }
        last;
      }
    }
  }
  else
  {
    print "ttmkfalias-W-Invalid font entry at line $line in fonts.dir\n";
  }
}

#
# Done, crow about it and close the files.
#
print "ttmkfalias-I-Created $cnt font aliases\n";
close(OUT);
close(DIR);
vinaykn:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial