# [Howto] Xorg & X Font Server & Fonts

## max4ever

 Howto - Xorg & X Font Server & Fonts 

Summary

Introduction

Installing necessary software

Editing config files

[Re]starting services

Some other notes

Credits and links...

Version 0.2.1

1. Introduction

This tutorial was made after i tryed another howto and i still couldn't get my fonts to work. After many nerves and time i figured out howto fix it, so here it is, me sharing my "knowledge".

2. Installing necessary softwareYou need to have freetype and some fonts installed. To see what fonts are avaible:

```
ls /usr/portage/media-fonts/
```

and then look at the font description:

```
emerge -s fontname
```

This is a recommended list to install: 

```
emerge freetype corefonts freefonts artwiz-fonts sharefonts terminus-font ttf-bitstream-vera unifont 
```

i strongly recomend ttf-bitstream-vera and corefonts (Note: that corefonts package installs by default without tahoma font, terminus font is good for your console  :Wink: , but i'm not sure it'll work well with any language).

3. Editing config files

To make things easier, do an:

```
ls /usr/share/fonts >> /etc/X11/fs/config
```

(Note: there are 2 >>) then change the /etc/X11/fs/config to make it look something like this: 

```
...

catalogue = /usr/share/fonts/75dpi,

        /usr/share/fonts/default/Type1,

        /usr/share/fonts/corefonts,

        /usr/share/fonts/freefont,

        ...

        /usr/share/fonts/ttf-bitstream-vera/

# in 12 points, decipoints

...

```

(Note:i don't know if the order of the fonts matters). That means you have to clear all the list after the "catalogue = " and then just move & edit(add the prefix "[tabkey]/usr/share/fonts/" to the names and then add "," and press enter) the "list of directories with fonts" from the bottom of the file.

Edit /etc/X11/xorg.conf by commenting(add an # in front of the line) all "FontPath ..." and put this

```
    FontPath    "unix/:-1"
```

(Note:make sure you typed it corectly  :Exclamation: )

4. [Re]starting services

Since you are gone be using xfs(X font server) we should make it start on boot:

```
rc-update add xfs default
```

then we [re]start xfs 

```
/etc/init.d/xfs restart
```

 and in the last step we save our work from the desktop and [re]star xorgt: 

```
/etc/init.d/xdm restart
```

5. Some other notes

MAKE SURE you're NOT using Luxi fonts since those look UGLY, use bitstream or some other...

In kde3 go to control panel->...->fonts then press the "default" button for the fonts, click to use antialias(that's actually telling it to use XFS) and then if you want unclick the "do not use antialias for fonts sizes beetween... ".

Click apply and be amazed  :Mr. Green:  , if all works fine now you can start playing with changing fonts and stuff...  :Cool: 

There are also some options that can be added in a file called ~/.fonts.conf though i have noticed no effect from the options i tryed and i don't know much about this, corection and suggestion are welcome   :Very Happy: 

6. Credits and links...

Author: max4ever, email: max87 [ at ] gmx DOT net

Thanks to https://forums.gentoo.org/viewtopic.php?t=187389 for a little inspiration about layout and as the first howto i tryed and didn't help  :Wink: 

Thanks to those who posted replys (good or bad)...  :Cool: 

Why not use Xorg's core for fonts ?  i know it says Xft and not Xfs  :Embarassed: , but still it says not to use the core  :Razz: 

If you translate this tutorial, or put it on a wikipage or ..., please let me know, this way i can add a link here.

That being said corrections,  suggestions, ... are welcome.

P.S. if some program doesn't shows fonts correctly, check that the font used by it supports <insert standart here> or is compatible with your language, check the software's documentation about fonts and stuff it uses to show them, search on google, search on this forum, shortly do your research/homework, and if it worked BEFORE this howto then you can come and complain here  :Confused: 

version 0.2.1 difference:

P.P.S. It occured to me that bitstream aren't unicode compliant ? anyone?

For example i was having problems with showing characters from languages other that english in some programs(example kedit/kate/...), the solution was to check the "utf-8" font encoding when saving a file and when showing the file to use the uft8 encoding instead of automatic detection, also i HAD to NOT use bitstream fonts, but some other font(for example arial), anyone can help me out with this ? so far i only came out with https://forums.gentoo.org/viewtopic.php?t=166984 which din't help so much...

So i think that this tutorial only solves the "show nice fonts" problem, meanwhile most people seem to have the problem with i got font X which shows nice, but which isn't unicode compliant, so if someone could suggest some unicode-compliant font with antialias support and stuff it'd be great, who knows maybe this tutorial will evolve into a xorg+nice unicode(utf8 encoding) fonts

----------

## occe

thanks, this made my fonts work again!

----------

## Forezt

Great guide! This really helps to fix fonts in The GIMP and on Firefox, especially with the Verdana font.

----------

## genstef

Thank you for this nice guide, I will try it soon

----------

## genstef

Now my german oe,ae,ue are replaced with strange greek symbols..

But I think the font looks prettier  :Smile: 

----------

## Drunken Master

Xft != Xfs

Xft = X FreeType interface library

Xfs = X Font Server

So what exactly is this howto supposed to accomplish?

----------

## max4ever

genstef: you probably have some font which isn't compliant with <insert standart here>and doesn't has those characters/has the table of characters wrong or something? if it worked before(with the fonts before? some other font?) that's my best guess of what is causing the problem... also *maybe* you need to put something into /etc/env.d/99locale

here is mine:

```
LANG=it_IT.utf8

LANGUAGE=it_IT.utf8
```

 and i can see italian ok and my keyboard has the italian layout(keymap) in the console(though i use it with english layout in kde), also note this will make gentoo try to compile the programs in the language you wrote in the file

Drunken Master:  :Embarassed: , big oops, you mean this howto is supose to be called "xorg & xfs" ? but libraries don't give you fonts, it's the server that does  :Rolling Eyes: ... and the point of this is to make xorg use the Xf* font server  :Laughing: 

----------

## genstef

did not work  :Sad: 

STrange thing is that it does not work in terminals but in gtk programs like firefox it works ..

----------

## max4ever

some more info ?  :Confused: 

1)what software isn't working properly?  name+version

2)what fonts have you tryed? 

3)anything else you can think of that's relevant... did it worked before this tutorial in that specific software ? what broke  :Sad:  after this tutorial?

----------

## genstef

Software that breaks is aterm.

More info:

```

Section "Files"

        RgbPath      "/usr/X11R6/lib/X11/rgb"

        ModulePath   "/usr/X11R6/lib/modules"

        FontPath        "unix/:-1"

#       FontPath        "/usr/share/fonts/corefonts"

#       FontPath     "/usr/share/fonts/misc"

#       FontPath     "/usr/share/fonts/TTF"

#       FontPath     "/usr/share/fonts/75dpi"

#       FontPath     "/usr/share/fonts/100dpi"

#       FontPath     "/usr/share/fonts/misc:unscaled"

#       FontPath     "/usr/share/fonts/misc"

#       FontPath     "/usr/share/fonts/75dpi:unscaled"

#       FontPath     "/usr/share/fonts/75dpi"

#       FontPath     "/usr/share/fonts/100dpi:unscaled"

#       FontPath     "/usr/share/fonts/100dpi"

#       FontPath     "/usr/share/fonts/Speedo"

#       FontPath     "/usr/share/fonts/PEX"

# Additional fonts: Locale, Gimp, TTF...

#       FontPath     "/usr/share/fonts/cyrillic"

#       FontPath     "/usr/share/fonts/latin2/75dpi"

#       FontPath     "/usr/share/fonts/latin2/100dpi"

# True type and type1 fonts are also handled via xftlib, see /etc/X11/XftConfig!

#       FontPath     "/usr/share/fonts/Type1"

#       FontPath     "/usr/share/fonts/ttf/western"

#       FontPath     "/usr/share/fonts/ttf/decoratives"

#       FontPath     "/usr/share/fonts/truetype"

#       FontPath     "/usr/share/fonts/truetype/openoffice"

#       FontPath     "/usr/share/fonts/truetype/ttf-bitstream-vera"

#       FontPath     "/usr/share/fonts/latex-ttf-fonts"

#       FontPath     "/usr/share/fonts/defoma/CID"

#       FontPath     "/usr/share/fonts/defoma/TrueType"

EndSection

```

The /etc/X11/fs/config:

```
#

# X Font Server configuration file

#

# allow a max of 4 clients to connect to this font server

#client-limit = 4

# no tcp, use sockets!

no-listen  =  tcp

# when a font server reaches its limit, start up a new one

clone-self = on

# alternate font servers for clients to use

#alternate-servers = foo:7101,bar:7102

# where to look for fonts

# Some of these are commented out, i.e. the TrueType and Type1

# directories in /usr/share, because they aren't forced to be

# installed alongside X.

#       

catalogue = /usr/share/fonts/100dpi,

        /usr/share/fonts/75dpi,

        /usr/share/fonts/artwiz,

        /usr/share/fonts/artwiz:unscaled,

        /usr/share/fonts/CID,

        /usr/share/fonts/corefonts,

        /usr/share/fonts/cyrillic,

        /usr/share/fonts/encodings,

        /usr/share/fonts/fonts.cache-1,

        /usr/share/fonts/freefont,

        /usr/share/fonts/ghostscript,

        /usr/share/fonts/local,

        /usr/share/fonts/misc,

        /usr/share/fonts/sharefonts,

        /usr/share/fonts/Speedo,

        /usr/share/fonts/terminus,

        /usr/share/fonts/TTF,

        /usr/share/fonts/ttf-bitstream-vera,

        /usr/share/fonts/Type1,

        /usr/share/fonts/ukr,

        /usr/share/fonts/unifont,

        /usr/share/fonts/util

#       /usr/share/fonts/Type1,

#       /usr/share/fonts/Speedo,

#       /usr/share/fonts/CID,

# in 12 points, decipoints

default-point-size = 120

# 100 x 100 and 75 x 75

default-resolutions = 75,75,100,100

# how to log errors

use-syslog = on

# font cache control, specified in KB

cache-hi-mark = 2048

cache-low-mark = 1433

cache-balance = 70
```

qpkg -I | grep font

```
app-emulation/transgaming-fontinstaller *

media-fonts/artwiz-fonts *

media-fonts/corefonts *

media-fonts/freefonts *

media-fonts/sharefonts *

media-fonts/terminus-font *

media-fonts/ttf-bitstream-vera *

media-fonts/unifont *

media-libs/fontconfig *

```

----------

## genstef

Xpdf does not work,t oo.

But it did not work before, so thats not harm done by xft

Where can I get these fonts:

Error: Couldn't create a font for 'ZapfDingbats'

Error: Couldn't create a font for 'MyriadMM_700_600_'

Error: Couldn't create a font for 'Helvetica'

----------

## bludger

What exactly does xfs do?  Is it really needed?  How does it fit together with things like fontconfig? I ran for a long time without xfs and seem to see everywhere that I should be running it.

Sorry, after writing this I re-read your post and saw that you have a link to xfs info.  I will check this out.

----------

## ticapix

Hi,

I did exactly what was said in the howto but I have still this error using the freenx server

```

bin\:0>./nxagent :1

NXAGENT - Version 1.4.0

Copyright (C) 2001, 2004 NoMachine.

See http://www.nomachine.com/ for more information.

Info: Agent running with pid '18171'.

Info: Using fast copy area mode in agent.

Info: Using fast get image mode in agent.

Info: Using render cleanup parameters 8/20/23/24/25/26.

Info: Using render extension support in X server.

Info: Using image cleanup parameters 0/0/0/0.

Info: Not using local device configuration changes.

Info: Using alpha channel in render extension.

Fatal server error:

could not open default font 'fixed'

bin\:1>

```

Do you have any idea  how to solve this ?

I'm using  (The X.Org Foundation 6.7.0, revision r2-1.3)

In /etc/X11/xorg.conf

I comment all FontPath I add just FontPath    "unix/:-1"

in /etc/X11/fs/config I have

```

catalogue = /usr/share/fonts/75dpi,

   /usr/share/fonts/artwiz:unscaled,

   /usr/share/fonts/100dpi,

   /usr/share/fonts/misc,

   /usr/share/fonts/Type1,

   /usr/share/fonts/Speedo,

   /usr/share/fonts/CID,

   /usr/share/fonts/util,

   /usr/share/fonts/local,

   /usr/share/fonts/Speedo,

   /usr/share/fonts/truetype,

   /usr/share/fonts/TTF,

   /usr/share/fonts/cyrillic,

   /usr/share/fonts/freefont,

   /usr/share/fonts/sharefont,

   /usr/share/fonts/default/Type1,

   /usr/share/fonts/ttf/decoratives,

   /usr/share/fonts/ttf/western,

   /usr/share/fonts/afms,

   /usr/share/fonts/artwiz,

   /usr/share/fonts/corefonts,

   /usr/share/fonts/encodings,

   /usr/share/fonts/latex-xft-fonts,

   /usr/share/fonts/local,

   /usr/share/fonts/run-gnome-font-install,

   /usr/share/fonts/terminus,

   /usr/share/fonts/ttf-bitstream-vera,

   /usr/share/fonts/ukr,

   /usr/share/fonts/unifont,

   /usr/share/fonts/urw-fonts

```

Thank you

----------

## LookOfEvil

I'm not sure about the configuration of the freenx server, but that error message indicates that the server could not find the fixed font, which Xorg and XFree86 both store in the "misc" subdirectory of their fonts directory.  Make sure that the freenx server is connecting to xfs, and if not, then add the directory containing the fixed font to its font search path.

----------

## LookOfEvil

 *bludger wrote:*   

> What exactly does xfs do?  Is it really needed?  How does it fit together with things like fontconfig? I ran for a long time without xfs and seem to see everywhere that I should be running it.

 

In my estimation, xfs only serves the fonts.  If you want to mess with the configuration of the fonts accessed through xft (which is separate from xfs), then you're going to configure freetype, NOT xfs.  xfs, in fact, serves fonts through the core X11 mechanism.  You can keep the directories in your /etc/X11/xorg.conf file and everything works fine.  (It does here, and I've been doing this since freetype and xft were released.)

----------

## bludger

 *LookOfEvil wrote:*   

> 
> 
> In my estimation, xfs only serves the fonts.  If you want to mess with the configuration of the fonts accessed through xft (which is separate from xfs), then you're going to configure freetype, NOT xfs.  xfs, in fact, serves fonts through the core X11 mechanism.  You can keep the directories in your /etc/X11/xorg.conf file and everything works fine.  (It does here, and I've been doing this since freetype and xft were released.)

 

So what advantages does xfs bring over specifying the directories in /etc/X11/xorg.conf?

----------

## arkaine

I just tried this...and the FontPath = "unix:-1" part kind of told X to go fuck itself...I ended up with a never ending black screen. :-/ Have you ever heard of that happening? I did everything as you said, so I'm not sure. By the way, I had to boot off a livecd just to edit xorg.conf to get it working again heh.

----------

## ticapix

 *arkaine wrote:*   

> I just tried this...and the FontPath = "unix:-1" part kind of told X to go fuck itself...

 

It is FontPath "unix/:-1" I think.

----------

## max4ever

 *arkaine wrote:*   

> I just tried this...and the FontPath = "unix:-1" part kind of told X to go fuck itself...I ended up with a never ending black screen. :-/ Have you ever heard of that happening? I did everything as you said, so I'm not sure. By the way, I had to boot off a livecd just to edit xorg.conf to get it working again heh.

 

did i NOT post a   :Exclamation:   below that as in write it exactly as i wrote it ??  :Evil or Very Mad: , argh,  well read the previous post before mine or REread carefully the howto  :Wink:  and pay attention when u see an exclamation emoticon

good for you that you booted of a livecd, couldn't you just use ctrl+alt+f1 or ctrl+alt+f2 or ... and then restart xorg ?

----------

## arkaine

I'm pretty sure I typed in right in the xorg.conf, but when I came back to talk about how it went I didn't really look to see exactly what it was, I just figured you'd know what I was talking about. And with the ctrl + alt +fkey part...I never knew that I could do that until a little later that night hehe  :Embarassed:  but just to make sure I'll try again...I could of sworn I copy + pasted when I put it in the config

EDIT: Yah, I had it typed in right

```
Section "Files"

    RgbPath    "/usr/X11R6/lib/X11/rgb"

#    FontPath    "unix/:-1"

    FontPath   "/usr/share/fonts/100dpi/"

    FontPath   "/usr/share/fonts/75dpi/"

    FontPath   "/usr/share/fonts/TTF/"

    FontPath   "/usr/share/fonts/Type1/"

    FontPath   "/usr/share/fonts/artwiz/"

    FontPath   "/usr/share/fonts/corefonts/"

    FontPath   "/usr/share/fonts/cyrillic/"

    FontPath   "/usr/share/fonts/default/"

    FontPath   "/usr/share/fonts/encodings/"

    FontPath   "/usr/share/fonts/freefont/"

    FontPath   "/usr/share/fonts/sharefonts/"

    FontPath   "/usr/share/fonts/terminus/"

    FontPath   "/usr/share/fonts/ttf-bitstream-vera/"

    FontPath   "/usr/share/fonts/ukr/"

    FontPath   "/usr/share/fonts/unifont/"

    FontPath   "/usr/share/fonts/uti/"

    ModulePath "/usr/X11R6/lib/modules"

EndSection
```

Last edited by arkaine on Thu Oct 07, 2004 6:55 pm; edited 2 times in total

----------

## Deranger

Ehm, how this is better than "X.Org & Font" HOWTO?

----------

## LookOfEvil

 *bludger wrote:*   

> So what advantages does xfs bring over specifying the directories in /etc/X11/xorg.conf?

 

If you have multiple machines (X terminals), you can share one copy of the files on the server with them so that they don't take up disk space for each X server.  Saves disk space, and was more important back when disks were small and X terminals were more often used.  On a desktop, you shouldn't really be running xfs.  It takes up more resources and because (unless properly configured) it listens on the network, it could be a destination of attack.  Like stated above, xfs only serves fonts to the core server, and not to xft.

----------

## bludger

If this is the case, then it shouldn't be the default setup as described in the documentation, but rather a special case.

----------

## LookOfEvil

I agree - it's not something that people with a single desktop should be setting up.  If you have a network with a lot of desktops with smaller disk space (or no disk space, in the case of diskless machines), then xfs is right up your alley.  Of course, if you have a diskless machine, you could always serve them over the network using NFS, so xfs looks like a solution in search of a problem, unless the terminal needing the fonts doesn't speak NFS.

----------

