\usepackage{fontspec,xunicode}
%% VERY IMPORTANT. Configures supported languages and fonts to use for each one.
\usepackage[Latin, Hebrew, Arabics, CJK, Diacritics]{ucharclasses}
+\newfontfamily\arabfont{FreeSerif}[Script = Arabic]
+\newfontfamily\hebrewfont{FreeSerif}[Script = Hebrew]
\newfontfamily{\normalfont}[Ligatures=TeX]{FreeSerif}
\newfontfamily{\cjkfont}{WenQuanYi Zen Hei}
\setDefaultTransitions{\normalfont}{}
\setTransitionsForLatin{\normalfont}{}
-\setTransitionsForArabics{\normalfont}{}
+\setTransitionsForArabics{\arabfont}{}
\setTransitionsForCJK{\cjkfont}{}
\setTransitionsForDiacritics{\normalfont}{}
-\setTransitionTo{Hebrew}{\normalfont}
+\setTransitionTo{Hebrew}{\hebrewfont}
\setmainfont{FreeSerif}
\newcommand{\fsfclosing}[1]{\par\nobreak\vspace{\parskip}