[XeTeX] fontspec and a single font for multiple scripts

Khaled Hosny khaledhosny at eglug.org
Wed Aug 18 13:47:33 CEST 2010

On Wed, Aug 18, 2010 at 01:31:18PM +0200, Volker Haas wrote:
> Hi list,
> is it possible to use a single font for multiple scripts with
> fontspec without doing any font switching or altering font features?

No, you have to define operate font instance with appropriate option for
each script.

> The below sample code fails (it renders, but either bengali, latin
> or arabic is not rendered correctly):
> \documentclass[a4paper,12pt]{article}
> \usepackage{fontspec}
> \setmainfont[Script=Bengali,Script=Latin,Script=Arabic]{FreeSerif}
> \begin{document}
> যুক্তব্যঞ্জন the 1. item العربية
> \end{document}

"Script" does not accept multiple arguments, so the above is the same as
just saying "Script=Arabic". Even if this worked, you still need to mark
each text to get proper hyphenation and directionality.

So, you have to define a new font family for each script, combine it
with hyphenation loading and switching, and/or direction setting. In
short, you should try polyglossia instead.
> Any help would be appreciated. The fontspec manual and a web search
> weren't helpful so far.
> On a side note: With the latest fontspec version (2.0c) the arabic
> script is used in the above example. When using fontspec 1.18 from
> texlive 2009 bengali is used.

It is likely related on how options are parsed.


 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer

More information about the XeTeX mailing list