Frank D. wrote:


The Japanese agency which translates my English DITA source files to
Japanese is looking for a tool which facilitates proofreading the
translation. Until now it was always me who generated a PDF file for
this purpose, but now they want to do it themselves in order to save time.

They do not seem to have any DITA expertise and are therefore looking
for a quick-and-easy low-cost method which provides acceptable results
(they need not look nice) without any difficult customization.

I tried XMLmind (ditac) and was surprised about the good results
produced out of the box. However, this applies to the English files
only. When I process the Japanese DITA files, all characters are
rendered as "#######". So the result is unusable.

Yes. That's right.




I have consulted the XMLmind documentation for help on command line
parameters, but could not find a solution. I added the parameter -p
body-font-family "Kozuka Mincho Pr6N L", for example, but this does not
have any effect.

This is normal. Font "Kozuka Mincho Pr6N L" is indeed referenced in the XSL-FO intermediate format but is still not known/declared/made available to the XSL-FO processor (e.g. Apache FOP when generating PDF).

See below.






What do I have to do to make XMLmind render Japanese characters correctly?



This is really an issue related to the PDF format.

PDF comes with its 14 built-in fonts: Times, Helvetica, Courier, Symbol and ZapfDingbats. These fonts have glyphs only for the western (AKA Latin1) languages. Therefore you need to substitute to these built-in fonts truly some fonts having glyphs for both Western and Japanese characters. An example of such multilingual font is "Arial Unicode Sans".

By default, ditac uses only logical fonts: "serif", "sans-serif", "monospace", etc.

By default, the XSL-FO processor generating PDF (e.g. Apache FOP) maps these logical fonts to PDF built-in fonts: Times, Helvetica, Courier, etc.

You need to replace this stock font map by a custom font map mapping all the logical fonts to your favorite multilingual fonts.

This font mapping is done in a FOP configuration file (assuming that you use FOP to generate PDF).

FOP documentation found here: https://xmlgraphics.apache.org/fop/2.3/configuration.html

Sample configuration file mapping most logical fonts to "Times New" Roman, Arial and "Courier New" attached to this email. (You may want to modify this sample file.)



--> Let's suppose you saved your FOP config file "fop.conf" to "/home/frank/tmp/"

Let's suppose you have downloaded http://www.xmlmind.com/ditac/_download/ditac-3_3_1-plus-fop.zip (which includes FOP 2.3) and installed it to "/home/frank/ditac-3_3_1/"

You must then add this option (to your other command-line option options) when running ditac to convert DITA to PDF:

-foconverter FOP pdf '/home/frank/ditac-3_3_1/plus/fop-2.3/fop/fop -c /home/frank/tmp/fop.conf -q -r -fo "%I" -pdf "%O"'

This option reads: use the FOP bundled with ditac, but with my "/home/frank/tmp/fop.conf" configuration file.

More information here: http://www.xmlmind.com/ditac/_distrib/doc/manual/commandLine.html#commandLine__option-foconverter

(Adapting the above FOP invocation to Windows is left as an exercise ; do not forget replace final "/fop" by "\fop.bat". Alternate, recommended, solution add this option once for all to a ditac option file: http://www.xmlmind.com/ditac/_distrib/doc/manual/commandLine.html#commandLine__ditac_options_file)



==========================================================================
NOTE:

We have Japanese customers who use ditac, but always in the context of XMLmind XML Editor. A FOP configuration file can be very easily created from within XMLmind XML Editor using a dialog box.

See this FAQ:
---
When I convert documents written in Russian (or Polish or Czech or any non-western language) to PDF, almost all characters are replaced by the "#" character. Is there a workaround for this problem?
---
http://www.xmlmind.com/xmleditor/faq.html#custom_pdf_fonts

Download Personal Edition from: http://www.xmlmind.com/xmleditor/download.shtml
==========================================================================








<?xml version="1.0"?>
<fop>
  <renderers>
    <renderer mime="application/pdf">
      <fonts>
        <font embed-url="file:/usr/share/fonts/truetype/arial.ttf"
              kerning="yes">
          <font-triplet name="Arial" style="normal" weight="normal"/>
          <font-triplet name="sans-serif" style="normal" weight="normal"/>
        </font>
        <font embed-url="file:/usr/share/fonts/truetype/arialbd.ttf"
              kerning="yes">
          <font-triplet name="Arial" style="normal" weight="bold"/>
          <font-triplet name="sans-serif" style="normal" weight="bold"/>
        </font>
        <font embed-url="file:/usr/share/fonts/truetype/arialbi.ttf"
              kerning="yes">
          <font-triplet name="Arial" style="italic" weight="bold"/>
          <font-triplet name="sans-serif" style="italic" weight="bold"/>
        </font>
        <font embed-url="file:/usr/share/fonts/truetype/ariali.ttf"
              kerning="yes">
          <font-triplet name="Arial" style="italic" weight="normal"/>
          <font-triplet name="sans-serif" style="italic" weight="normal"/>
        </font>
        <font embed-url="file:/usr/share/fonts/truetype/cour.ttf"
              kerning="yes">
          <font-triplet name="Courier New" style="normal" weight="normal"/>
          <font-triplet name="monospace" style="normal" weight="normal"/>
        </font>
        <font embed-url="file:/usr/share/fonts/truetype/courbd.ttf"
              kerning="yes">
          <font-triplet name="Courier New" style="normal" weight="bold"/>
          <font-triplet name="monospace" style="normal" weight="bold"/>
        </font>
        <font embed-url="file:/usr/share/fonts/truetype/courbi.ttf"
              kerning="yes">
          <font-triplet name="Courier New" style="italic" weight="bold"/>
          <font-triplet name="monospace" style="italic" weight="bold"/>
        </font>
        <font embed-url="file:/usr/share/fonts/truetype/couri.ttf"
              kerning="yes">
          <font-triplet name="Courier New" style="italic" weight="normal"/>
          <font-triplet name="monospace" style="italic" weight="normal"/>
        </font>
        <font embed-url="file:/usr/share/fonts/truetype/times.ttf"
              kerning="yes">
          <font-triplet name="Times New Roman" style="normal" weight="normal"/>
          <font-triplet name="serif" style="normal" weight="normal"/>
        </font>
        <font embed-url="file:/usr/share/fonts/truetype/timesbd.ttf"
              kerning="yes">
          <font-triplet name="Times New Roman" style="normal" weight="bold"/>
          <font-triplet name="serif" style="normal" weight="bold"/>
        </font>
        <font embed-url="file:/usr/share/fonts/truetype/timesbi.ttf"
              kerning="yes">
          <font-triplet name="Times New Roman" style="italic" weight="bold"/>
          <font-triplet name="serif" style="italic" weight="bold"/>
        </font>
        <font embed-url="file:/usr/share/fonts/truetype/timesi.ttf"
              kerning="yes">
          <font-triplet name="Times New Roman" style="italic" weight="normal"/>
          <font-triplet name="serif" style="italic" weight="normal"/>
        </font>
      </fonts>
    </renderer>
  </renderers>
</fop>
--
XMLmind DITA Converter Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/ditac-support

Reply via email to