7.12. Add-on options

7.12.1. Apache FOP options

The "FOP" preferences sheet is available only when add-on "Apache FOP 1.x XSL-FO processor plug-in" has been installed.

Figure 9.7. The "FOP" preferences sheet
The "FOP" preferences sheet

By default, only the 14 built-in fonts: Times, Helvetica, Courier, Symbol and ZapfDingbats are used in the generated PDF. The above preferences sheet allows to specify which custom TrueType (.ttf) fonts are to be embedded in the generated PDF.

This facility is useful in the following two cases:

  • The 14 PDF standard fonts (Helvetica, Times, Courier, etc), which are used by default by FOP, have glyphs only for the Western languages. If, for example, you convert a DocBook document written in Russian to PDF, the generated PDF will mainly contain the '#' placeholder character. Fortunately, widely available TTF fonts such as Microsoft® Arial, Times New Roman and Courier New or the DejaVu fonts have glyphs for almost all the languages of the world.

  • Use fonts nicer than the 14 PDF standard fonts.

Procedure 9.1. How to use Times New Roman, Arial and Courier New instead of Times, Helvetica, Courier
  1. Click Use Windows® standard fonts.

    Note that the Use Windows® standard fonts button is grayed if the Arial font is not found in the standard fonts folder of your system.

  2. Click OK.

  3. Restart XMLmind XML Editor.

Procedure 9.2. How to choose specific fonts (for example, you want to replace Times fonts by Georgia fonts)
  1. Click Add.

    This displays the following dialog box:

    Figure 9.8. The "Choose a TTF font and specify its aliases" dialog box
    The "Choose a TTF font and specify its aliases" dialog box
    1. Choose the .ttf file containing font "Georgia".

      [Tip]

      On Windows, for permissions reasons, there is no way to pick a font file from the "C:\Windows\Fonts\" folder using the standard file chooser. Therefore the only way to register with Apache FOP a font found in "C:\Windows\Fonts\" is to drag its file from the Windows file manager and to drop it onto the list found in the "FOP" preferences sheet (see above figure).

      However, after you do this, do not forget to select each entry added by the drop action and then click Edit to possible change or complement what's have been automatically specified there.

    2. Specify the following alias: serif.

    3. Click OK.

  2. Click Add.

    1. Choose the .ttf file containing font "Georgia Bold".

    2. Specify the following alias: serif, Bold.

    3. Click OK.

  3. Click Add.

    1. Choose the .ttf file containing font "Georgia Italic".

    2. Specify the following alias: serif, Italic.

    3. Click OK.

  4. Click Add.

    1. Choose the .ttf file containing font "Georgia Bold Italic".

    2. Specify the following alias: serif, Bold, Italic.

    3. Click OK.

  5. Click OK.

    Doing this automatically creates a standard FOP configuration file in XXE_user_preferences_dir/fop/fop.conf. User preferences directory XXE_user_preferences_dir is documented in Section 7, “The "Preferences" dialog box”.

  6. It is recommended to repeat the above steps in order to specify fonts replacing Helvetica, that is, fonts having a sans-serif alias and fonts replacing Courier, that is fonts having a monospace alias.

  7. Restart XMLmind XML Editor.

[Tip]Using in XXE an existing FOP configuration file

The location of an existing FOP configuration file may be specified to XXE by the means of Java™ system property or environment variable XXE_FOP_CONFIG. The value of this variable is an URL or an absolute file path. Examples: -DXXE_FOP_CONFIG=http://localhost/~john/fop/fop.conf (Java™ system property), set XXE_FOP_CONFIG=C:\Users\john\misc\fop\fop.conf (Windows environment variable).

7.12.2. RenderX XEP options

The "XEP" preferences sheet is available only when add-on "RenderX XEP XSL-FO processor plug-in" has been installed.

XEP preferences are identical to FOP preferences. There are two minor differences though:

  • Some fonts have licensing restrictions that forbid embedding them in a PDF file. RenderX XEP enforces these licensing restrictions, not Apache FOP. XMLmind XML Editor has currently no way to detect these licensing restrictions, therefore you may follow the above procedure and end up with glyphs still missing in the generated PDF.

  • The standard XEP configuration file is created in XXE_user_preferences_dir/xep/xep.conf.

[Tip]Using in XXE an existing XEP configuration file

The location of an existing FOP configuration file may be specified to XXE by the means of Java™ system property or environment variable XXE_XEP_CONFIG. The value of this variable is an URL or an absolute file path. Examples: -DXXE_XEP_CONFIG=http://localhost/~john/xep/xep.conf (Java™ system property), set XXE_XEP_CONFIG=C:\Users\john\misc\xep\xep.conf (Windows environment variable).

7.12.3. Text format options

Figure 9.9. The "Text format" preferences sheet
The "Text format" preferences sheet
Open as plain text

Specifies the suffixes of the files that should be opened by XXE as plain text files (that is, not XML files). A file suffix is case insensitive. If a suffix does not start with a dot (e.g. "makefile") then this “suffix” is considered to a file base name and not a file suffix.

Text encoding

Specifies the text encoding (e.g. Windows-1252 on Windows for a Western PC) to use when saving a plain text file to disk.

Notes:

  • Choosing "(Same as in original file)" implies also saving the original Byte Order Mark (BOM) if a one was there when opening the text file in XXE.

  • Special values UTF-16BE_BOM, UTF-16LE_BOM and UTF-8_BOM mean: save the text file to disk using respectively the UTF-16BE, UTF-16LE and UTF-8 encodings and also add the corresponding BOM when doing so.

[Important]

This preference is ignored when an encoding directive is found at the beginning of the text file to be saved.

For example, this CSS stylesheet will always be saved using encoding "ISO-8859-1":

@charset "iso-8859-1";

body {
    font-family: sans-serif;
}

Other example, this Markdown file will always be saved using encoding "ISO-8859-1":

<!-- -*- coding: iso-8859-1 -*- -->

Heading
=======

## Sub-heading

Paragraphs are separated
by a blank line.

(The above example works because XXE understands the GNU Emacs file variable called "coding".)

Line separator

Specifies the line separator (e.g. CR+LF, that is, "\r\n" , on Windows) to use when saving a plain text file to disk.

7.12.4. JSON format options

Edit JSON as Text or XML

If Text is selected, the JSON format add-on is made inactive and JSON files are treated by XXE as plain text files.

If XML is selected, the JSON format add-on is actived and JSON files are treated by XXE as if they were XML files.

[Note]

The XML representation of JSON used by the JSON format add-on is documented in "JSONx, an XML Encoding for JSON".

JSON file indentation

Specifies the line indentation used when saving JSON files. The recommended indentation for JSON files is 4 space characters. Value 0 means no indentation at all, resulting in a compact JSON file containing a single line of text.

[Note]
  • A JSON file has a ".json" filename suffix and is encoded in UTF-8 or UTF-16.

  • The JSON format add-on always uses the UTF-8 encoding when saving JSON files to disk.