February 12, 2010

Using and Mapping our own Fonts in BI Publisher

Hello everyone,

So coming back after a long time. Well as usual recently I was asked to use fonts provided by one of our customers in our BI Publisher generated reports. I ignore the things until some one force me or give me constraints. Then finally under constraints, I somehow explored this new feature too under the guidance ambiguous(or not self-explanatory) doc provided by BI Publisher team. :P So finally here comes a post. Yo !

STEP 1: Let's create a simple sample UserDefinedFontDemoReport in BI Publisher GUI

STEP 2: Now lets create some dummy query just for getting some sample data xml just for creating RTF Template.[To create a RTF and upload it as a template to our created reports, we always need a data xml with atleast one level data hierarchy]

STEP 3: Let us install user provided fonts in WINDOWS/Fonts directory for getting them accessible while creating RTF Templates. I have following available TTF fonts :

a) Copy user provided above font files in [ C:\WINDOWS\Fonts ] directory. 
b) Now let's create the normal RTF Template. I added simply all five fonts names in their respective fonts styles in the template.

STEP 4: Now let's just have PDF and HTML output format of above Template.
HTML Output:
PDF Output: 
So did you notice any difference between both two formats? Yes, right - in PDF Format we are not getting the desired output because it don't support our font and BI Publisher server is not awared of our newly installed fonts. So we need to make that server wake up about these new fonts. :|

STEP 5: Copy the same fonts files(yes same as that we copied in WINDOWS/Fonts directory !) in the directory which BI Publisher use for fonts mapping. Yes it was the very tough part to find out which directory it is. But I have already done that work for you all. It is [{ORA_HOME}\jdk\jre\lib\fonts ] directory
Note: Important but strange thing my stupid brain noticed was that directory doesn't matter. You can keep your font files anywhere in the system(except C:\WINDOWS\Fonts directory) though it is advisable to keep them in reporting server. Reason is that we need to provide the absolute path in xdo.cfg file. [I am still on the way to make them accessible without using absolute path- will let you know once will catch something better about it.]

STEP 6: Now add following entries enclosed in red colour box in xdo.cfg file available at {ORA_HOME}\xmlp\XMLP\Admin\Configuration directory path.
If suppose your fonts .TTF files are save in some other directory (Let's say I:\UsetProvidedFonts ) then you can replace C:\OraHome_1\jdk\jre\lib\fonts with I:\UsetProvidedFonts also in above file.

STEP 7: Now let's see the PDF Type output again [same manner as done in STEP 4]
So now have you all noticed , it is as expected unlike the one shown in STEP 4.

So here I end my post. Hope it helps. Feel free to fire up questions. :)

P.S. {ORA_HOME} used in entire post is the home directory where Oracle BI Publisher is installed for e.g. in my machine it is C:\OraHome_1