LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 04-23-2006, 06:11 AM   #1
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Rep: Reputation: 35
Adding OpenType (OTF) fonts to X in Slackware 10.2


Running a stock slackware-current, I am trying to add my favorite OpenType (.OTF) fonts for use in X11 under Slackware.

I have the following relevant lines in my xorg.conf:
Code:
Section "Files"
RgbPath      "/usr/X11R6/lib/X11/rgb"
ModulePath   "/usr/X11R6/lib/modules"
FontPath     "/usr/X11R6/lib/X11/fonts/misc/"
FontPath     "/usr/X11R6/lib/X11/fonts/TTF/"
FontPath     "/usr/X11R6/lib/X11/fonts/OTF/"
FontPath     "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath     "/usr/X11R6/lib/X11/fonts/CID/"
FontPath     "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath     "/usr/X11R6/lib/X11/fonts/100dpi/"
FontPath     "/opt/openoffice.org/share/fonts/truetype/"
EndSection

Section "Module"
Load  "record"
Load  "extmod"
Load  "dbe"
Load  "dri"
Load  "glx"
Load  "xtrap"
Load  "freetype"
Load  "type1"
Load  "freetype"
Load  "synaptics"
EndSection
I then copied my .otf files into /usr/X11R6/lib/X11/fonts/OTF/ and ran fc-cache (as root), giving such a directory :

Code:
-rw-r--r-- 1 root root 62260 2003-06-12 15:26 PerpetuaStd.otf
-rw-r--r-- 1 root root 30492 2003-05-13 00:18 WeissStd.otf
-rw-r--r-- 1 root root  1161 2006-04-15 17:58 fonts.cache-1
-rw-r--r-- 1 root root     2 2006-04-15 17:52 fonts.dir
However, I don't get any OTF fonts, and my /var/log/Xorg.0.log gives these lines:

Code:
Could not init font path element /usr/X11R6/lib/X11/fonts/OTF/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!
Could not init font path element /opt/openoffice.org/share/fonts/truetype/, removing from list!
Google told me I need to have type1 module loaded, but it is, and according to Xorg.0.log it is loaded without trouble. Have I missed any other modules or steps?

Any advise would be greatly appreciated!

-Y1
 
Old 04-23-2006, 12:55 PM   #2
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
have you done
mkfontdir
and
mkfontscale
for the new dirs?
 
Old 04-23-2006, 03:41 PM   #3
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
Hi kodon,

Thanks much for your reply - I had not ran mkfontdir and mkfontscale, and I recently ran both as root. However, it still doesn't work and I get the same error message in Xorg.0.log..

However, now I also have a fonts.scale file:
Code:
8
PerpetuaStd.otf -adobe-perpetua std-medium-r-normal--0-0-0-0-p-0-iso10646-1
PerpetuaStd.otf -adobe-perpetua std-medium-r-normal--0-0-0-0-p-0-iso8859-1
PerpetuaStd.otf -adobe-perpetua std-medium-r-normal--0-0-0-0-p-0-iso8859-15
PerpetuaStd.otf -adobe-perpetua std-medium-r-normal--0-0-0-0-p-0-microsoft-cp1252
WeissStd.otf -adobe-weiss std-medium-r-normal--0-0-0-0-p-0-iso10646-1
WeissStd.otf -adobe-weiss std-medium-r-normal--0-0-0-0-p-0-iso8859-15
WeissStd.otf -adobe-weiss std-medium-r-normal--0-0-0-0-p-0-iso8859-1
WeissStd.otf -adobe-weiss std-medium-r-normal--0-0-0-0-p-0-microsoft-cp1252
and a fonts.dir file with:
Code:
0
(single zero)

and fonts.cache-1 remains the same...

Could I be missing an X module (see table above) ?

-Y1
 
Old 04-23-2006, 04:14 PM   #4
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
did you re-run `fc-cache -vv` (perhaps -f also)
after you made it a font directory?
 
Old 04-24-2006, 01:02 AM   #5
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
Thanks again!

Looks like my OTH directory isn't even cached...

Code:
/usr/X11R6/lib/X11/fonts/OTF#fc-cache -f -vv

fc-cache: "/usr/share/fonts": caching, 0 fonts, 1 dirs
fc-cache: "/usr/share/fonts/wine": caching, 0 fonts, 0 dirs
fc-cache: "/usr/X11R6/lib/X11/fonts/TTF": caching, 52 fonts, 0 dirs
fc-cache: "/usr/X11R6/lib/X11/fonts/Type1": caching, 29 fonts, 0 dirs
fc-cache: "/root/.fonts": skipping, no such directory
fc-cache: succeeded
I have added the path in /etc/X11/xorg.conf, remains unchanged:
Code:
Section "Files"
RgbPath      "/usr/X11R6/lib/X11/rgb"
ModulePath   "/usr/X11R6/lib/modules"
FontPath     "/usr/X11R6/lib/X11/fonts/misc/"
FontPath     "/usr/X11R6/lib/X11/fonts/TTF/"
FontPath     "/usr/X11R6/lib/X11/fonts/OTF/"
FontPath     "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath     "/usr/X11R6/lib/X11/fonts/CID/"
FontPath     "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath     "/usr/X11R6/lib/X11/fonts/100dpi/"
FontPath     "/opt/openoffice.org/share/fonts/truetype/"
EndSection
What could be the other reason why the OTF directory isn't scanned? (I'm running fc-cache as root, permissions not a problem (directory 755 and files 644)

Any other ideas?
 
Old 04-24-2006, 01:27 AM   #6
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
try adding them to the font path...
`xset fp+ <dir>`
`xset fp rehash`

actually a mkfontdir in the parent
and a rehash should suffice.

Last edited by kodon; 04-24-2006 at 01:33 AM.
 
Old 04-24-2006, 02:30 AM   #7
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
Still doesn't work, neither from superuser nor normal user (with xhost + for superuser)

However, one thing strikes me as odd - when I run fc-cache -vv, it lists fc-cache: "/usr/share/fonts/wine": skipping, 0 fonts, 0 dirs even though this directory is not listed in /etc/X11/xorg.conf

At the same time, the directories in /etc/X11/xorg.conf are not scanned - could I have a configuration inconsistency somewhere?

-Y1
 
Old 04-24-2006, 03:51 PM   #8
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
hmm. i'm not sure why you would need to modify
xhost permissions. and this should all
be performed as root...
 
Old 04-25-2006, 01:27 AM   #9
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
Hi,

Reason why I had to do xhost +localhost was that xset uses X and thus requires authentication of some sort - as I _never_ login as root in X, it was needed.

However, I'm quite confident that the problem lies elsewhere, as the paths are correctly entered in /etc/X11/xorg.conf but still appear different in the logs and fc-cache -vv -f ...

Question: It would be interesting to know how many (if any?) have successfully installed OTF fonts in Slackware?

-Y1
 
Old 04-25-2006, 01:53 AM   #10
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
Take a look at /etc/fonts/fonts.conf, I added a file called /etc/fonts/local.conf which is included automatically by fonts.conf to support artwiz fonts, my file looks like:
Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf -->
<fontconfig>

	<dir>/usr/X11R6/lib/X11/fonts/artwiz</dir>

</fontconfig>
 
Old 04-25-2006, 01:57 AM   #11
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
Quote:
Originally Posted by Yalla-One
Question: It would be interesting to know how many (if any?) have successfully installed OTF fonts in Slackware?
This isn't a Slackware specific issue, it's an X issue. According to Wikipedia, Freetype provides support for OTF. Do you have any TrueType fonts working on your system? It's late, so excuse stupid questions from me.

I noticed you have "freetype" specified twice in your X.org config file. Can you remove one of those and see if that changes anything? Where did you get your OTF fonts? If they can be downloaded, I can try one out on my system and see what happens. I'm running XFree86 4.6.0rc4, which isn't X.org but the freetype support should be the same.

Peace...
 
Old 04-25-2006, 02:10 AM   #12
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
Solved!

That did the trick! I removed the extra truetype load, and added the OTF directory to /etc/fonts/fonts.conf, and restarted X with Ctrl-Alt-backspace, and now my OTF fonts show up perfectly.

Thanks much to everyone involved - This is greatly appreciated!!

A couple of closing questions:

1. the /etc/fonts/fonts.conf file specifically says not to edit the file as it is automatically generated - does this mean I should really have changed something else?

2. In Windows, the more fonts you add, the slower the system runs, as it keeps a list of fonts in memory - I assume there's no equivalent issues in X, but would like to have confirmed that adding more fonts won't bloat/slow my system?

Thanks again - now I can finally get my templates working again

-Y1
 
Old 04-25-2006, 02:20 AM   #13
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
Well, you changed two things so we're not sure which one fixed your problem.

Try adding the duplicate "freetype" module to your X.org config file and see if your problem comes back or not. Then we'll know for sure what the culprit was.

As for Windows fonts and performance issues, I've got over 1000 Windows fonts installed on my system and my system runs well.

The only time I see a performance "hit" is when I use an app that loads ALL the fonts so I can pick another font to use. The font loading time is very slow on my system but normal usage isn't impacted at all.

Peace...
 
Old 04-25-2006, 05:41 AM   #14
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
No change when dual freetype was added, but lost OTF when removed from fonts.conf so that's the culprit.

One interesting note though - while these fonts now show up when I do xlsfonts and also in Scribus and the KDE font program correctly, they are completely unreadable in OpenOffice.org 2.0(2). In the font list (they used to not appear at all), they are written in courier type themselves, and when I select the font, all text is less than 1 mm high and looks like fly droppings on the page.. This is not an issue in other apps than OpenOffice... Any ideas?

-Y1
 
Old 04-25-2006, 10:08 AM   #15
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
Quote:
Originally Posted by Yalla-One
No change when dual freetype was added, but lost OTF when removed from fonts.conf so that's the culprit.
Now I better understand why my Windows fonts work. I installed them in the /usr/X11R6/lib/X11/fonts directory (in a sub-dir called Windows) which is already listed in /etc/fonts.conf so fc-cache knows to look there automagically when scanning for fonts to cache.

I have no idea on the OO issue.

Peace...
 
  


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
OpenType Fonts? carboncopy Slackware 4 06-11-2007 09:12 AM
Install OTF fonts in RHEL WS 4 vadoo Linux - Security 1 06-17-2005 08:41 AM
Adding new fonts in Suse9.1 John_Emad Suse/Novell 6 02-09-2005 04:40 PM
adding fonts marie-p Linux - Newbie 4 01-24-2005 10:34 AM
Adding fonts to linux The Jakale Linux - Newbie 3 04-30-2002 03:32 PM


All times are GMT -5. The time now is 07:34 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