This is a documentation subpage for Template:Script/Arabic. It may contain usage information, categories and other content that is not part of the original template page. |
This template is to render properly Arabic-based scripts which don't use the main Arabic alphabet, also to ensure that Arabic diacritics appear properly.
style
parameter can be used to override the generated style (for example another font size) or to specify additional CSS formattings (e.g. color).attributes
parameter can be used for specifying additional HTML attributes (for example a descriptive title="..."
).Use simple ((lang|ar|...)) for inline citation of Arabic language. Use ((rtl-para)) for entire paragraphs of Arabic text, however, they do not force choosing the fonts in that template.
The template contains this phrase:
<span class="script-arabic script-Arab" dir="rtl" style="font-family:Scheherazade,Lateef,'Droid Arabic Naskh',Amiri,'Arabic Transparent',Arial,'Microsoft Sans Serif','Segoe UI','Sakkal Majalla','Microsoft Uighur','Arabic Typesetting',sans-serif,serif; font-size: 125%; font-weight: normal; (({style|))}" (({attributes|))}>(({1))}</span>‎
font-weight: normal
is present to remove boldness, e.g. in section titles, because Arabic diacritics are best read only in normal weight, but also because some fonts do not exist in bold styles; without it, other fallback fonts would be used instead (possibly with lover coverage), or boldness may be synthetized from a non-bold font (making most diacritics unreadable).dir="rtl"
in a span
HTML element is sufficient to also activate on Wikipedia the unicode-bidi: embed
style which is part of the site-wide CSS stylesheet; this HTML attribute also activates the CSS style "direction: rtl" (which should be implemented by default in browsers, but is also set in the site-wide CSS stylesheet).Template intended to force following fonts if installed:
These fonts contain all Arabic character defined in Arabic Unicode for text in the various languages that use the Arabic script, but not all the redundant glyphs used in stylizing.
If the previous fonts are not installed, other fallback fonts would display:
Any user can use another font with a different size by writing the following on his custom CSS. (see Help:User style)
An example making the font size 105%, and choosing Droid Arabic Naskh to be the main font with Arial as an additional font :
.script-arabic {
font-size: 105% !important;
font-family: 'Droid Arabic Naskh', Arial, sans-serif !important;
}
'
or "
.line-height: 125%;
Remember to put it before the }. The more number percentage, the more space is added. If you wanted to decrease the line height spacing, decrease the percentage. You may use any number (e.g. 85% or 140%) or use the special value "normal" which will properly use the minimum setting of the line-height recommended by each candidate font.Example:
.script-arabic {
font-size: 175% !important;
/*
The default line-height used by Wikipedia is 1.5 em, which can be lower or higher than the font default,
reduce it to the minimum recommended for HTML by using the word normal or for example, use a percentage
value, as 95%
*/
line-height: 95%;
font-family:
/* The following fonts are recommended for best coverage fo the Arabic script: */
Scheherazade, Lateef, 'Droid Arabic Naskh' /* free fonts */
'Sakkal Majalla', /* commercial font, also installed with recent versions of Windows */
'Microsoft Uighur', 'Arabic Typesetting', /* commercial fonts installed with recent versions of Windows */
/* Other fonts supporting the Arabic script with partial coverage: */
'Arabic Transparent', /* Warning! Old versions may not support a few characters. */
Arial, /* Warning! Old versions may not support a few characters. */
'Times New Roman', /* Warning! Old versions may not support a few characters. The newest version doesn't join one of the Arabic characters properly */
/* Default fallback fonts determined in the browser: */
sans-serif /* No comma here! */
/* Required at end to actually enable the override and make it work : */
!important;
}
The same example without the notes:
.script-arabic {
font-size: 175% !important;
line-height: 95%;
font-family: Scheherazade, Lateef, 'Droid Arabic Naskh', 'Sakkal Majalla', 'Microsoft Uighur',
'Arabic Typesetting', 'Arabic Transparent', Arial, 'Times New Roman', sans-serif !important;
}