LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-29-2003, 05:00 AM   #1
Musikolo
Member
 
Registered: Jul 2003
Distribution: Yoper 2.91 beta (kernel 2.6.15)
Posts: 114

Rep: Reputation: 15
Lightbulb Problem with fonts in Xwindows


Hi mates! Some days ago I had a font problem with 'unix/7100' font and I couldn't start Xwindows. The thing is that I was snooping xwindows' files and I got to solve it. However, everytime I execute OpenOffice I get a window with HUGE font size and it happens the same when I excute the command line "make xconfig" where I get the window to configure the kernel with huge font size. The rest of programs are working perfectly.

Do you have any suggestion to solve that?

Many thanks to all in advance!!
 
Old 07-29-2003, 09:08 PM   #2
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
Re: Problem with fonts in Xwindows

Quote:
Originally posted by Musikolo
Some days ago I had a font problem with 'unix/7100' font
unix/7100 is not a font!

If you have installed xfs and it is properly configure with its
config file in /etc/X11/fs/config, and xfs is started up in the appropriate
run level in which you want to run X, then you need a line in your
/etc/X11/XF86Config file in the files section -

Section "Files"
Fontpath "unix/:7100"

AND note the colon!

Quote:
Do you have any suggestion to solve that?
How do we know which X configuration files you have been changing?

Did you alter /etc/X11/XF86Config? What is the Fontpath being used?

Did you alter /etc/X11/fs/config?

Did you alter any of the fonts.dir, fonts.alias, fonts.scale files in
any of the myriad fonts directories you have installed on your machine?

Last edited by Corin; 07-29-2003 at 09:09 PM.
 
Old 07-30-2003, 12:13 PM   #3
Musikolo
Member
 
Registered: Jul 2003
Distribution: Yoper 2.91 beta (kernel 2.6.15)
Posts: 114

Original Poster
Rep: Reputation: 15
Thanks a lot Corin for your help. I thought no one was going to help me... Well, I didn't change any file at all, the only thing I did was put commented (#) the line "unix/:7100" as I got an error otherwise.

Now I don't know why I don't need that line commented but I get OpenOffice fonts with HUGE size font. The same happens when I do "make xconfig".

Do you know how might I solve that?

Thanks a lot for your help.

PD. Files that might help you. Below /etc/X11/fs/config:

#
# Default font server configuration file for Red Hat Linux
#

# allow a max of 10 clients to connect to this font server
client-limit = 10

# 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
#
catalogue = /usr/X11R6/lib/X11/fonts/misc:unscaled,
/usr/X11R6/lib/X11/fonts/75dpi:unscaled,
/usr/X11R6/lib/X11/fonts/100dpi:unscaled,
/usr/X11R6/lib/X11/fonts/misc,
/usr/X11R6/lib/X11/fonts/Type1,
/usr/X11R6/lib/X11/fonts/Speedo,
/usr/X11R6/lib/X11/fonts/cyrillic,
/usr/X11R6/lib/X11/fonts/TTF,
/usr/share/fonts/default/Type1,
,
/usr/lib/openoffice/share/fonts/truetype
# in 12 points, decipoints
default-point-size = 120

# 100 x 100 and 75 x 75
default-resolutions = 75,75,100,100

# use lazy loading on 16 bit (usually Asian) fonts
deferglyphs = 16

# how to log errors
use-syslog = on

# don't listen to TCP ports by default for security reasons
no-listen = tcp

--------------------------------------- BELOW /etc/X11/XF86Config: ---------------------------------------


# XFree86 4 configuration created by redhat-config-xfree86

Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "DevInputMice" "AlwaysCore"
EndSection

Section "Files"

# RgbPath is the location of the RGB database. Note, this is the name of the
# file minus the extension (like ".txt" or ".db"). There is normally
# no need to change the default.
# Multiple FontPath entries are allowed (they are concatenated together)
# By default, Red Hat 6.0 and later now use a font server independent of
# the X server to render fonts.
RgbPath "/usr/X11R6/lib/X11/rgb"
FontPath "unix/:7100"
EndSection

Section "Module"
Load "dbe"
Load "extmod"
Load "fbdevhw"
Load "glx"
Load "record"
Load "freetype"
Load "type1"
EndSection

Section "InputDevice"

# Specify which keyboard LEDs can be user-controlled (eg, with xset(1))
# Option "Xleds" "1 2 3"
# To disable the XKEYBOARD extension, uncomment XkbDisable.
# Option "XkbDisable"
# To customise the XKB settings to suit your keyboard, modify the
# lines below (which are the defaults). For example, for a non-U.S.
# keyboard, you will probably want to use:
# Option "XkbModel" "pc102"
# If you have a US Microsoft Natural keyboard, you can use:
# Option "XkbModel" "microsoft"
#
# Then to change the language, change the Layout setting.
# For example, a german layout can be obtained with:
# Option "XkbLayout" "de"
# or:
# Option "XkbLayout" "de"
# Option "XkbVariant" "nodeadkeys"
#
# If you'd like to switch the positions of your capslock and
# control keys, use:
# Option "XkbOptions" "ctrl:swapcaps"
# Or if you just want both to be control, use:
# Option "XkbOptions" "ctrl:nocaps"
#
Identifier "Keyboard0"
Driver "keyboard"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc105"
Option "XkbLayout" "es"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/psaux"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "no"
EndSection

Section "InputDevice"

# If the normal CorePointer mouse is not a USB mouse then
# this input device can be used in AlwaysCore mode to let you
# also use USB mice at the same time.
Identifier "DevInputMice"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "no"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Generic Laptop Display Panel 1024x768"
DisplaySize 96 96
HorizSync 31,0 - 48,0
VertRefresh 40,0 - 70,0
Option "dpms"
EndSection

Section "Device"
Identifier "Videocard0"
Driver "savage"
VendorName "Videocard vendor"
BoardName "S3 ProSavage KN133"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 16
Modes "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Section "DRI"
Group 0
Mode 0666
EndSection
 
Old 07-30-2003, 05:38 PM   #4
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
Quote:
Originally posted by Musikolo
The only thing I did was put commented (#) the line "unix/:7100" as I got an error otherwise.]
So you do now not have a # at the beginning of the line unix/:7100 I hope. In the lines included from XF86Config you have shown, there is no comment, and there should not be.

Now let me explain what is going on here.

As you know your applications need fonts.

In your XF86Config file you can either put a list of fontpaths in, or you can say unix:/:7100 which says to use a named pipe to a server running on port 7100, namely the xfs daemon, for which you included the configuration file /etc/X11/fs/config. And in fact if you set the appropriate option, you can allow other X servers to access the fonts served by the xfs daemon.

If you did not have the unix/:7100 line there (and as you have no Fontpath lines specified, then your X server would not start.

If you were to ever be in that situation, you would see the error message when you tried to start X,

"can't find font fixed"

Remember that one for future reference -- it means that your font server is not running for some reason.

The lines for your /etc/X11/fs/config file look good, though if you are on a high resolution monitor you may want to change the default resolution line to so that the 100 dpi fonts are used in preference to the 75 dpi fonts.

default-resolutions = 100,100,75,75

To see what fonts are available from your font serve type the command

xlsfonts | less

To explore the fonts use the command

xfontsel


Quote:
Now I don't know why I don't need that line commented
Well I hope the above explanation is clear as to why it is imperative that it is not commented out. Commented out means no fonts available, so no X.

Quote:
but I get OpenOffice fonts with HUGE size font.
Now that we have got the previous setup verified as being in the correct state we can deal with this problem.

All of the above was dealing with how X served up fonts in the original X manner and is still obviously used by the X server itself and lots of application such as xterm, xload, xrn etc etc etc.

There is a new font serving model using the XFont using libfontconfig which provides fonts only to the local machine (being entirely file based).


# rpm -qil fontconfig

to see the details of the package and its contents.

To see what fonts are available under this scheme issue the comand

# /usr/bin/fc-list

(and how about doing /usr/bin/fc-list > /tmp/font-list.1 as well to save a list of the fonts)

Now the programs you run which use this model include GTK and I suspect that you are having problems in this area.

Now one of the features of GTK is theme files which set amongst other things the colors and fonts used by windows and applications.

But the first thing to check, and assuming you are having all these problems in a GNOME desktop environment, run the command

# gnome-font-properties &

Are the values for Application font, Desktop font ,Window title
font and terminal font set to sensible values

either 10 , 12 , or 14?

Then in the bottom right hand corner push the button Details

When the new window pops up, look at the value set for resolution,
which should match the reslution of your display set by the switch
on the X server in your /etc/X11/xdm/Xservers file.

:0 local /usr/X11R6/bin/X :0 vt07 -dpi 100

or in startx script if you do not use a graphical display manager login.

When I did an upgrade on a system from SuSE 8.1 to 8.2 I had exactly
the opposite problem to you and some fonts in GTK applications were tiny
and it was all due to the Resolution setting in Font Rendering Details
being set incorrectly to a very small value.

Can you check all of the above and see if that helps.

The fonts which are in the fontconfig scheme of things are listed in the file

/etc/fonts/fonts.conf

and if you ever manually install (as opposed to install from an rpm package) new fonts to your system you have to add new entries to

/etc/fonts/fonts.local

But this is not all, you need to regenerate the font cache with

# fc-cache

Just to make sure everything is as it should be with your font installation, I suggest you run this command. It should give no output to the screen and it will re-gernerate the appropriate .fonts-cache files in all of the font directories listed in /etc/fonts/fonts.conf and fonts.local.

Please note any errors it reports, which it should not.

Then do a

# fc-list > /tmp/font-list.2

To see if things have improved from before, now do a

# diff /tmp/font-list.2 /tmp/font-list.1

And if you want to know how many different fonts you have available you can do

wc -l /tmp/font-list.2

Once you have finished you can tidy up with

rm /tmp/font-list.1 /tmp/font-list.2

After running these commands, check to see if you still have the too large font problem.

And if you think that fonts managment under X is a bit of a nightmare, then you are probably right :+)

Last edited by Corin; 07-30-2003 at 05:39 PM.
 
Old 07-31-2003, 01:07 PM   #5
Musikolo
Member
 
Registered: Jul 2003
Distribution: Yoper 2.91 beta (kernel 2.6.15)
Posts: 114

Original Poster
Rep: Reputation: 15
Well Corin, at the end I've achieved to solve my problem. The problem I had with OpenOffice was in its own configuration. So, I was checking all options and at the end I put them fine. I don't know how they lost their configuration in such a manner.

Don't think that the huge reply you wrote for me has been useless, because it's great and I've learn a lot about how font's system works in linux.

Just let me thank you a lot for your help and time you spent helping me. A million of thanks Corin!!
 
Old 07-31-2003, 02:47 PM   #6
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
What I would recommend you do, is to cut and paste the above stuff
and store it in a file somewhere for future reference, should you ever
encounter a problem with fonts again and it will provide a good troubleshooting guide.

Glad to be of service.

And to paraphrase Home Simpson,

"Share the knowledge"
 
Old 07-31-2003, 05:05 PM   #7
Thetargos
Senior Member
 
Registered: Mar 2003
Location: Mexico City
Distribution: Fedora, Ubuntu & Mint
Posts: 1,679

Rep: Reputation: 45
Corin, one more question, this time reffering to TTF's...

Since the hellish font setup on Linux, how would I install a custom TTF font file into the database?? it happens that a friend of mine made up a font style that I would like to try out, but it is in TTF format, so how would I install it and make X to recognize it?
 
Old 07-31-2003, 06:52 PM   #8
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
Well somebody *just* had to ask, did they not?

Actually installing a font is not as bad as tracking down an incorrect font configuration as listed above.

First of all, in order to keep things under control, nice and tidy etc,
custom installations should go under /usr/local, and one mirrors
there the structure that is used under /usr.

It is also useful to keep some sort of cataloguing of the fonts,
because after all, you may in the end install lots of them.

The following instructions apply to truetype fonts (*.ttf) ---

1) So is the font a microsoft font? If it is then

mkdir -p /usr/local/X11R6/lib/X11/fonts/truetype/microsoft

if it is not a microsoft font then

mkdir -p /usr/local/X11R6/lib/X11/fonts/truetype/misc

2) Now let's assume that it was not a microsoft font but
something else. So we will be using the misc directory
and not the microsoft directory.

mv your_font.ttf /usr/local/X11R6/lib/X11/fonts/truetype/misc

3) cd /usr/local/X11R6/lib/X11/fonts/truetype/misc

4) ttmkfdir -o fonts.scale

4) Hopefully your font encodings are in the standard place,
if not you will have to do a locate encodings | egrep font
and substitute the correct path below

mkfontdir -e /usr/X11R6/lib/X11/fonts/encodings

5) You now have your font in a format ready for use by X, but you need to tell the X font server where to find it.

So edit /etc/X11/fs/config and add the path to the directory to the
list of lines under catalog

.catalogue = /usr/X11R6/lib/X11/fonts/misc:unscaled,
/usr/X11R6/lib/X11/fonts/75dpi:unscaled,
/usr/X11R6/lib/X11/fonts/100dpi:unscaled,

.. whatever ...

/usr/X11R6/lib/X11/fonts/100dpi,
/usr/local/X11R6/lib/X11/fonts/truetype/misc

DO NOT FORGET to add a COMMA to the end of the preceeding line.

6) We now need to tell the fontconfig library about this new
font, so we go to /etc/fonts/local.conf and add a line
there, but we add the parent font directory not the subdirectory path

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>/usr/share/AbiSuite/fonts</dir>
<dir>/usr/share/xfce/fonts</dir>
<dir>/usr/local/X11R6/lib/X11/fonts</dir>
<!-- Uncomment below to enable subpixel rendering -->

So in future, if we add any more new fonts under
/usr/local/X11R6/lib/X11/fonts we will not have to add a new entry.

7) In order to actually get fontconfig to use the new fonts under
/usr/local/X11R6/lib/X11/fonts, we have to run the command

# fc-cache

which will then go through all the directories (and their subdirectories) listed in /etc/fonts/font.conf and /etc/fonts/local.conf and generate fonts.cache-1
files which are used by fontconfig.

8) We missed a step out! We have to restart xfs to pick up its new configuration file addition. This is done with the command
/etc/init.d/xfs restart

HOWEVER, if you are doing this from within an already running
X server session, restarting the font server does not always cause
the running X session to still see its fonts.

If you do xlsfonts following the restart of xfs and see no fonts
listed at all, then save any unsaved data in your applications,
and exit your X session. The X server will restart when you
logout and you will have to login again through the Display Manager login screen (assuming you have it set up as you should have). Then once you get back logged in, do an xlsfonts | egrep
-i font_name and see if it is there.

Note that the font name under the X Scheme of things will be in a different format from what you might expect.

Now do you have lots of microsoft fonts from your Windoze partition which are not installed on your Linux system?

Well create the directory

mkdir -p /usr/local/X11R6/lib/X11/fonts/truetype/microsoft

cp /mnt/C/windows/fonts/*.ttf /usr/local/X11R6/lib/X11/fonts/truetype/microsoft

or from wherever you have your C drive mounted

and then just follow the steps listed above.

The for example if you had installed tahoma.ttf
you would see from the xlsfonts listing

-microsoft-tahoma-medium-r-normal--0-0-0-0-p-0-iso8859-1
-microsoft-tahoma-medium-r-normal--0-0-0-0-p-0-iso8859-10
-microsoft-tahoma-medium-r-normal--0-0-0-0-p-0-iso8859-11
etc

And you can use xfontsel to explore your X installed fonts.

As a test you can do

xterm -font "-microsoft-tahoma-medium-r-normal--16-0-0-0-p-0-iso8859-1"

Notice that only the first position after the name is used to
specify a point size for truetype fonts.

Hope this helps and that you are able to make your X sessions
more fontful!

Last edited by Corin; 07-31-2003 at 06:55 PM.
 
Old 10-16-2003, 12:08 PM   #9
XavierPS
LQ Newbie
 
Registered: Oct 2003
Posts: 1

Rep: Reputation: 0
I'm tryng to install a TrueType font
I have a Suse 7.1 running XFree86 3.3
Finally I've found that I have to configure and start a X Font Server.
Well, in my Suse server I have no xfs script at /etc/rc.d

Where can I find one?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Xwindows problem... vish Linux - Newbie 2 08-02-2005 03:30 PM
Xwindows Problem cdameworth Linux - Laptop and Netbook 2 04-04-2005 07:11 AM
Maybe xwindows problem! Please help... dfengui Linux - Software 3 03-06-2005 11:52 PM
Xwindows problem with RH 7.2 vuthachh Linux - Networking 3 07-06-2004 02:53 AM
XWindows & fonts : not always nice display bahramH Linux - Software 4 06-06-2004 01:11 PM


All times are GMT -5. The time now is 11:18 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration