IBM FileNet P8, Version 5.2.1            

Configuring DITA Open Toolkit for support of Japanese content

To support Japanese content, you must configure DITA Open Toolkit to use fonts that generate Japanese characters. You must select the desired font and integrate it with the DITA Open Toolkit.

About this task

Note: The following configuration steps are based on DITA Open Toolkit 1.4.3 that uses the FOP plug-in for PDF.

Procedure

The following example shows the procedure to add the MS Gothic True Type font. However, you can replace MS Gothic True Type with the font that best suits your needs.

  1. Modify DITA_HOME\demo\fo\build.xml to support Japanese characters:

    Change from:

    <property name="document.locale" value="en_US" />

    To:

    <property name="document.locale" value="ja_JP" />
  2. Generate a font metrics XML file from the True Type font that you will use. The following example uses msgothic.ttc to generate a font metrics file msgothic.xml under the fonts directory:
    cd DITA_HOME\demo\fo\fop
    mkdir fonts 
    java -cp build\fop.jar;lib\avalon-framework-4.2.0.jar;lib\commons-logging-1.0.4.jar;lib\commons-io-1.3.1.jar;lib\xmlgraphics-commons-1.3.1.jar org.apache.fop.fonts.apps.TTFReader -ttcname "MS Gothic" C:\WINDOWS\Fonts\msgothic.ttc fonts\msgothic.xml

    Because msgothic.ttc is a True Type Collection, use the -ttcname option to specify which font in the collection you are using.

  3. Modify the font metrics file generated by the previous step. Replace existing values for font-name, full-name and family-name with MSGothic.
    Remember: Do not change the value of the ttc-name element.
  4. Modify DITA_HOME\fo\fop\conf\fop.xconf and add the following XML (replace hard-coded paths as needed). The XML must be placed within the <fonts></fonts> tags.
    <fonts> 
    :
    <font metrics-url="file:///C:/sccs/DITA-OT1.4.3/demo/fo/fop/fonts/msgothic.xml" embed-url="file:///C:/WINDOWS/Fonts/msgothic.ttc" kerning="yes">
    <font-triplet name="MSGothic" style="normal" weight="normal"/>
    <font-triplet name="MSGothic" style="normal" weight="bold"/>
    <font-triplet name="MSGothic" style="italic" weight="normal"/>
    <font-triplet name="MSGothic" style="italic" weight="bold"/>
    </font>
  5. Customize the fonts and globalization of FO output under the Customization directory. First, copy the system font-mappings.xml file to the customization directory.
    cd DITA_HOME\demo\fo\Customization
    copy ..\cfg\fo\font-mappings.xml .\fo\

    Open fo\font-mappings.xml and modify all references to char-set Japanese such that the font-face value is MSGothic

    <physical-font char-set="Japanese">
    <font-face>MSGothic</font-face>
    </physical-font>
  6. Modify fo\i18n\ja_JP.xml to include the character range of your selected font.
    cd DITA_HOME\demo\fo\Customization
    copy ..\cfg\fo\i18n\ja_JP.xml .\fo\i18n\
    Open fo\i18N\ja_JP.xml to expand the character range for non-kanji characters.
    <alphabet char-set="Japanese"> 
    <character-set>
    :
    <character-range>
    <start include="yes">&#x2160;</start>
    <end include="yes">&#x21AF;</end>
    </character-range>
    <character-range> 
    <start include="yes">&#x2460;</start>
    <end include="yes">&#x24EF;</end>
    </character-range>
    <character-range>
    <start include="yes">&#xFF00;</start>
    <end include="yes">&#xFFEF;</end>
    </character-range>
    <!-- DOUBLE VERTICAL LINE / PARALLEL TO -->
    <character>&#x2225;</character>
    </character-set>
    </alphabet>
  7. Enable the customization code:
    cd DITA_HOME\demo\fo\Customization
    copy catalog.xml.orig catalog.xml
  8. Open the catalog.xml file and uncomment the following two lines for font mappings and Japanese globalization.
    <uri name="cfg:fo/font-mappings.xml" uri="fo/font-mappings.xml"/>
    <uri name="cfg:fo/i18n/ja_JP.xml" uri="fo/i18n/ja_JP.xml"/>

Results

The DITA Open Toolkit is now configured to support the MSGothic Japanese character font.



Last updated: October 2015
pub_install_rendition_engine_server005.htm

© Copyright IBM Corporation 2015.