Problem: A report, designed for generating PDF with the true-type font Univers in it, does not work while deployed on the web, and uses other fonts instead.
Cause: there’s no Univers installed in the Reports Services on Unix.
Solution: install the font and configure the Reports Service!  Sounds simple…

In the process of figuring this out, I had several error-messages, like rep-1352 (The fonts specified for this report cannot be found for the character set specified by NLS_LANG) , and rep-1 (nothing else…).
Took a lot of time to eliminate those errors, partly because there was a feature in the specified report what did’nt speed up the process of resolving this issue: embedded html. This caused for example the “rep-1″-error.

With special thanks to Marc Riesewijk, developer:

1. First, make a so called ‘AFM’-file of the font-files from your windows-client, which will be used to copy to the Linux-server.

In the case of Univers there are the following files in c:\windows\fonts:
-unvr55w.TTF
-unvr56w.TTF
-unvr57w.TTF
-unvr58w.TTF
-unvr65w.TTF
-unvr66w.TTF
-unvr67w.TTF
-unvr68w.TTF

Download the free tool ttf2pt1 .
Install this in a seperate directory on your windows client. Unpack, en run ‘winbuild.bat’. Probably you get errors for missing dll’s. Put these dll’s in your path, or copy these to the ttf2pt1-directory, or download them to this directory. Run winbuild.bat again until it’s without errors.

Copy also the TTF-files in this directory on your client.

Run the following commands on the prompt on your client:
ttf2pt1 -a -e -Ob OW unvr55w.TTF
ttf2pt1 -a -e -Ob OW unvr56w.TTF
etc.

Then you ought to get .afm- and .pfa -files for every font.

2. Copy the .afm-files to the Linux-machine in the directory: <ORACLE_HOME>/guicommon/tk/admin/AFM
Important: Binary-transfer !!

3. Rename the files to names which are in the files:
for example:

oracle@uttltto:/software/oracle/product/10.2/middle/guicommon/tk/admin/AFM> head unvr55w.TTF
StartFontMetrics 4.1
FontName Univers-Medium
FullName Univers Medium
Notice Copyright 1992-97 Hewlett-Packard. All rights reserved.
EncodingScheme FontSpecific
FamilyName Univers
Weight Medium
Version Version 1.3 [Hewlett-Packard]
Characters 385
ItalicAngle 0.0

Rename this unvr55w.TTF to Univers-Medium:
==> mv unvr55w.TTF Univers-Medium
Perform this to all the other files.

4. Very important step: check these files on Carriage-returns with a script, e.q. check_afm.sh:

#?/bin/sh
for fic in `ls *`
do
(od -a $fic |grep -i cr) && echo “File containing a Carriage Return: ” $fic
done

There should be no output. When there’s output, probably something went wrong with copying from the client to Linux.

5. Now the necessary files are on Linux. What left is the configuration.

The following files are of vital importance:
a- $ORACLE_HOME/guicommon/tk/admin/uiprint.txt
b- $ORACLE_HOME/guicommon/tk/admin/PPD/default.ppd
c- $ORACLE_HOME/guicommon/tk/admin/uifont.ali
d- $ORACLE_HOME/bin/report.sh

a – $ORACLE_HOME/guicommon/tk/admin/uiprint.txt
One line (the last)  is active:

# — Note that the following two printers are aliases for the same
# — physical printer, with different names for different types:
# tk2hp4m:PCL:5:HP printer in 771 for testing PCL:ui4.hpd:
# tk2bw1ps:PostScript:1:HP printer in 771 for testing PS:hp4mp6_1.ppd:
#
# Not A Printer:ASCII:1:Configure your uiprint.txt file:none:
projectx:PostScript:2:test:default.ppd:

b – $ORACLE_HOME/guicommon/tk/admin/PPD/default.ppd
Changed the include-line:

*% To modify this, change the filename in quotations to the base
*% filename (no directory) of your default printer’s PPD file.
*% If you move this to the end, the included file’s info will override
*% the defaults above.
*Include: “projectx.ppd”

Created a  $ORACLE_HOME/guicommon/tk/admin/PPD/projectx.ppd by copying datap462.ppd, and add the following lines:

*% Font Information =====================
*%DefaultFont: Courier
*%DefaultFont: Univers-Medium
*Font Univers-Medium: Standard “(001.001)” Standard ROM
*Font Univers-MediumItalic: Standard “(001.001)” Standard ROM
*Font Univers-Bold: Standard “(001.001)” Standard ROM
*Font Univers-BoldItalic: Standard “(001.001)” Standard ROM
*Font Univers-Condensed-Medium: Standard “(001.001)” Standard ROM
*Font Univers-Condensed-MediumItalic: Standard “(001.001)” Standard ROM
*Font Univers-Condensed-Bold: Standard “(001.001)” Standard ROM
*Font Univers-Condensed-BoldItalic: Standard “(001.001)” Standard ROM

c- $ORACLE_HOME/guicommon/tk/admin/uifont.ali

However all the notes are mentioning the editing of this file, we didn’t touch the file, and it seems to work. But the font wouldn’t get bold in pdf. So added the following line under the PDF-section:

[ PDF ]
univers           = Univers

d- $ORACLE_HOME/bin/report.sh

Only be sure that your report-directory is in the REPORTS_PATH.

6. Post-configuration of the AFM-files.

It appeared to be that the Italic-Univers fonts had a different look, they  a wrong ‘angle’, leaning back in stead of the other way how it should be.
Changed this ( through ‘vi’) in these files from
“ItalicAngle -16.0″
to
“ItalicAngle 16.0″
Other files contained 17 instead of 16 by the way.

Used sources:

Doc B14048-02  – Oracle Application Server Reports Services Publishing Reports to the web (10.1.2), chapter 4
350971.1   – Troubleshouting guide for Font Aliasing / Font Subsetting / Font Embedding Issues.
272063.1   – Using Reports PDF Subsetting, Font Size and Styles bold, Italic, Bold-Italic Are Ignored
203781.1   – Rep-1352 while running Reports deployed on the Web.
223949.1   – How to Configure Reports to Generate PDF with Eastern European National Characters.