Generic Font for Chinese Characters

This section provides a tutorial example on using XSL-FO generic font for Chinese characters. Apache FOP AWT output works. But PDF output failed, because the mapped font Helvetica does not support Chinese characters.

In previous tutorials, we learned that XSL-FO supports generic font families to allow XSL processors to map them to specific font families. We also learned that not all font families can support all characters in all languages.

In this tutorial, let's if XSL processors are smart to map generic fonts to appropriate specific fonts.

Here is my tutorial example,, that uses generic font "sans-serif" for some Chinese characters:

<?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="sans-serif" font-weight="bold">

If you process this example XSL-FO document with Apache FOP tool on AWT screen, you will see Chinese characters are nicely formatted:

Generic Font for Chinese - FOP AWT Output

But if you process this example XSL-FO document with Apache FOP tool to generate a PDF file, you will get warnings:

C:\herong>\fop\fop -fo
   -pdf Generic-Font-for-Chinese-Characters_fop.pdf
... processEvent
WARNING: Glyph "?" (0x4e03) not available in font "Helvetica-Bold".
WARNING: Glyph "?" (0x5de7) not available in font "Helvetica-Bold".
WARNING: Glyph "?" (0x677f) not available in font "Helvetica-Bold".

And here is how the PDF page look like:

Generic Font for Chinese - FOP PDF Output


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

 What Is a Font?

 Font Attributes and Generic Fonts

 Adobe PDF Base-14 Fonts

Generic Font for Chinese Characters

 Apache FOP Font Configurations

 RenderX XEP Font Configurations


 PDF Printing Version