LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices


Reply
  Search this Thread
Old 08-22-2004, 11:22 AM   #1
rsamurti
Member
 
Registered: Dec 2003
Location: Mysore
Distribution: Mandrake, Libranet, Slackware
Posts: 148

Rep: Reputation: 22
xorg.conf question.


Hi,

I have configured my X using xorgcfg. This is my xorg.conf:

Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "Module"
Load "freetype"
# Load "xtt"
Load "extmod"
Load "glx"
Load "dri"
Load "dbe"
Load "record"
Load "xtrap"
Load "type1"
Load "speedo"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Device" "/dev/mouse"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "keyboard"
Option "XkbModel" "pc104"
Option "XkbLayout" "us"
EndSection

Section "Monitor"
Identifier "Monitor0"
DisplaySize 267 200
HorizSync 30.0 - 55.0
VertRefresh 50.0 - 120.0
EndSection

Section "Device"
Identifier "Card0"
Driver "i810"
ChipSet "i815"
Card "i810 i815"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 16
SubSection "Display"
Viewport 0 0
Depth 16
Modes "1024x768" "800x600"
EndSubSection
EndSection

Section "DRI"
Mode 0666
EndSection

My X is working properly. In this, Section "Files" does not have any entries. If I create xorg.conf using xorgconfig, then, this section contains paths to fonts. My question is, how is X finding the fonts without any entries in Section "Files"? How do I make X access Type1 fonts which are located in /usr/share/ghostscript/fonts?

Thanks for your help,

Anand
 
Old 08-22-2004, 11:31 AM   #2
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
add the paths you want and then run # fc-cache -fv. maybe xorg defaults to the usual directories if none are listed? I know it will run a default configuration without even any xorg.conf file, so maybe that's what's happening. if you add one, you might then have to add the others, though, so i would add them all just to be sure, e.g.:
Code:
Section "Files"

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

    FontPath   "/usr/X11R6/lib/X11/fonts/TTF/"
    FontPath   "/usr/X11R6/lib/X11/fonts/misc/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/Type1/"
    FontPath   "/usr/X11R6/lib/X11/fonts/Speedo/"
    FontPath   "/usr/X11R6/lib/X11/fonts/misc/"
    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/"
    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/"
    FontPath   "/usr/X11R6/lib/X11/fonts/truetype/"

    FontPath   "/usr/share/ghostscript/fonts"

EndSection
 
Old 08-22-2004, 11:38 AM   #3
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
http://www.xfree86.org/4.3.0/fonts2.html I know that is about XFree86 but it's exactly the same for Xorg. They use fontconfig and its config file is /etc/fonts/fonts.conf.
 
Old 08-22-2004, 12:20 PM   #4
rsamurti
Member
 
Registered: Dec 2003
Location: Mysore
Distribution: Mandrake, Libranet, Slackware
Posts: 148

Original Poster
Rep: Reputation: 22
Quote:
Originally posted by synaptical
add the paths you want and then run # fc-cache -fv. maybe xorg defaults to the usual directories if none are listed? I know it will run a default configuration without even any xorg.conf file, so maybe that's what's happening. if you add one, you might then have to add the others, though, so i would add them all just to be sure, e.g.:
Code:
Section "Files"

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

    FontPath   "/usr/X11R6/lib/X11/fonts/TTF/"
    FontPath   "/usr/X11R6/lib/X11/fonts/misc/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/Type1/"
    FontPath   "/usr/X11R6/lib/X11/fonts/Speedo/"
    FontPath   "/usr/X11R6/lib/X11/fonts/misc/"
    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/"
    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/"
    FontPath   "/usr/X11R6/lib/X11/fonts/truetype/"

    FontPath   "/usr/share/ghostscript/fonts"

EndSection
Including the paths as mentioned above has no effect. I am still not able to access the fonts in /usr/share/ghostscript/fonts.

Anand
 
Old 08-22-2004, 12:43 PM   #5
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
i just copied and pasted from what you wrote, but as a longshot it *might* need the trailing slash. also, you didn't mention if you ran fc-cache -fv afterward (as root), so do that if you haven't. you also might need to restart X for the changes to take effect.

if that doesn't work, add the path to /etc/fonts/local.conf (or ~/.fonts.conf) as Andrew Benton suggested (again, always run fc-cache -fv after adding fonts). and check the output of fc-cache. it should list the directories it's adding as it goes through. also check the permissions on the ghostscript directory and fonts, they might be wonky. gl
 
Old 08-22-2004, 09:01 PM   #6
rsamurti
Member
 
Registered: Dec 2003
Location: Mysore
Distribution: Mandrake, Libranet, Slackware
Posts: 148

Original Poster
Rep: Reputation: 22
Quote:
Originally posted by synaptical
i just copied and pasted from what you wrote, but as a longshot it *might* need the trailing slash. also, you didn't mention if you ran fc-cache -fv afterward (as root), so do that if you haven't. you also might need to restart X for the changes to take effect.

if that doesn't work, add the path to /etc/fonts/local.conf (or ~/.fonts.conf) as Andrew Benton suggested (again, always run fc-cache -fv after adding fonts). and check the output of fc-cache. it should list the directories it's adding as it goes through. also check the permissions on the ghostscript directory and fonts, they might be wonky. gl
I added the trailing slash, saved the file, and then, ran fc-cache -fv afterward as root. I even restarted X. When I did fc-cache -fv I got the following message:

fc-cache: "/usr/share/fonts": caching, 0 fonts, 2 dirs
fc-cache: "/usr/share/fonts/default": caching, 0 fonts, 1 dirs
fc-cache: "/usr/share/fonts/default/Type1": caching, 0 fonts, 0 dirs
fc-cache: "/usr/share/fonts/latex-xft-fonts": caching, 7 fonts, 0 dirs
fc-cache: "/usr/X11R6/lib/X11/fonts/TTF": caching, 55 fonts, 0 dirs
fc-cache: "/usr/X11R6/lib/X11/fonts/Type1": caching, 60 fonts, 0 dirs
fc-cache: "/root/.fonts": skipping, no such directory
fc-cache: succeeded

After this, I added /usr/share/ghostscript/fonts/ to .fonts in my root's home directory. I again ran fc-cache -fv and got the following message:

fc-cache: "/usr/share/fonts": caching, 0 fonts, 2 dirs
fc-cache: "/usr/share/fonts/default": caching, 0 fonts, 1 dirs
fc-cache: "/usr/share/fonts/default/Type1": caching, 0 fonts, 0 dirs
fc-cache: "/usr/share/fonts/latex-xft-fonts": caching, 7 fonts, 0 dirs
fc-cache: "/usr/X11R6/lib/X11/fonts/TTF": caching, 55 fonts, 0 dirs
fc-cache: "/usr/X11R6/lib/X11/fonts/Type1": caching, 60 fonts, 0 dirs
fc-cache: "/root/.fonts": "/root/.fonts": not a directory, skipping
fc-cache: succeeded

From this output it appears that .fonts should be a directory where we need to copy the fonts and not a file.

I observed that /etc/fonts contains fonts.conf which is an XML file and another file fonts.dtd. How to edit the contents of these files is not obvious.

Anand
 
Old 08-22-2004, 09:43 PM   #7
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
Quote:
Originally posted by rsamurti
I observed that /etc/fonts contains fonts.conf which is an XML file and another file fonts.dtd. How to edit the contents of these files is not obvious.
you're not supposed to edit those files, as it says in the beginning:
Quote:
\<!--
DO NOT EDIT THIS FILE.
IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
again, if adding the path to xorg.conf doesn't work, you need to edit /etc/fonts/local.conf (or ~/.fonts.conf) as we mentioned. if you don't have an /etc/fonts/local.conf, use this stripped down version:
Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts.conf file to configure system font access -->
<fontconfig>
        <dir>/usr/share/ghostscript/fonts</dir>
</fontconfig>
usually there is other stuff in there about aliases and rendering info, but if everything else is okay there's probably no need to add any.


p.s. it might just have been easier to make a directory called "ghostscript" in /usr/share/fonts and put the ghostscript fonts in there, since i see that path is already being cached.

Last edited by synaptical; 08-22-2004 at 09:47 PM.
 
Old 08-22-2004, 11:29 PM   #8
rsamurti
Member
 
Registered: Dec 2003
Location: Mysore
Distribution: Mandrake, Libranet, Slackware
Posts: 148

Original Poster
Rep: Reputation: 22
Quote:
p.s. it might just have been easier to make a directory called "ghostscript" in /usr/share/fonts and put the ghostscript fonts in there, since i see that path is already being cached.
I created a directory called ghostscript in /usr/share/fonts. Then, I copied all font files from /usr/share/ghostscript/fonts to /usr/share/fonts/ghostscript. After this, I did fc-cache -fv. Now I got the output:

fc-cache: "/usr/share/fonts": caching, 0 fonts, 3 dirs
fc-cache: "/usr/share/fonts/default": caching, 0 fonts, 1 dirs
fc-cache: "/usr/share/fonts/default/Type1": caching, 0 fonts, 0 dirs
fc-cache: "/usr/share/fonts/ghostscript": caching, 52 fonts, 0 dirs
fc-cache: "/usr/share/fonts/latex-xft-fonts": caching, 7 fonts, 0 dirs
fc-cache: "/usr/X11R6/lib/X11/fonts/TTF": caching, 55 fonts, 0 dirs
fc-cache: "/usr/X11R6/lib/X11/fonts/Type1": caching, 60 fonts, 0 dirs
fc-cache: "/root/.fonts": skipping, no such directory
fc-cache: succeeded

As we can notice, the ghostscript fonts are being cached. But there is a problem.

My problem is to make xfig locate ghostscript fonts. In the README file given with xfig it is given as follows:

It is highly recommended that you use Type1 fonts for xfig.
For RedHat systems you can use following command (as root):

chkfontpath --add /usr/share/fonts/default/Type1

For other X systems you can install the following ghostscript files
into your X11 Type1 fonts directory (usu. /usr/lib/X11/fonts/Type1) for
the best scalable on-screen fonts. You need to update the "fonts.dir"
and "fonts.scale" files to reflect these fonts.

Basically, if you copy the following lines into those two files and
update the count in the first line to include them, then do an
"xset fp rehash" the X Window System will know about them.

Of course, you will have to also copy the ghostscript font files
themselves (i.e. b018012l.pfb etc.) into the X11 fonts/Type1 directory.
You can get these fonts from ftp://ftp.cs.wisc.edu/pub/ghost/aladdin/fonts

n021003l.pfb -adobe-times-medium-r-normal--0-0-0-0-p-0-iso8859-1
n021004l.pfb -adobe-times-bold-r-normal--0-0-0-0-p-0-iso8859-1
n021023l.pfb -adobe-times-medium-i-normal--0-0-0-0-p-0-iso8859-1
n021024l.pfb -adobe-times-bold-i-normal--0-0-0-0-p-0-iso8859-1
a010013l.pfb -adobe-avantgarde-book-r-normal--0-0-0-0-p-0-iso8859-1
a010015l.pfb -adobe-avantgarde-demi-r-normal--0-0-0-0-p-0-iso8859-1
a010033l.pfb -adobe-avantgarde-book-o-normal--0-0-0-0-p-0-iso8859-1
a010035l.pfb -adobe-avantgarde-demi-o-normal--0-0-0-0-p-0-iso8859-1
b018012l.pfb -adobe-bookman-light-r-normal--0-0-0-0-p-0-iso8859-1
b018015l.pfb -adobe-bookman-demi-r-normal--0-0-0-0-p-0-iso8859-1
b018032l.pfb -adobe-bookman-light-i-normal--0-0-0-0-p-0-iso8859-1
b018035l.pfb -adobe-bookman-demi-i-normal--0-0-0-0-p-0-iso8859-1
n019003l.pfb -adobe-helvetica-medium-r-normal--0-0-0-0-p-0-iso8859-1
n019004l.pfb -adobe-helvetica-bold-r-normal--0-0-0-0-p-0-iso8859-1
n019023l.pfb -adobe-helvetica-medium-o-normal--0-0-0-0-p-0-iso8859-1
n019024l.pfb -adobe-helvetica-bold-o-normal--0-0-0-0-p-0-iso8859-1
n019043l.pfb -adobe-helvetica-medium-r-narrow--0-0-0-0-p-0-iso8859-1
n019044l.pfb -adobe-helvetica-bold-r-narrow--0-0-0-0-p-0-iso8859-1
n019063l.pfb -adobe-helvetica-medium-o-narrow--0-0-0-0-p-0-iso8859-1
n019064l.pfb -adobe-helvetica-bold-o-narrow--0-0-0-0-p-0-iso8859-1
c059013l.pfb -adobe-new century schoolbook-medium-r-normal--0-0-0-0-p-0-iso8859-1
c059033l.pfb -adobe-new century schoolbook-medium-i-normal--0-0-0-0-p-0-iso8859-1
c059016l.pfb -adobe-new century schoolbook-bold-r-normal--0-0-0-0-p-0-iso8859-1
c059036l.pfb -adobe-new century schoolbook-bold-i-normal--0-0-0-0-p-0-iso8859-1
p052003l.pfb -adobe-palatino-medium-r-normal--0-0-0-0-p-0-iso8859-1
p052004l.pfb -adobe-palatino-bold-r-normal--0-0-0-0-p-0-iso8859-1
p052023l.pfb -adobe-palatino-medium-i-normal--0-0-0-0-p-0-iso8859-1
p052024l.pfb -adobe-palatino-bold-i-normal--0-0-0-0-p-0-iso8859-1
s050000l.pfb -URW-Standard Symbols L-medium-r-normal--0-0-0-0-p-0-urw-fontspecific
d050000l.pfb -URW-Zapf Dingbats-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
z003034l.pfb -adobe-itc zapf chancery-medium-i-normal--0-0-0-0-p-0-iso8859-1

So, it is clear that xfig looks for the required fonts in /usr/lib/X11/fonts/Type1. But these fonts are already present in /usr/share/ghostscript/fonts. So, I created sym links to the font files in /usr/lib/X11/fonts/Type1 to point at corresponding font files in /usr/share/ghostscript/fonts. After this, I updated fonts.scale and fonts.dir files in /usr/lib/X11/fonts/Type1 as mentioned above. Now, to make xfig locate the fonts I did

xset fp rehash

Now, xfig is able to locate all the fonts. But suppose I close xfig and start it again, it is not locating the fonts unless I do xset fp rehash before starting xfig. So, every time I have to do xset fp rehash before starting xfig to make xfig locate the fonts. Is it possible to avoid this?

What is the difference between fc-cache -fv and xset fp rehash?

Please excuse me for this lengthy mail.

Anand
 
Old 08-23-2004, 12:15 AM   #9
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
i just don't understand why you are making it so complicated, with all the symlinking and directories and everything. look:

Quote:
Originally posted by rsamurti
For other X systems you can install the following ghostscript files
into your X11 Type1 fonts directory (usu. /usr/lib/X11/fonts/Type1) for
the best scalable on-screen fonts. You need to update the "fonts.dir"
and "fonts.scale" files to reflect these fonts.

Basically, if you copy the following lines into those two files and
update the count in the first line to include them, then do an
"xset fp rehash" the X Window System will know about them.

Of course, you will have to also copy the ghostscript font files
themselves (i.e. b018012l.pfb etc.) into the X11 fonts/Type1 directory.
You can get these fonts from ftp://ftp.cs.wisc.edu/pub/ghost/aladdin/fonts

i take it you aren't using redhat, so follow what it says "for other X systems":

1) move your ghostscript fonts into the Type1 directory (they say usually /usr/lib/X11/fonts/Type1, but your path is /usr/X11R6/lib/X11/fonts/Type1 so i would first try putting them there)

2) run mkfontscale and mkfontdir

3) then "clean up" and delete your empty ghostscript directory (and delete all those symlinks if they're still hanging around, too ) (edit: and run fc-cache -fv, of course ).

if that still doesn't work and they really need to be in /usr/lib/X11/fonts/Type1, then just move them there instead, add the path to xorg.conf and /etc/fonts/local.conf, and then do the rest of the procedure.

the xset fp rehash problem i don't know about (you did add the lines to the two font files?), but maybe xset just sets the font path for that session? not sure what's going on with that, but if it isn't working the way you need it to, i say ditch it. as long as you have done the mkfontscale/dir, i would just run the fc-cache -fv again. afaik, that makes the entire X system aware of any fonts you have cached, and it should work no matter how many times you open and close the program.

you can also
man xset
man fc-cache

Last edited by synaptical; 08-23-2004 at 12:32 AM.
 
  


Reply



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
Where is my xorg.conf gone NNP Debian 14 11-28-2005 05:18 PM
xorg.conf question - also a hello :) Dirtnap Slackware 7 09-23-2005 06:32 AM
xorg.conf mad_alfred Ubuntu 14 06-20-2005 11:31 AM
xorg.conf Duo Slackware 4 01-07-2005 08:57 PM
Xorg Hard Crashes and corrupts xorg.conf Advocator Linux - General 0 07-15-2004 01:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation

All times are GMT -5. The time now is 10:44 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration