IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

TrueType Fonts in Debian mini-HOWTO

Search Howtos :Match :
Next Previous Contents

4. Printing (ghostscript)

Starting with version 4, ghostscript has supported TrueType fonts as a compile-time option. Two Debian packages provide ghostscript:

  • main/binary-*/text/gs_*.deb is DFSG-compliant version 5.10,
  • non-free/binary-*/gs-aladdin_*.deb is non-DFSG-compliant version 5.50.
Both versions support TrueType fonts.

4.1 Configuring Ghostscript to use TrueType fonts

If you have a working xfstt server, it is easy to configure ghostscript to use TrueType fonts. We simply execute the following command:


# xfstt --gslist --sync >> /etc/gs.Fontmap

In practice, I've found it beneficial to make several small changes to the font definitions generated by xfstt. First, if a font name does not contain any spaces, I change the name to the usual notation. If a font name does contain spaces, I replace all spaces with dashes and the original name is added as an alias to the new name.

Finally, I prepend TTF- (or MS-) to all font names to minimize problems caused by a TrueType font having an identical name to an preexisting font.

Thus


(Arial)               (/usr/share/fonts/truetype/arial.ttf)   ;
(Arial Bold Italic)   (/usr/share/fonts/truetype/arialbi.ttf) ;

becomes


/MS-Arial             (/usr/share/fonts/truetype/arial.ttf)   ;
/MS-Arial-Bold-Italic (/usr/share/fonts/truetype/arialbi.ttf) ;
(Arial Bold Italic)   /MS-Arial-Bold-Italic                   ;
/Arial                /MS-Arial                               ;

The aliases ensure that ghostscript and xfstt can still specify the same font by a common name.

Much more significantly, with the change in the font names it's possible to instruct ghostscript to use TrueType fonts instead of the standard fonts. The documentation claims that this is also possible with parenthetical notation, but I could not get it to work.

For instance, we can instruct ghostscript to replace Helvetica fonts with Microsoft's free Arial fonts by appending the following lines to the /etc/gs.Fontmap file:


/Helvetica               /MS-Arial              ;
/Helvetica-Oblique       /MS-Arial-Italic       ;
/Helvetica-Bold          /MS-Arial-Bold         ;
/Helvetica-BoldOblique   /MS-Arial-Bold-Italic  ;

Similar aliases can be defined for the other standard fonts. These aliases would be most useful on samba printers serving Windows clients.

4.2 Printing TrueType font specimens

The best way to verify that ghostscript is properly configured to use TrueType fonts is to print font specimen pages. Assuming that you're running ghostscript 5.50 and that it is your default print queue, you can print all TrueType fonts with the following command:


# xfstt --gslist --sync | printfont

where printfont is the following shell script


#!/bin/sh

set -e
IFS= ')'

while read fontname rest
do
    cat << EOM | lpr
%!PS
(/usr/lib/ghostscript/5.50/prfont.ps) run
$fontname) DoFont
EOM
done

If you wish to print only a few fonts, the following script will be easier to use:


#!/bin/sh

set -e
while read -p "Font name, or ^D to exit: " fontname
do
    cat << EOM | lpr
%!PS
(/usr/lib/ghostscript/5.50/prfont.ps) run
$fontname DoFont
EOM
done


Next Previous Contents
Search Howtos :Match :
Opera 10.10
Opera for Linux
ImageMagick 6.5.7.10
ImageMagick image processing studio
DeleGate 9.9.6-pre6
Proxy server which runs on multiple platforms
Inkscape 0.47
Vector graphic editor for SVG
Nano 2.1.99pre2
Emulate Pico while also offering a few enhancements.
My Money 2.0.49
Personal financial software
Linux Kernel 2.6 2.6.32-rc8
Linux Kernel
Rhythmbox 0.12.6
Integrated music management application
Tellico 2.1.1
Collection manager for books, music, videos, and bibliographies
Totem 2.28.4
Movie player for Gnome
Free IT Magazines, White Papers, eBooks, and more !
Oracle Magazine

Contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more.

Vulnerability Management for Dummies

Get all the Facts and See How to Implement a Successful Vulnerability Management Program.

Website Magazine

Has tapped premier talent in the Internet industry for our content and each and every issue will contain practical advice and insights for website owners.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info