LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 08-12-2009, 03:59 PM   #1
klee12
Member
 
Registered: May 2007
Posts: 48

Rep: Reputation: 15
Can't find fonts like Times


Hello,

I installed Slackware 12.2 recently and some apps were saying they couldn't find some fonts, and looked pretty ugly when they made font subsitutions. I had installed all the fonts; indeed when I looked in /usr/share fonts I find

100dpi/ OTF/ TTF/ cyrillic/ misc/
75dpi/ Speedo/ Type1/ encodings/ util/

I looked at /etc/X11/xorg.conf

and added a few of the directories in the font path. Still doesn't fonts are missing.

I do xfontsel and I see fonts some strange font families, but not times or roman times, or helvetica.

I'm sure the fonts are somewhere, maybe buried in the Type1 directory but if so, how do you make them available to xfontsel and other X11 apps

Thanks in advance

klee12
 
Old 08-12-2009, 04:20 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,224

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by klee12 View Post
some apps were saying they couldn't find some fonts
Which specific program(s), and what was the exact error message? Paste it into your reply.

Last edited by dugan; 08-12-2009 at 04:32 PM.
 
Old 08-12-2009, 05:16 PM   #3
klee12
Member
 
Registered: May 2007
Posts: 48

Original Poster
Rep: Reputation: 15
Hello Dugan,

Yes I should have posted the error messages. Running xpdf on pdf file I got

Warning: Cannot convert string "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1" to type FontStruct
Warning: Cannot convert string "-*-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1" to type FontStruct
Warning: Cannot convert string "-*-times-bold-i-normal--20-*-*-*-*-*-iso8859-1" to type FontStruct
Warning: Cannot convert string "-*-times-medium-r-normal--16-*-*-*-*-*-iso8859-1" to type FontStruct
XtUngrabButton(drawArea,3,0)
Warning: Attempt to remove nonexistent passive grab

It was no biggie, I could read the document but the fonts could be prettier I thought.

klee12
 
Old 08-12-2009, 05:23 PM   #4
klee12
Member
 
Registered: May 2007
Posts: 48

Original Poster
Rep: Reputation: 15
Another example. When FVWM, my window manager exits, I find the error messages

[GetFontOrFixed]: WARNING -- can't get font -adobe-helvetica-bold-r-*-*-10-*-*-*
-*-*-*-*, trying 'fixed'
[GetFontOrFixed]: WARNING -- can't get font -adobe-helvetica-bold-r-*-*-10-*-*-*
-*-*-*-*, trying 'fixed'
[GetFontOrFixed]: WARNING -- can't get font -adobe-helvetica-bold-r-*-*-10-*-*-*
-*-*-*-*, trying 'fixed'
[GetFontOrFixed]: WARNING -- can't get font -adobe-helvetica-bold-r-*-*-10-*-*-*
-*-*-*-*, trying 'fixed'
[GetFontOrFixed]: WARNING -- can't get font -adobe-helvetica-bold-r-*-*-10-*-*-*
-*-*-*-*, trying 'fixed'
[GetFontOrFixed]: WARNING -- can't get font -adobe-helvetica-bold-r-*-*-10-*-*-*
-*-*-*-*, trying 'fixed'
[GetFontOrFixed]: WARNING -- can't get font -adobe-helvetica-bold-r-*-*-10-*-*-*
-*-*-*-*, trying 'fixed'
[GetFontOrFixed]: WARNING -- can't get font -adobe-helvetica-bold-r-*-*-10-*-*-*
-*-*-*-*, trying 'fixed'
[GetFontOrFixed]: WARNING -- can't get font -adobe-helvetica-bold-r-*-*-10-*-*-*
-*-*-*-*, trying 'fixed'

klee12
 
Old 08-13-2009, 08:00 AM   #5
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Those fonts are found in the Adobe Type Library which is not distributed with any Linux distribution I know of (it's proprietary). If you have the library on CD-ROM or another machine, you can copy the font files to, say, /usr/share/fonts/Adobe (that directory does not exist, you will need to create it). The font files you will need are *.afm and *.pfa; e.g., Helvetica-Bold.afm and Helvetica-Bold.pfa. While you're at it, you might just as well copy every font you have available.

You will need a utility, type1inst from http://linux.maruhn.com/sec/type1inst.html; it's quite simple to install and is used to create the fonts.scale and Fontmap files in the directory where you've copied the .afm and .pfa files; e.g., /usr/share/Adobe. You should, after copying all the font files and executing type1inst also execute the mkfontdir utility (that comes with Slackware).

And, after all that, you need to add an entry in /etc/X11/xorg.conf that looks like this:
Code:
Section "Files"
        RgbPath      "/usr/share/X11/rgb"
        ModulePath   "/usr/lib/xorg/modules"
        FontPath     "/usr/share/fonts/Adobe"
        FontPath     "/usr/share/fonts/TTF"
        FontPath     "/usr/share/fonts/OTF"
        FontPath     "/usr/share/fonts/Type1"
        FontPath     "/usr/share/fonts/myfonts"
        FontPath     "/usr/share/fonts/misc"
        FontPath     "/usr/share/fonts/75dpi/:unscaled"
EndSection
the stop and restart X so it takes effect.

There may be another Type 1 installer (I don't know of one) and you may be able to find Adobe fonts somewhere or other (or, shudder, buy the library license). You may be able to use TTF fonts in place of the Adobe fonts; e.g., map times-new-roman to times, courier-new to courier and so on. And, of course, you're going to need to dig up all the TTF fonts and install them in /usr/share/fonts/TTF, run mkfontscale and mkfontdir in that directory (you don't need type1inst for TTF fonts; they're not Type 1 fonts).

This isn't as bad as it seems and, if you can find and install Adobe Type 1 fonts, you'll be a lot happier than dealing with TTFs (which, in my experience, aren't quite up to snuff when you're picky about PostScript document format -- others may pick a few bones with that).

Anyway, hope this helps some.
 
Old 08-13-2009, 10:34 AM   #6
klee12
Member
 
Registered: May 2007
Posts: 48

Original Poster
Rep: Reputation: 15
Thanks tronayne for your suggestions.

I had just upgraded from Slackware 12.2 to Slackware 12.3 and remembered that no progarm in 12.2 complained about not finding adobe fonts. I then looked at the packages I recently installed and found that I had installed the following packages

font-adobe-100dpi-1.0.0-noarch-2
font-adobe-75dpi-1.0.0-noarch-2
font-adobe-utopia-100dpi-1.0.1-noarch-2
font-adobe-utopia-75dpi-1.0.1-noarch-2
font-adobe-utopia-type1-1.0.1-noarch-2

I go to the MANIFEST and see that the package

font-adobe-utopia-100dpi-1.0.1-noarch-2.tgz

contins files like

UTI___18.pcf.gz

So it looks like the fonts are on my computer, but that the names they are installed on and the names applications and xfontsel expect are different. Now, I installed the whole X system by going in to the X directory and typing in

installpkg *.tgz

After that I ran xorgsetup. I did not install and configure the fonts from the installation CD so maybe I left out a step that the installation CD had. If that is the case does anyone know what that critical step is?

Thanks in advance

klee12
 
Old 08-15-2009, 01:24 AM   #7
klee12
Member
 
Registered: May 2007
Posts: 48

Original Poster
Rep: Reputation: 15
OK, I think I've sort of solved the problem, or more precisely stumbled onto a fix without understanding what's going on.

In poking around I found a program like mkfontdir. I went to 100dpi, saved the original fonts.dir file, and ran mkfontdir. The new fonts.dir did show the names

UTBI__10-ISO8859-15.pcf.gz -adobe-utopia-bold-i-normal--14-100-100-100-p-78-iso8
859-15

wherase the original showed only lines like

charB08.pcf.gz -bitstream-charter-bold-r-normal--11-80-100-100-p-69-iso8859-1

I ran sfontsel, but couldn't see any of the adobe fonts. I was floundering and frustrated and ran xorgsetup xfontsel didn't show the adobe fonts. I rebooted to a Debian partition, and the /usr/share/fonts/X11/100dpi did have the adobe fonts and xfontsel could see those fonts. I rebooted back into Slackware distribution considered replacing the 100dpi directory with the one from Debian. I ran xfontsel. Oh my gosh, I could see the Adobe fonts.

Evidently after running mkfontdir, I had to reboot in order to create the fonts. I looked in /etc/X11/xorg.conf, which had been overwriten when I ran xorgsetup early, and looked at the font paths. The 100dpi directory with all the adobe fonts were not there.

I'm not sure I understand what's going on and, for my edicfication, I would appreciate some explanation. I may in the future go back and try to figure out what happened, but I'm not going to mess with my system now.

klee12
 
Old 08-15-2009, 01:49 AM   #8
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
You need to run mkfontscale, mkfontdir, and fc-cache -f

Instead of running them manually you can also run the font setup under Setup in pkgtool.

Also, take a look in /etc/fonts (particularly fonts.conf).

On my system I installed all of my windows fonts in case I would ever need/want them. I removed the symlink for 60-liberation.conf under conf.d so that the Liberation fonts would not override my MS fonts (like Times) - [just in case anybody needs this and comes here because of the thread title].
 
Old 08-15-2009, 11:30 AM   #9
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
In general you no longer need to do the mkfontscale/mkfontdir stuff anymore, nor do you need to edit xorg.conf (which no longer even exists by default). To add fonts/font directories to your system, create the file /etc/fonts/local.conf and make it look like:

Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <dir>/path/to/your/font/directory</dir>
</fontconfig>
You can list multiple directories, including, eg. /usr/share/fonts/100dpi. Then just run fc-cache and you're good to go.

Some programs like openoffice.org will not see the pcf.gz fonts, but if you open up kword you will see that they are available on your system after doing the above.

Brian
 
Old 08-15-2009, 11:52 AM   #10
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,224

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Expanding on what BCary wrote, try the following specific local.conf:

Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <dir>/usr/share/fonts/100dpi</dir>
 <dir>/usr/share/fonts/75dpi</dir>
</fontconfig>
On a normal Slackware install, these two directories are disabled in fonts.conf. The fonts there normally aren't available to programs that get their fonts through Xft. The file above will make them available.

Last edited by dugan; 08-15-2009 at 11:55 AM.
 
Old 08-15-2009, 04:30 PM   #11
klee12
Member
 
Registered: May 2007
Posts: 48

Original Poster
Rep: Reputation: 15
Thanks shadowsnipes,BCarey, and dugan. Your comments are much appreciated.

It seems the more I learn the less I know. The problem is I worry about this stuff every 2 or 3 years when I install a new version of Slackware and things can change alot in those 2 or 3 years but I still want to understand what is going on. I was surprised when on the Debian distribution xorg.conf was not even required. And I remember the days when I struggled with modelines.

I used to think that fonts were found from the fontpaths given in an X11 config file (xorg.conf now) or maybe an environmental variable. But it seems now that the fontpaths are not used. I shouldn't be surprised since now scalable fonts and international fonts are common.

I'm unclear about how applications find the fonts. I infer from the above comments that there are two libraries involved, Xft (does that stand for X11 fonts?) and fntconfig. If Xft cannot find a font, then the fontconfig library may be be called to find the font using files from /etc/fonts. Though Xft seems to find the fonts I've added the lines suggested by Dugan to 51-local.conf just in case

Is that close to being correct?

One more question. In the font directories there are font.alias files but there is no mkfontalias. Should'nt the font.alias file be changed after the font.dir and fonts.scale change?


Thanks again, everyone.

klee12
 
Old 08-15-2009, 05:30 PM   #12
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,224

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
I cover this in the "Optimizing Slackware Linux's Fonts" article in my sig.

The Xft subsystem uses Fontconfig to feed fonts to applications. Its configuration is stored in /etc/fonts and refreshed with fc-cache. Most programs these days use Xft, including all GTK2 and Qt apps. "fc-list" list the fonts available via Xft.

The X server has a separate (older) font subsystem. It is configured using Fontpaths in xorg.conf. Xfontsel, xlsfonts, mkfontdir and mkfontscale belong to this system.

They are separate, and adding a font to one does not add it to the other. On a default Slackware install, the 100dpi and 75dpi font directories are available from the X server but not via Xft. That means they'll appear in xfontsel but not fc-list.

Here's a recent HOWTO that says the same thing in different words:
http://avi.alkalay.net/linux/docs/fo...Font.html#xorg

And here's an old, very technical one that was written right when Xft was being introduced:
http://tldp.org/HOWTO/archived/FDU/intro.html

Quote:
One more question. In the font directories there are font.alias files but there is no mkfontalias. Should'nt the font.alias file be changed after the font.dir and fonts.scale change?
The answer is in the mkfontdir manpage. I don't worry about this at all. (No, I didn't know that off the top of my head. I googled for "fonts.alias" and the manpage was the first hit).

Last edited by dugan; 08-15-2009 at 05:57 PM.
 
Old 08-16-2009, 08:12 PM   #13
klee12
Member
 
Registered: May 2007
Posts: 48

Original Poster
Rep: Reputation: 15
Thanks Dugan, I think I'm beginning to understand. I looked at your documents under you sig and looked at the manpages but not very closely since I was in a hurry to get the fonts working. A moral is don't hurry; understand what's going on before you try to find the solution.

Let me see if I got this right. There are two font locating system, the old X one and the Xft and fontconfig one. An app may use one or both systems. I think I was vaguely familar with the X one. When in doubt run mkfontdir and mkfontscale in each of the fontdirs. That should make everything visible to the old X system. For the other system run fc-cache and fiddle with local.conf in the /etc/fonts directory.

I might also run pkgtool (which I've never done before). When I get the time I'll try it but I don't recall installing fonts with pkgtook.

Is that right. Thanks everyone

klee12
 
Old 08-17-2009, 01:03 AM   #14
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,224

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
That's exactly right.
 
  


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
To find, how many times my box has rebooted gsiva Linux - General 5 05-30-2009 02:12 AM
LXer: Linux Libertine Open Fonts offers free Times Roman alternative LXer Syndicated Linux News 0 08-28-2006 09:03 PM
Find all files created or modified between 2 times MicahCarrick Linux - Software 3 06-29-2006 04:22 PM
System hangs; Atheros Madwifi-ping times out every 15/16 times james 456 Linux - Networking 0 01-12-2006 06:55 PM
Times New Roman-like fonts jrdioko Linux - Newbie 6 09-12-2004 07:52 PM

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

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