Using SimHei Font for Chinese Characters

This section provides a tutorial example on how to use SimHei font family to support Chinese characters with Apache FOP.

In the last tutorial, we learned that Apache FOP can be configured to auto-detect fonts from Windows system. That means we can use any fonts that are available on Windows system.

Now let's see if we can find and use Windows font to support Chinese characters.

1. Run Windows Character Map tool to find a font that support Chinese characters:


2. On the Character Map window, select "SimHei" from the font dropdown list. Then scroll down on the character list to confirm Chinese characters are supported.

3. Use the following tutorial example,, to try it:

<?xml version="1.0" encoding="utf-8"?>
 - Copyright (c) 2016,, All Rights Reserved.
<fo:root xmlns:fo="">
  <fo:simple-page-master master-name="page" 
   margin="0.1in" page-height="4.4in" page-width="3.4in">
   <fo:region-body region-name="body"/>
 <fo:page-sequence master-reference="page">
  <fo:flow flow-name="body" font-size="10pt">
<fo:block margin-top="6pt">English letters:
 <fo:inline background-color="#ffddff" 
  font-family="sans-serif" font-weight="bold">
The tangram is a dissection puzzle consisting of seven flat shapes, 
called tans, which are put together to form shapes.
<fo:block margin-top="6pt">Chinese characters:
 <fo:inline background-color="#ffddff" 
  font-family="SimHei" font-weight="bold">

If you process this example XSL-FO document with Apache FOP tool to generate a PDF file, you will see a warning:

... processEvent
WARNING: Font "SimHei,normal,700" not found. 
Substituting with "SimHei,normal,400".

... processEvent
INFO: Rendered page #1.

Not too bad. FOP could not find SimHei 700 (bold). But it found SimHei 400 and used it instead. The PDF output is acceptable as shown below:

Apache FOP Output with SimHei Chinese Font

Last update: 2016.

Table of Contents

 About This XSL-FO Tutorial Book

 Introduction of XSL-FO

 Apache™ FOP (Formatting Objects Processor)

 RenderX XEP as an XSL-FO Tool

 Introduction of Area Model

 XSL-FO Document Basics and Examples

 Page Layout Masters

 Block-Level Formatting Objects

 Inline-Level Formatting Objects

 Including Graphics in XSL-FO document

 Table of Rows and Columns

 List, Item, Label, and Body

 Floating Blocks - "float" and "footnote"

 Hyperlinks, Table of Contents and Indexes

 Headers and Footers using "static-content"

 Font Attributes and Font Families

Apache FOP Font Configurations

 FOP Auto-Detecting Fonts

Using SimHei Font for Chinese Characters

 RenderX XEP Font Configurations


 PDF Printing Version