Home | Fedora Core 4 Tutorial | Linux Tutorials | Linux Games | Linux Java | Linux Kernal | Linux Firewall | Linux Database | Linux Distributions | Linux Firewall GUI | Linux Distributions | Linux Firewall

 


 

Search Host

Monthly Fee($)
Disk Space (MB)
Register With us for Newsletter!
Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Have tutorials?
Add your tutorial to our Java Resource and get tons of hits.

We offer free hosting for your tutorials. and exposure for thousands of readers. drop a mail
roseindia_net@yahoo.com
 
   

Tutorials

Java Server Pages

JAXB

Java Beans

JDBC

MySQL

Java Servlets

Struts

Bioinformatics

Java Code Examples

Interview Questions

 
Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

Web Promotion

Web Submission

Submit Sites

Manual Submission?

Web Promotion Guide

Hosting Companies

Web Hosting Guide

Web Hosting

Linux

Beginner Guide to Linux Server

Linux Distribution

Major Linux Distribution

Linux FTP Software

Frameworks

Persistence Framework

Web Frameworks

Free EAI Tools

Web Servers

Aspect Oriented Programming

Free Proxy Servers

Softwares

Adware & Spyware Remover

Open Source Softwares

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 Tutorials

Linux Distributions

Fedora

Slackware
SuSe
Mandrake
Knoppix
Mepis
Debian
All Distors....
 

 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2004. All rights reserved.