Hi, I am trying get my notes together for Fonts ( I know it will never ever be complete). I believe Linux is wasting of disk space when it comes to fonts. Many applications use their own fonts so making sure that the whole system will work as intended takes a huge time. Anyway I have installed the ghostscript rpms from Mike Fabians directory for SuSE 8.1. ghostscript-fonts-std-7.05.3-99 rpm has a prebuilt "fonts.dir" file under /usr/share/ghostscript/fonts and the encodings in the file do not have iso-8859-9 (Latin5 Turkish). I would like to understand why it does not have (is it because the fonts do not have that encoding or it has not been generated.) Then there is a file /etc/ttf2pt1/convert.cfg which comes with ttf2pt1-341-19 rpm "This is a collection of tools and scripts that allow to convert True Type Fonts (as used by MS Wind*ws) to be converted to Postscript Type 1 fonts, so they can be used in X11 and Ghostscript" Is this package really needed I thought Ghostscript were able to print the Truetype fonts. If so what would be the easy way to add the truetype fonts and their aliases (Like Fontmap.ttf and add this to "/usr/share/ghostscript/7.05/lib/Fontmap" ) -- Togan Muftuoglu Unofficial SuSE FAQ Maintainer http://dinamizm.ath.cx
Togan Muftuoglu <toganm@dinamizm.com> さんは書きました:
I am trying get my notes together for Fonts ( I know it will never ever be complete). I believe Linux is wasting of disk space when it comes to fonts.
Yes, there are a few duplicates. I'll try to eliminate them when I encounter them. For example Abiword had yet another copy of the URW fonts which are already in the ghostscript-fonts-std package, therfore I deleted the fonts from the Abiword package and replaced them by symbolic links to the fonts in ghostscript-fonts-std.
Anyway I have installed the ghostscript rpms from Mike Fabians directory for SuSE 8.1. ghostscript-fonts-std-7.05.3-99 rpm has a prebuilt "fonts.dir" file under /usr/share/ghostscript/fonts and the encodings in the file do not have iso-8859-9 (Latin5 Turkish). I would like to understand why it does not have (is it because the fonts do not have that encoding or it has not been generated.)
Originally the fonts.dir file in the ghostscript-fonts-std package had only entries for iso8859-1. Long ago I checked manually that these fonts also cover iso8859-2 and iso8859-15 and therefore added these entries. ago. I didn't check whether they completely contain the glyphs necessary for Turkish. Sorry for beeing too lazy ... But thanks to Juliusz Chroboczek we now have 'mkfontscale' which can check this automatically: root@nozomi:/usr/share/ghostscript/fonts# mkfontscale root@nozomi:/usr/share/ghostscript/fonts$ grep -i "nimbus.*mono.*medium-r" fonts.scale n022003l.pfb -urw-Nimbus Mono L-medium-r-normal--0-0-0-0-p-0-iso8859-1 n022003l.pfb -urw-Nimbus Mono L-medium-r-normal--0-0-0-0-p-0-iso8859-2 n022003l.pfb -urw-Nimbus Mono L-medium-r-normal--0-0-0-0-p-0-iso8859-9 n022003l.pfb -urw-Nimbus Mono L-medium-r-normal--0-0-0-0-p-0-iso8859-13 n022003l.pfb -urw-Nimbus Mono L-medium-r-normal--0-0-0-0-p-0-iso8859-15 n022003l.pfb -urw-Nimbus Mono L-medium-r-normal--0-0-0-0-p-0-adobe-standard n022003l.pfb -urw-Nimbus Mono L-medium-r-normal--0-0-0-0-p-0-microsoft-cp1252 n022003l.pfb -urw-Nimbus Mono L-medium-r-normal--0-0-0-0-p-0-iso10646-1 mike@nozomi:/usr/share/ghostscript/fonts$ i.e. the fonts do appear to support iso8859-9 and iso8859-13 as well. I'll extend the /sbin/conf.d/SuSEconfig.fonts script to generate the /usr/share/ghostscript/fonts/fonts.{scale,dir} files automatically using 'mkfontscale' for SuSE Linux >= 8.2.
ttf2pt1-341-19 rpm "This is a collection of tools and scripts that allow to convert True Type Fonts (as used by MS Wind*ws) to be converted to Postscript Type 1 fonts, so they can be used in X11 and Ghostscript"
Is this package really needed I thought Ghostscript were able to print the Truetype fonts.
I think it is mostly not needed anymore, neither for X11 nor for Ghostscript. X11 can use TrueType fonts for quite a long time already and Ghostscript can use TrueType fonts as well. But there are still a few exotic applications where ttf2pt1 is needed. For example CJK-LaTeX cannot use TrueType fonts directly, it needs either .pk fonts or .pfb fonts generated from the TrueType fonts. '/usr/sbin/cjk-latex-config --type' generates .pfb fonts for use with CJK-LaTeX using ttf2pt1.
If so what would be the easy way to add the truetype fonts and their aliases (Like Fontmap.ttf and add this to "/usr/share/ghostscript/7.05/lib/Fontmap" )
Yes, you can add Fontmap.ttf to /usr/share/ghostscript/7.05/lib/Fontmap like this: root@nozomi:/usr/share/ghostscript/7.05/lib# cat Fontmap %! % See Fontmap.GS for the syntax of real Fontmap files. (Fontmap.GS) .runlibfile (Fontmap.kanji) .runlibfile (Fontmap.rus) .runlibfile (Fontmap.CID) .runlibfile (Fontmap.greek) .runlibfile (Fontmap.ttf) .runlibfile root@nozomi:/usr/share/ghostscript/7.05/lib# and create a /usr/share/ghostscript/7.05/lib/Fontmap.ttf containing the TrueType fonts you want to use, for example: root@nozomi:/usr/share/ghostscript/7.05/lib# cat Fontmap.ttf /LuxiSerif (/usr/X11R6/lib/X11/fonts/truetype/luxirr.ttf) ; root@nozomi:/usr/share/ghostscript/7.05/lib# The name behind the / at the beginning is the PostScript name, i.e. you can use this font in PostScript for example like this: mike@nozomi:/tmp$ cat ttt.ps % -*- coding: iso-8859-1 -*- /LuxiSerif findfont 30 scalefont setfont 50 200 moveto (Grüß Gott!) show showpage mike@nozomi:/tmp$ You can find out the "official" PostScript-name of a TrueType-font with 'ftdump': root@nozomi:/usr/share/ghostscript/7.05/lib# ftdump /usr/X11R6/lib/X11/fonts/truetype/luxirr.ttf | grep PostScript PostScript name: LuxiSerif root@nozomi:/usr/share/ghostscript/7.05/lib# -- Mike Fabian <mfabian@suse.de> http://www.suse.de/~mfabian 睡眠不足はいい仕事の敵だ。
* Mike FABIAN; <mfabian@suse.de> on 19 Jan, 2003 wrote:
fonts also cover iso8859-2 and iso8859-15 and therefore added these entries. ago. I didn't check whether they completely contain the glyphs necessary for Turkish. Sorry for beeing too lazy ...
I wanted to make sure I understood it coorectly.
I'll extend the /sbin/conf.d/SuSEconfig.fonts script to generate the /usr/share/ghostscript/fonts/fonts.{scale,dir} files automatically using 'mkfontscale' for SuSE Linux >= 8.2.
Great, so it'll work out of the box :-)
But there are still a few exotic applications where ttf2pt1 is needed. For example CJK-LaTeX cannot use TrueType fonts directly, it needs either .pk fonts or .pfb fonts generated from the TrueType fonts. '/usr/sbin/cjk-latex-config --type' generates .pfb fonts for use with CJK-LaTeX using ttf2pt1.
For LaTeX I save my questions, probably I'll send it under a new subject. First I want to get Ghostscript behave with full support of its capabilities Many thanks for the valuable information -- Togan Muftuoglu Unofficial SuSE FAQ Maintainer http://dinamizm.ath.cx
Togan Muftuoglu <toganm@dinamizm.com> さんは書きました:
* Mike FABIAN; <mfabian@suse.de> on 19 Jan, 2003 wrote: [...]
I'll extend the /sbin/conf.d/SuSEconfig.fonts script to generate the /usr/share/ghostscript/fonts/fonts.{scale,dir} files automatically using 'mkfontscale' for SuSE Linux >= 8.2.
Great, so it'll work out of the box :-)
I improved /sbin/conf.d/SuSEconfig.fonts now to do that and a few more things. If you like you can test it, the new scripts are here: http://www.suse.de/~mfabian/misc/SuSEconfig.fonts/SuSEconfig.fonts http://www.suse.de/~mfabian/misc/SuSEconfig.fonts/fonts-config* http://www.suse.de/~mfabian/misc/SuSEconfig.fonts/fonts-config.1.gz I tested them on SuSE Linux 8.1 and on the current beta, they might work for older versions as well but I haven't tried. To use the new scripts, copy the above 3 files to /sbin/conf.d/SuSEconfig.fonts /usr/sbin/fonts-config /usr/share/man/man1/fonts-config.1.gz and call /usr/sbin/fonts-config --force as root. Actually /sbin/conf.d/SuSEconfig.fonts itself does almost nothing now. I found it too difficult to extend the bash script SuSEconfig.fonts, therefore I removed almost everything from SuSEconfig.fonts and made it just call the perl-script /usr/sbin/fonts-config which does the real work. Here's the man-page of the new fonts-config script: FONTS-CONFIG(1) FONTS-CONFIG(1) NAME fonts-config - configures installed fonts for use with X11. SYNOPSIS fonts-config [OPTION]... OPTIONS -f, --force Force the update of all generated files even if it appears to be unnecessary according to the time stamps. -q, --quiet> Work silently, unless an error occurs. -v, --verbose Print some progress messages to standard output. -d, --debug Print a lot of debugging messages to standard output. DESCRIPTION Configures installed fonts for use with X11. Basically it does the following things: call fc-cache creates an index of FreeType font files in a directory for use with client side font rendering via libXft, see fc-cache(1). call cidfont-x11-config cidfont-x11-config is another little perl script which configures CID-keyed fonts for use with X11, see cid font-x11-config(1). creates fonts.scale and fonts.dir files To find the list of directories currently used for server side fonts, /etc/X11/XF86Config is parsed and merged with a hardcoded list of directories. If the font server xfs is running, /etc/X11/fs/config is also parsed and the list of directories found there is merged as well. In each directory from this list, first of all a fonts.scale file is created by calling mkfontscale. Then, the entries found in the fonts.scale file are merged with the entries from all fonts.scale.* files. fonts.scale.* files may be supplied by rpm-packages or manually added by the user to override or amend the entries created automatically by mkfontscale. Entries in a fonts.scale.* file have higher priority than entries automatically created by mkfontscale. All entries generated automatically by mkfontscale for a certain font file are discarded if any fonts.scale.* file contains an entry for the same font file. If the xtt module is configured to load in /etc/X11/XF86Config, additional entries may be created to make use of the artificial bold and italic features of xtt. The time stamp of /etc/X11/XF86Config is not checked, i.e. you have to use fonts-config --force after editing /etc/X11/XF86Config to switch between the xtt and freetype modules. After the final list of entries has been written back to fonts.scale, mkfontdir is called. Usually fonts-config is called automatically via SuSEcon fig (SuSEconfig --module fonts), which is usually automat ically called by YaST2. But you can also execute fonts- config directly, which is mainly useful to debug it. AUTHOR Mike FABIAN <mfabian@suse.de>, 2003. SEE ALSO fc-cache(1), cidfont-x11-config(1), mkfontdir(1), mkfontscale(1) perl v5.8.0 2003-01-24 FONTS-CONFIG(1) -- Mike Fabian <mfabian@suse.de> http://www.suse.de/~mfabian 睡眠不足はいい仕事の敵だ。
* Mike FABIAN; <mfabian@suse.de> on 24 Jan, 2003 wrote:
If you like you can test it, the new scripts are here:
http://www.suse.de/~mfabian/misc/SuSEconfig.fonts/SuSEconfig.fonts http://www.suse.de/~mfabian/misc/SuSEconfig.fonts/fonts-config* http://www.suse.de/~mfabian/misc/SuSEconfig.fonts/fonts-config.1.gz
I tested them on SuSE Linux 8.1 and on the current beta, they might work for older versions as well but I haven't tried.
Works here on SuSE 8.1 as well. Just an idea would be possible for the tool to create a "Fontmap.ttf" file so truetype fonts can also be used with Ghostsrcipt out of the box -- Togan Muftuoglu Unofficial SuSE FAQ Maintainer http://dinamizm.ath.cx
Togan Muftuoglu <toganm@dinamizm.com> さんは書きました:
Just an idea would be possible for the tool to create a "Fontmap.ttf" file so truetype fonts can also be used with Ghostscript out of the box
I could of course easily make a script to generate entries in a Fontmap.ttf like /LuxiSerif (/usr/X11R6/lib/X11/fonts/truetype/luxirr.ttf) ; for all installed TrueType fonts. I just wasn't sure whether anybody would find that useful. No program I know of generates PostScript files which reference such fonts as /LuxiSerif. Of course your own programs could produce PostScript using that. But I'm afraid not many people are doing that ... -- Mike Fabian <mfabian@suse.de> http://www.suse.de/~mfabian 睡眠不足はいい仕事の敵だ。
* Mike FABIAN; <mfabian@suse.de> on 24 Jan, 2003 wrote:
I could of course easily make a script to generate entries in a Fontmap.ttf like
/LuxiSerif (/usr/X11R6/lib/X11/fonts/truetype/luxirr.ttf) ;
for all installed TrueType fonts. I just wasn't sure whether anybody would find that useful.
For Luxi maybe you're right Now I have the following ttt.ps toganm@earth:/tmp> cat ttt.ps /Verdana findfont 30 scalefont setfont 50 200 moveto (Selam yakışıklı oğlum dedi Anne) show showpage GS>(ttt.ps) run Can't find (or can't open) font file /usr/X11R6/lib/X11/fonts/truetype/verdana.ttf . Can't find (or can't open) font file /usr/share/ghostscript/Resource/Font/Verdana. Can't find (or can't open) font file Verdana. Substituting font Courier for Verdana. I have the following entry in the Fontmap.ttf /Verdana (/usr/X11R6/lib/X11/fonts/truetype/verdana.ttf );
No program I know of generates PostScript files which reference such fonts as /LuxiSerif. Of course your own programs could produce PostScript using that. But I'm afraid not many people are doing that
I am currently completely lost with the fonts :-( -- Togan Muftuoglu Unofficial SuSE FAQ Maintainer http://dinamizm.ath.cx
Togan Muftuoglu <toganm@dinamizm.com> さんは書きました:
Now I have the following ttt.ps toganm@earth:/tmp> cat ttt.ps /Verdana findfont 30 scalefont setfont 50 200 moveto (Selam yakışıklı oğlum dedi Anne) show showpage
GS>(ttt.ps) run Can't find (or can't open) font file /usr/X11R6/lib/X11/fonts/truetype/verdana.ttf . Can't find (or can't open) font file /usr/share/ghostscript/Resource/Font/Verdana. Can't find (or can't open) font file Verdana. Substituting font Courier for Verdana.
I have the following entry in the Fontmap.ttf /Verdana (/usr/X11R6/lib/X11/fonts/truetype/verdana.ttf );
The entries in ttt.ps and Fontmap.ttf look correct to me. I did exactly the same in my example with the Luxi Serif font. Just to make sure I tried again with the Verdana and it worked as well, as expected. Are you sure the file /usr/X11R6/lib/X11/fonts/truetype/verdana.ttf exists? The Ghostscript error message seems to suggest that the file doesn't exist or isn't readable. If your entries in ttf.ps or Fontmap.ttf were wrong, Ghostscript wouldn't even get that far. But apparently it tries to open the file /usr/X11R6/lib/X11/fonts/truetype/verdana.ttf and fails. -- Mike Fabian <mfabian@suse.de> http://www.suse.de/~mfabian 睡眠不足はいい仕事の敵だ。
* Mike FABIAN; <mfabian@suse.de> on 24 Jan, 2003 wrote:
Togan Muftuoglu <toganm@dinamizm.com> さんは書きました: Are you sure the file /usr/X11R6/lib/X11/fonts/truetype/verdana.ttf exists?
Yes it does along many other True type fonts. I am using ghostscript-x11-7.05.3-99 ( coming from your directory )
The Ghostscript error message seems to suggest that the file doesn't exist or isn't readable.
I am 100 % sure toganm@earth:/usr/X11R6/lib/X11/fonts/truetype> l verdana* -rw-r--r-- 1 root root 136032 Dec 12 1998 verdanab.ttf -rw-r--r-- 1 root root 154264 Dec 12 1998 verdanai.ttf -rw-r--r-- 1 root root 139640 Dec 12 1998 verdana.ttf -rw-r--r-- 1 root root 153324 Dec 12 1998 verdanaz.ttf Weird looks like Harry Potter is in my box and doing his Voodo first Locale settings now truetype fonts :-) -- Togan Muftuoglu Unofficial SuSE FAQ Maintainer http://dinamizm.ath.cx
Mike FABIAN <mfabian@suse.de> さんは書きました:
Togan Muftuoglu <toganm@dinamizm.com> さんは書きました:
Now I have the following ttt.ps toganm@earth:/tmp> cat ttt.ps /Verdana findfont 30 scalefont setfont 50 200 moveto (Selam yakışıklı oğlum dedi Anne) show showpage
GS>(ttt.ps) run Can't find (or can't open) font file /usr/X11R6/lib/X11/fonts/truetype/verdana.ttf . ^ here is a space too much! Can't find (or can't open) font file /usr/share/ghostscript/Resource/Font/Verdana. Can't find (or can't open) font file Verdana. Substituting font Courier for Verdana.
I have the following entry in the Fontmap.ttf /Verdana (/usr/X11R6/lib/X11/fonts/truetype/verdana.ttf ); ^ here is the wrong space! The entries in ttt.ps and Fontmap.ttf look correct to me.
I didn't look carefully enough. (/usr/X11R6/lib/X11/fonts/truetype/verdana.ttf ); is not correct, everything between the parentheses is the filename, which includes the space behind "verdana.ttf". And there is no file "verdana.ttf ". -- Mike Fabian <mfabian@suse.de> http://www.suse.de/~mfabian 睡眠不足はいい仕事の敵だ。
Togan Muftuoglu <toganm@dinamizm.com> さんは書きました:
* Mike FABIAN; <mfabian@suse.de> on 24 Jan, 2003 wrote:
I could of course easily make a script to generate entries in a Fontmap.ttf like
/LuxiSerif (/usr/X11R6/lib/X11/fonts/truetype/luxirr.ttf) ;
for all installed TrueType fonts. I just wasn't sure whether anybody would find that useful.
For Luxi maybe you're right
Anyway, as generating such a Fontmap.X11 is so easy, I just added this feature to the fonts-config script. You can download the new script from the same location where the previous version was: http://www.suse.de/~mfabian/misc/SuSEconfig.fonts/fonts-config (the web server only syncs once per hour, please wait an hour before trying to download). I named the Fontmap "Fontmap.X11-auto" instead of "Fontmap.ttf" because I thought that somebody might manually create a file with the name "Fontmap.ttf" and then be angry that my script overwrites it. I hope "Fontmap.X11-auto" is sufficiently crazy that nobody will get the idea to create such a file manually. You still need to add the include command for "Fontmap.X11" manually to the main Ghostscript Fontmap like this: mfabian@magellan:~$ cat /usr/share/ghostscript/7.05/lib/Fontmap %! % See Fontmap.GS for the syntax of real Fontmap files. (Fontmap.X11-auto) .runlibfile (Fontmap.GS) .runlibfile (Fontmap.kanji) .runlibfile (Fontmap.rus) .runlibfile (Fontmap.CID) .runlibfile (Fontmap.greek) .runlibfile mfabian@magellan:~$ The "Fontmap" file is owned by the Ghostscript package mfabian@magellan:~$ rpm -qf /usr/share/ghostscript/7.05/lib/Fontmap ghostscript-library-7.05.3-99 mfabian@magellan:~$ and I thought it might be better to add this extra line directly to the Ghostscript package instead of inserting it later with the fonts-config script. -- Mike Fabian <mfabian@suse.de> http://www.suse.de/~mfabian 睡眠不足はいい仕事の敵だ。
participants (2)
-
Mike FABIAN
-
Togan Muftuoglu