0

I have to write, in the front page of a document, and in other pages, sentences written in english, in the font "Times new roman", and sentences written in Arabic, in the font "Traditional Arabic", in several sizes, 14,16,18,22... What is the best way to do that?

I use the polyglossia package, and compile texts with XeLaTeX.

I give here some own tries and remarks about this task. Note that (I think that!) one can use the font he/she has.

Here is the .tex file:

\documentclass[12pt]{book}

\usepackage{polyglossia}

\setdefaultlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}

\setmainfont{Traditional Arabic}
\newfontfamily\englishfont{Times New Roman}

\begin{document}

\pagestyle{empty}

\begin{english}
\noindent 
One can write multi-lingual documents, and math equations, by using the polyglossia package, and compile it with \XeLaTeX, in several sizes. The basic size is 12pt.
\end{english}
\hrule

{\centering 

\LR{Text in 14pt is obtained by using the command $\backslash$large:

{\large A latin text, in size 14 pt.}

An arabic text, in size 14 pt, is the following centered text:}

 {\large 
نص عربي في حجم 14.
}

\hrule

\LR{Text in 17pt is obtained by using the command $\backslash$Large:

{\Large A latin text, in size 17 pt.}

An arabic text, in size 17 pt, is the following centered text:}

 {\Large 
نص عربي في حجم 17.
}

\hrule

\LR{For larger sizes, we use the command, for example, $\backslash$fontsize\{18\}\{22\}, which puts the size to 18pt for arabic and english characters, but has no effect under the package polyglossia, else if we put the characters under the commands \\
$\backslash$begin\{Arabic\} ...$\backslash$end\{Arabic\}, and $\backslash$begin\{english\} ...$\backslash$end\{english\}, respectively. I give examples of compilations:

\hrule
{\fontsize{18}{22} A latin text, under the command $\backslash$fontsize\{18\}\{22\}, and outside $\backslash$begin\{english\} ...$\backslash$end\{english\}.}
\hrule

 {\fontsize{18}{22} \begin{english}
 A latin text, under the command $\backslash$fontsize\{18\}\{22\}, and $\backslash$begin\{english\} ...$\backslash$end\{english\}.
 \end{english}}
\hrule

 Arabic text, under the command $\backslash$fontsize\{18\}\{22\}, and outside $\backslash$begin\{Arabic\} ...$\backslash$end\{Arabic\}:
}

{\fontsize{18}{22}
نص عربي في حجم 18.
}

\hrule 
 \LR{ Arabic text, under the command $\backslash$fontsize\{18\}\{22\}, and $\backslash$begin\{Arabic\} ...$\backslash$end\{Arabic\}:}

{\fontsize{18}{22}
\begin{Arabic}
نص عربي في حجم 18.
\end{Arabic}}

\par}

\end{document}

and its compilation:

enter image description here

  • You have missed selecting the font (ie, \fontsize{18}{22}\selectfont). – Javier Bezos Apr 29 at 16:36
  • @JavierBezos Yes many thanks – Faouzi Bellalouna May 1 at 10:48
1

There are different ways to specify font size. It depends on what you want to do.

\fontsize could be used for particular cases not covered by the document class.

The relative size commands (tiny, small, large, Large, huge etc) are designed to keep the document design harmonious.

Package fontspec's Scale= option is very useful, I find. Plus all its other options, like specifying different fonts for different sizes with the SizeFeatures option. And many other things as well. Polyglossia very handily loads fontspec in the background.

Alternatively, you can also hard-code specific font sizes with the \font command, if you want.

Illustration shows \font commands (top) and fontspec's Scale= (and Colour=) option (bottom). Text is from the solar system Wikipedia article. Font is Times New Roman, which contains Arabic, Armenian, Cyrillic, Greek and Coptic, Hebrew, Latin and IPA scripts.

font sizes

MWE

\documentclass[12pt]{book}
\usepackage{xcolor}

\usepackage{polyglossia}
\font\ffonta="Times New Roman" at 14pt
\font\ffontb="Times New Roman" at 18pt
\font\ffontc="Times New Roman" at 24pt
\font\ffontd="Times New Roman" at 36pt
\font\ffonte="Times New Roman" at 48pt

\setdefaultlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}

%\usepackage{fontspec}
\newfontface\fgfonta[Scale=1.0,Script=Arabic,Colour=brown]{Times New Roman}
\newfontface\fgfontb[Scale=1.4,Script=Arabic,Colour=red]{Times New Roman}
\newfontface\fgfontc[Scale=2.3,Script=Arabic,Colour=green]{Times New Roman}
\newfontface\fgfontd[Scale=3.5,Script=Arabic,Colour=blue]{Times New Roman}
\newfontface\fgfonte[Scale=5.0,Script=Arabic,Colour=violet]{Times New Roman}

\setmainfont{Times New Roman}%Traditional Arabic}
\newfontfamily\englishfont{Times New Roman}

\begin{document}

\pagestyle{empty}

\begin{center}
\ffonta المجموعة الشمسية

\ffontb المجموعة الشمسية

\ffontc المجموعة الشمسية

\ffontd المجموعة الشمسية

\ffonte المجموعة الشمسية

*

\fgfonta المجموعة الشمسية

\fgfontb المجموعة الشمسية

\fgfontc المجموعة الشمسية

\fgfontd المجموعة الشمسية

\fgfonte المجموعة الشمسية


\end{center}
\end{document}
  • Sorry to review after some time, but the font commands has no effect with bold commands \bf or \textbf. Are there special sizing commands for fonts in bold too? – Faouzi Bellalouna May 8 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.