Font Mapping & Encoding

This recipe demonstrates how to Map & Encode font in both Repertoire & Ambience 3.x/4.x. This example uses the Arial font to render out the missing Superscript into a PDF output from the report template.

Notes:

  • This example uses the Arial font family.
  • Tested on Repertoire 8.8.0 & Ambience 4.6.2
  • If fonts other than Arial is used, please do ensure that the selected font supports the desired SubScripts & SuperScripts.
  • For Linux Environment, do ensure that required fonts are loaded in your system cache. (Click here for the steps to ensure that fonts have been loaded)

Initial State:
image image

Configuration steps for Repertoire:

  1. Go to Repertoire Designer config/EREngine-config.xml & add the following to <pdf-font-map> </pdf-font-map> :
   <map-encoding logical-font-name="Arial" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Regular" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Bold" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Black" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Bold Italic" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Italic" encoding="Identity-H"/>
  1. In <properties></properties>, ensure that the font path configuration points to the font path in your local machine. For e.g., <property name="elixirtech.fonts.path" value="C:\\Windows\\Fonts"/>
  2. Start Repertoire Designer and render out the report template to a PDF output.

Configuration steps for Ambience 4.x & below

Using 7-ZIP

Prerequisites:
//Uses the utility “7-ZIP”.
//To install, do refer here

  1. Go to the Ambience Server /lib directory and look for the elx-report-[version].jar file.
    (e.g. elx-report-2.11-4.6.4.jar)
  2. Open up the elx-report-[version].jar archive using 7-ZIP.
  3. Edit the elx-report-[version].jar by going into config/EREngine-config.xml and add the following to <pdf-font-map> </pdf-font-map>:
   <map-encoding logical-font-name="Arial" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Regular" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Bold" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Black" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Bold Italic" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Italic" encoding="Identity-H"/>
  1. In <properties></properties>, ensure that the font path configuration points to the font path in your local machine. For e.g., <property name="elixirtech.fonts.path" value="C:\\Windows\\Fonts"/>
  2. Make sure to save the configuration file before closing config/EREngine-config.xml.
  3. Start Ambience Designer and render out the report template to a PDF output.

Configuration steps for Ambience 4.x & below

Using Ubuntu Linux Command Line

Prerequisites:
//Uses the Command-Line utility “zip” & “unzip”.
//To install, do refer here

  1. Go to the Ambience Server /lib directory on the Linux command line.
    For example,
  2. Unzip elx-report-[version].jar (e.g. elx-report-2.11-4.6.4.jar) file by using
    $ unzip [jar_filename] -d [destination_foldername]
    For example,
    $ unzip elx-report_2.12-4.6.2.jar -d elx-report_2.12-4.6.2
  3. Edit the elx-report-[version].jar by going into config/EREngine-config.xml and add the following to > <pdf-font-map> </pdf-font-map>:
   <map-encoding logical-font-name="Arial" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Regular" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Bold" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Black" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Bold Italic" encoding="Identity-H"/>
   <map-encoding logical-font-name="Arial Italic" encoding="Identity-H"/>
  1. In <properties></properties>, ensure that the font path configuration points to the font path in >your local machine. For e.g., <property name="elixirtech.fonts.path" value="C:\\Windows\\Fonts"/>
  2. Make sure to save the configuration file before closing.
  3. Delete the initial elx-report-[version].jar in Amience Server /lib directory.
  4. Go to the /[destination_foldername] directory on the command line.
    For example,
  5. Zip the contents back into a .jar file using zip -r [jar_filename].jar ./*
    For example,
    $ zip -r elx-report_2.12-4.6.2.jar ./*
  6. Move the .jar file over to Ambience Server /lib.
  7. Start Ambience Designer and render out the report template to a PDF output.

Final Output:
image image

Report Template can be downloaded here:
Superscript.zip (47.2 KB)

PDF Template Reference:
Initial.pdf (26.4 KB)
Final.pdf (22.9 KB)