Wednesday, July 29, 2009

BI Publisher: Font Setup & Troubleshooting

Recently, Tim Dexter at oracle has been writing up a storm about barcode fonts implementations. This is an overview on how to do a relatively simple installation of fonts for BI Publisher on a PC. There are really only three steps to setting up a font for BI Publisher. The first step is to install it in windows, the second step is configuring the font for BI Publisher (java) and the third step is troubleshooting the setup font setup.

The following posts from Tim Dexter are useful as well for font setup or config:
How to install a font using XML Publisher Administrator?
I want a default font!
PS Font Support?
Barcoding 101

Installing the new fonts in word
1. Close any open Windows applications, such as Microsoft Word or Microsoft Outlook®.
2. In Control Panel, click Appearance and Themes.
Note: If you are using Control Panel Classic view or Microsoft Windows 2000, double-click Fonts, and then go to step 4.
3. In the task pane, under See Also, click Fonts.
Note: If a folder tree appears instead of the task pane, click Folders on the toolbar, and then under See Also, click Fonts.
4. On the File menu, click Install New Font.
5. In the Drives list, click the drive you want.
6. In the Folders list, double-click the folder that contains the fonts you want to add.
7. Under List of fonts, click the font you want to add, and then click OK.

Installing the new fonts in BI Publisher
1. Locate the JRE for BI Publisher (JAVA_HOME/lib). This can be done by going to Tools -> Options, then click the preview tab.


<?xml version="1.0" encoding="UTF-8"?>
<config version="1.0.0" xmlns=""><!-- Properties -->
<!-- System level properties -->
<property name="system-temp-dir">c:\tmp</property>
<!-- PDF compression
<property name="pdf-compression">true</property> -->
<!-- PDF Security
<property name="pdf-security">true</property>
<property name="pdf-open-password">user</property>
<property name="pdf-permissions-password">owner</property>
<property name="pdf-no-printing">true</property>
<property name="pdf-no-changing-the-document">true</property> -->
<!-- Font setting -->
<!-- Font setting (for FO to PDF etc...) -->
<font family="Arial" style="normal" weight="normal">
<truetype path="/fonts/Arial.ttf"/>
<font family="Default" style="normal" weight="normal">
<truetype path="/fonts/ALBANWTJ.ttf"/>

<font family="BC 3of9" style="normal" weight="normal">
<truetype path="C:\Program Files\Java\jre6\lib\fonts\B39R00.ttf"/>

<!--Font substitute setting (for PDFForm filling etc...) -->
<font-substitute name="MSGothic">
<truetype path="/fonts/msgothic.ttc" ttcno="0"/>

3. Configure the xdodebug.cfg. This is the standard debug configuration file for BI Publisher. xdodebug.cfg allows you to set the BI Publisher debugging level and to specify the directory where the log file should be written.

This is an example of what should be in the xdodebug.cfg

If you would like to know more about xdodebug.cfg file it’s available in the Oracle BI Publisher documentation or see the following metalink Note:364547.1. Also, the following posts are good:

BI Publisher: xdodebug.cfg troubleshooting
Get Logging

Troubleshooting the font setup
Step 1: When you run your template and you export to rtf, the specified font should show up correctly. If the font does not show up correctly it's because of the following issues:

A. You may need to do barcode implementation

B. The font is not configured *Most likely the issue

Step 2: Run the template again, but select the output format for PDF. If the barcode font does not show up it could be caused by the followings issues:

A. Verify the font is the fonts directory under the JAVA_HOME/lib/fonts
B. Verify the path is correct. I always use the absolute path to the font.
Example: C:\Program Files\Java\jre6\lib\fonts\B39R00.ttf
C. Verify the font is being found by BI Publisher. In the example above for the xdodebug.cfg we set the log directory to C:\tmp. Navigate to the tmp directory and open the xdo.log file. Locate any errors that might be present.

Example error:
[072909_090808562][oracle.apps.xdo.common.font.FontFactory$FontDef][ERROR] Failed to open TrueType font: /fonts/B39R00.ttf(0)

Example fix:
[072909_091211224][oracle.apps.xdo.common.font.FontFactory$FontDef][STATEMENT] TrueType font created: C:\Program Files\Java\jre6\lib\fonts\B39R00.ttf(0)