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}

Edited to add: Boldface, using font family, instead of font face:

MWE

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

\usepackage{polyglossia}

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

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

\setmainfont{Noto Naskh Arabic}
\newfontfamily\englishfont{Times New Roman}

\begin{document}

\pagestyle{empty}

\begin{center}

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

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

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

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

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

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

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

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


\end{center}
\end{document}

boldface

Edited to add:

Using two font declarations, same scale but different colours, the kern and llap commands give an interesting effect.

kern and llap

Added: Regular and Boldface example:

Bold

MWE:

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

\usepackage{polyglossia}

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

\newfontfamily\fgfontc[Scale=2.3,Script=Arabic,Colour=green]{Traditional Arabic}
\newfontfamily\fgfontck[Scale=2.3,Script=Arabic,Colour=blue]{Traditional Arabic}\newfontfamily\fgfontd[Scale=4.5,Script=Arabic,Colour=red]{Traditional Arabic}
\newfontfamily\fgfontdk[Scale=4.5,Script=Arabic,Colour=blue]{Traditional Arabic}

\setmainfont{Traditional Arabic}
\newfontfamily\englishfont{Noto Serif}

\begin{document}

\pagestyle{empty}

\begin{center}


\begin{english}
Traditional Arabic font,\\
with \textbackslash kern and \textbackslash llap \\ commands. \\ \ \\
\end{english}

\fgfontc المجموعة الشمسية\kern-1.25pt\llap{\fgfontck المجموعة الشمسية}


\fgfontd المجموعة الشمسية\kern-1.45pt\llap{\fgfontdk المجموعة الشمسية}

\end{center}

\begin{english}
Traditional Arabic font, regular and bold:
\end{english}


ححح خخخ ههه ععع غغغ ففف ىىى لالالا ششش صصص 

\bfseries
ححح خخخ ههه ععع غغغ ففف ىىى لالالا ششش صصص 

\mdseries\Large
ححح خخخ ههه ععع غغغ ففف ىىى لالالا ششش صصص 

\bfseries
ححح خخخ ههه ععع غغغ ففف ىىى لالالا ششش صصص 


\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
  • @FaouziBellalouma, Use a font family that contains bold face, e.g., Noto Naskh Arabic. – Cicada Aug 18 at 12:42
  • How can I know that a font uses bold face..? I must use Traditional arabic in arabic and Times new roman in english – Faouzi Bellalouna Aug 18 at 22:31
  • In Windows (c:\windows\fonts), Times New Roman family is made up of four faces: Times New Roman Bold (timesbd.ttf), Times New Roman Bold Italic (timesbi.ttf), Times New Roman Italic (timesi.ttf), Times New Roman Regular (times.ttf); and Traditional Arabic family has two faces: Traditional Arabic (tradbdo.ttf) and Traditional Arabic Regular (trado.ttf). – Cicada Aug 19 at 13:42
  • So as I understand, your commands can't be used in bold with the Traditional Arabic font. Isn't it ? – Faouzi Bellalouna Aug 19 at 14:38

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.