On Sat, Nov 29, 2003 at 11:38:53PM +0200, Tzafrir Cohen wrote:
> On Sat, Nov 29, 2003 at 11:17:42PM +0200, Aaron wrote:
> > Hi all,
> > I once had Mandrake and its font utility let me install all my windows
> > fonts on linux including the hebrew ones.
> > 
> > Anyone know how to do the same thing on Redhat???
> > thanks
> > Aaron
> 
> Most of the programs use Xfs/fontconfig. Furthermore, IIRC redhat is
> configured so that fonts under /usr/share/fonts are automatically added. 
> 
> Actually: not automatically: for reasons of efficiency there is a cache
> file there. Thus you need to run 'fc-cache' after you
> added/changed/removed fonts.
> 
> So basically: create a directory under /usr/share/fonts, put the fotns
> there, and run fc-cache . 
> 
> 
> BTW: I try to read the fc-cache man page on a fedora system (thanks,
> Lior) and I get the following error message:
> 
>   iconv: illegal input sequence at position 111
> 
> And I get nothing. 
> 
> This is not a problem of less: I tried using '-P more'. 
> 
> The current locale settings are 'POSIX' for everything.
> 

I'm afraid I can only answear you concerning debian, but this could
probably be translated into redhat (to open the debian package archives
if you need the actualy executables by any chance use ar and then open
data.tar.gz).
This is how to add any truetype font.

You can create a fonts.scale and a fonts.dir using the ttmkfdir program.
It creates a fonts.scale but you can just copy it to fonts.dir.
Then point /etc/XF84Config to that directory. If you are not using an
external font server, you need to add a Font entry and make sure you
load eithet the xtt or freetype modules.
I attach here a description posted on the debian list on how to add
fonts. The directories are debian specific, but I am guessing that the
rest is good on any system. Its by Rob Weir <[EMAIL PROTECTED]>

A very short guide to setting up fonts for X in Debian.  It assumes
XFree86 4.1 or more recent, and explains how to setup fontconfig and
Xft1.

1) Install x-ttcidfont-conf and defoma
2) Add a line like this to /etc/X11/XF86Config-4, in the "Files" section

        FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"

   Adding it at the top of the list is probably a good idea.  This line
   will setup XFree86 to use any TrueType fonts you install from Debian
   packages.  If you install a new set of TrueType fonts while in X, run
   "xset fp rehash" to get XFree86 to look at the contents of that
   directory again and to pickup new ones.

3) Move this line to the bottom of the list of FontPaths

        FontPath        "/usr/lib/X11/fonts/Type1"

   XFree86 does a rather poor job of rendering Type1 fonts these days,
   and if this is above your better looking fonts, you can get a some
   pretty ugly results.

4) Add :unscaled to the end of the 100dpi and 75dpi font lines, so they
   look like this

        FontPath        "/usr/lib/X11/fonts/100dpi:unscaled"
        FontPath        "/usr/lib/X11/fonts/75dpi:unscaled"

   Without the ":unscaled" bit, XFree86 will try to scale these bitmap
   fonts up and down, which usually looks rather horrible.

And, after all that, my Files section looks like this:

Section "Files"
        FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
        FontPath        "/usr/share/fonts/truetype"
        FontPath        "/usr/lib/X11/fonts/CID"
        FontPath        "/usr/lib/X11/fonts/Speedo"
        FontPath        "/usr/lib/X11/fonts/misc"
        FontPath        "/usr/lib/X11/fonts/cyrillic"
        FontPath        "/usr/lib/X11/fonts/100dpi:unscaled"
        FontPath        "/usr/lib/X11/fonts/75dpi:unscaled"
EndSection

Now that it's all setup, install some font packages.  ttf-bitstream-vera
is a rather nice set of fonts, and is Free enough to go into Debian
itself.  It's not in woody yet, but you can download the .deb from
http://http.us.debian.org/debian/pool/main/t/ttf-bitstream-vera/ttf-bitstream-vera_1.10-3_all.deb
(or your local mirror) and install it with "dpkg -i
ttf-bitstream-vera_1.10-3_all.deb" (as root).  sid and sarge users are
just an "apt-get install ttf-bitstream-vera" away from it.  Another
option is ttf-freefont, which is in all three current versions of
Debian.

Another alternative is to install Microsoft's Corefonts.  They removed
the the fonts from their website, but the msttcorefonts package will
download them for you from a mirror.  Note that these are NOT Free (in
the Debian sense), but you're permitted to at least use and download
them.

Both of these packages (and the other ttf-* packages in Debian) should
now Just Work, and appear available to all X programs that use the
regular "core" font system.  This includes things like xterm, emacs and
most other non-KDE and non-GNOME applications.

Now, run "xfontsel" and select either "Microsoft" or "Bitstream" in the
fndry menu (click on the word "fndry").  Now look at the ungrayed out
entries in the "fmly" menu.  You should have a bunch of either Microsoft
fonts (Verdana, Trebuchet, etc) or some Bitstream ones (or both).

For KDE2.2 and GNOME1.4 (with libgdkxft0, which is a hack to get GTK
1.2 to do anti-aliased font rendering), you need to setup Xft1, as
well.  Xft1 is highly deprecated, and is basically only used by
GNOME1.4 and KDE2.2.  For GNOME2 and KDE3, you need to setup
"fontconfig" which Xft2 uses to find fonts.  I'll get to that in a
minute.

Edit /etc/X11/XftConfig and add a line like

        dir "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"

before the other dir lines.  I don't have any xft1 stuff on my machine
anymore, so I'm not sure if you need to restart X or not before this
change will take effect.  I seem to remember that "xftcache" would
update the Xft1 cache, but it'd be good if someone could confirm that
for me.

Now, for fontconfig.  You shouldn't need to install anything extra for
this, since all the packages using fontconfig will Depend on it
(indirectly) already.  First, look in /etc/fonts/fonts.conf.  There
should be a line like the one below.  If not, open up
/etc/fonts/local.conf and add this

        <dir>/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType</dir>

just after the <fontconfig> line.

Fontconfig should pick these up immediately, and "fc-list" should list
your new fonts.  Another neat feature of fontconfig is that you can just
drop fonts in ~/.fonts/ and all your fontconfigified programs will have
access to them immediately.

> 
> Workaround: use a UTF-8 locale for LC_CTYPE. e.g:
> 
>   LANG=he_IL.UTF-8 man lc-cache
>   LC_CTYPE=en_US.UTF-8 man lc-cache
> 
> 
> A number of other man pages I tried had no such problem.
> -- 
> Tzafrir Cohen                       +---------------------------+
> http://www.technion.ac.il/~tzafrir/ |vim is a mutt's best friend|
> mailto:[EMAIL PROTECTED]       +---------------------------+
> 
> =================================================================
> To unsubscribe, send mail to [EMAIL PROTECTED] with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail [EMAIL PROTECTED]
> 

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to