PDF Fonts for Non-English Platforms

PDF Font Support for Languages

The MATLAB® Report Generator™ supports a wide range of English language fonts for PDF reports.

The MATLAB Report Generator also provides basic PDF font support for some non-English languages, including:

  • Japanese

  • Korean

  • Russian (Cyrillic)

You can use the language font map to:

  • Add or modify specifications for PDF font usage for supported non-English languages.

  • Create PDF font support for a non-supported language.

  • Change the default English fonts, if you do not specify a stylesheet.

The language font map specifications indicate what font to use on a specific platform (for example, Windows®) for basic report elements such as body text.

Identifying When to Specify a Font

If a required non-English font is missing for a report, the generated text includes pound sign characters (#). For example:

Stylesheets Override PDF Font Mapping

PDF stylesheets for the MATLAB Report Generator specify fonts for body text, copyright, quotes, symbols, dingbats, monospace, sans serif, and titles.

The PDF stylesheet settings override the PDF font mapping entries.

If you do not specify a PDF stylesheet, then you can use PDF language font mapping entries to change the default fonts for English reports.

Non-English PDF Font Mapping Tasks

To add or modify non-English PDF font mapping specifications:

lang_font_map.xml File

Use an XML editor with the lang_font_map.xml file to enter all the PDF font mappings for your reports.

Installing the MATLAB Report Generator software loads the lang_font_map.xml file in the following location:


The lang_font_map.xml file includes two sections:

  • name_map — Contains name_mapping elements that specify the name of the font, the language, and the font usage in the report (for example, body text).

  • file_map— Contains entries for the location of the font files for the fonts specified in the name_map.

For example, the following lang_font_map.xml file includes name_map and file_map entries that provide basic PDF font support for Japanese (ja), Korean (ko), and Russian (ru).

 lang_font_map.xml example

Locate Non-English Fonts

The system from which you generate a report using the language font map must have access to the appropriate non-English fonts.

Use one of these font formats for non-English font support:

  • Type 1 (PostScript®)

  • TrueType

  • OpenType®

Fonts in other formats, such as bitmap fonts for the X Window System (X11), produce poor MATLAB Report Generator report output.

Some TrueType fonts are grouped into packages called TrueType Collections. To specify a collection in the language font map file, specify the individual font within the TrueType Collection.

In addition to the font name, the weight (e.g., bold) and slant (e.g., italic, oblique) may distinguish one font from another in the same family.

The approach you use to identify font names depends on your computer platform.

 Font names on Windows

 Font names on Mac OS X

 Font names on Linux

Add or Modify Language Font Mappings

In the name_map section of the lang_font_map.xml file, add a separate name_mapping entry for each combination of language, font, and usage that you want in PDF reports.

Each name_mapping element has three attributes:

  • lang specifies the two letter ISO 639-1 code corresponding to the language of the report.

  • platform specifies the operating system platform:

    • win — Windows

    • mac — Mac OS X

    • glnx— Linux

  • usage specifies the kind of report element or font:

    • body

    • title

    • monospaced

    • sans (sanserif)

The text of the name_mapping element is a font name, as specified in an XSL-FO stylesheet.

Here is an example name_mapping entry:

<name_mapping_lang="ja" platform="win" usage="body">MS Gothic</name_mapping>

Specify the Location of Font Files

In the file_map section, add a file_mapping entry that identifies the location of the font file for each font that you include in the name_map section.

Each of the platforms (Windows, Mac, and Linux) has a different default search path for fonts. If the lang_font_map.xml file does not contain a full file path for a font, the MATLAB Report Generator uses a platform-specific approach to search for the font.

 Windows Font File Locations

 Mac Font File Locations

 Linux Font File Locations

Was this topic helpful?