编辑“︁
Template:Script/Arabic/doc
”︁
跳转到导航
跳转到搜索
这是
Script/Arabic
模板的
文档页面
。
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
{{Documentation subpage}} {{High-use}} {{Uses TemplateStyles|Template:Script/styles arabic.css}} <div style="float:right">__TOC__</div>__NOTOC__ 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. It is also used for the [[template:Arabic alphabet shapes]]. == Usage == : <nowiki>{{Script/Arabic|موسوعة}}</nowiki> to give you {{Script/Arabic|موسوعة}} * The 1st parameter is mandatory and contains the text written in the Arabic script. * The optional <code>style</code> parameter can be used to override the generated style (for example another font size) or to specify additional CSS formattings (e.g. color). * The optional <code>attributes</code> parameter can be used for specifying additional HTML attributes (for example a descriptive <code>title="..."</code>). Use simple <nowiki>{{lang|ar|...}}</nowiki> for inline citation of Arabic language. Use {{tl|rtl-para}} for entire paragraphs of Arabic text, however, they do not force choosing the fonts in that template. == Implementation == The template contains this phrase: <syntaxhighlight lang="wikitext"><templatestyles src="Script/styles_arabic.css" /><span class="script-arabic script-Arab" {{#if:{{{lang|}}}|lang="{{{lang}}}"}} {{#ifeq: {{{no_rtl_mark|+}}} | {{{no_rtl_mark|-}}}||dir="rtl"}} style="font-size: {{{size|125%}}}; {{{style|}}}" {{{attributes|}}}>{{{1}}}</span>{{#ifeq: {{{no_rtl_mark|+}}} | {{{no_rtl_mark|-}}}||‎}}</syntaxhighlight> * The font size was fixed at 125% for better readability. * The style <code>font-weight: normal</code> is provided by [[Template:Script/styles arabic.css]] and 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). * Specifying the HTML attribute <code>dir="rtl"</code> in a <code>span</code> HTML element is sufficient to also activate on Wikipedia the <code>unicode-bidi: embed</code> 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). This attribute can be disabled via {{para|no_rtl_mark}} with value <code>+</code> or <code>-</code> if necessary. === Fonts information === ;Free fonts: Template intended to force following fonts if installed: *[http://software.sil.org/scheherazade Scheherazade New] or [https://software.sil.org/scheherazade/download/previous-versions/ Scheherazade] *[http://software.sil.org/lateef Lateef] <small>(lacks a bold weight)</small> *[http://www.amirifont.org/ Amiri] <small>(appears feathery on Windows; errors with combining shadda with kasra and some Rohingya diacritics [https://github.com/alif-type/amiri/issues/155])</small> *[https://fonts.google.com/noto/specimen/Noto+Naskh+Arabic Noto Naskh Arabic] *[https://fontlibrary.org/en/font/droid-arabic-naskh Droid Arabic Naskh] <small>(better at smaller sizes; has an error in displaying</small> [[Riyal|<span dir="rtl" style="font-family:'Noto Naskh Arabic',KacstOne,'DejaVu Sans','DejaVu Sans Condensed',Harmattan,'Iranian Sans',Scheherazade,Lateef,'Arabic Transparent'; font-size:125%">ريال</span>]]<small>)</small> *[https://fonts.google.com/noto/specimen/Noto+Sans+Arabic Noto Sans Arabic] *[http://software.sil.org/harmattan Harmattan] <small>(lacks a bold weight; errors with combining shadda with kasra)</small> These fonts contain all Arabic character defined in Unicode (see [[Arabic script in Unicode]]) for text in the various languages that use the [[Arabic script]], but not all the redundant glyphs used in stylizing. ;Non-free fonts: If the previous fonts are not installed, other fallback fonts would display: * SF Arabic <small>(is a complete ''[[Apple OS|Apple]]'' font)</small> * [[Core fonts for the Web#External links|Arial]], Times New Roman <small>(essentially look the same; lack a few characters; errors with combining shadda with kasra)</small> Arabic Transparent * Caribri <small>(only the newer versions render Arabic)</small> * Microsoft Sans Serif <small>(lacks a few characters; lacks a bold weight; errors with combining shadda with kasra)</small> * Segoe UI <small>(lacks a few characters; errors with combining shadda with kasra; in older versions, lacked a normal weight)</small> * Sakkal Majalla <small>(errors with combining shadda with kasra)</small> * Microsoft Uighur <small>(lacks a few characters; has errors with combining shadda with kasra; lacked a bold weight on older versions)</small> * Arabic Typesetting <small>(lacks a bold weight; errors with combining shadda with kasra)</small> == How to override fonts in user's preferences == Any user can use another font with a different size by writing the following on [[Special:Mypage/vector.css|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 : <syntaxhighlight lang="css"> .script-arabic { font-size: 105% !important; font-family: 'Droid Arabic Naskh', Arial, sans-serif !important; } </syntaxhighlight> : Font names containing spaces (or any other character than a letter) need to be put between <code><strong>'</strong></code> or <code><strong>"</strong></code>. : The list of fonts should always be terminated by the pseudo-font names "sans-serif" and/or "serif", to allow using the fonts defined in user preferences in their browser, or the fonts set by default in browsers. : You may choose to add the line-height phrase if you wanted to make lines in a paragraph more spaced from each other, or less spaced. <code>line-height: 125%;</code> 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. : Some Arabic-based letters aren't rendered properly by some old versions of ''[[Times New Roman]]'', such as: {{raise|0.6em|2=<span dir="rtl" style="font-family:'Noto Naskh Arabic', 'Droid Arabic Naskh', Harmattan, Scheherazade, 'Scheherazade New', Lateef, 'Microsoft Uighur', 'Arabic Typesetting', 'Sakkal Majalla', 'Segoe UI', 'Microsoft Sans Serif', Arial; font-size: 200%; line-height:1.6;">ېـ ـېـ ـې ې</span>}} which is used in [[Pashto language|Pashto]] and [[Uyghur language|Uyghur]]; the newest versions of the following fonts render it properly: '''''Scheherazade New, Scheherazade, Lateef, Amiri, Noto Naskh Arabic, Droid Arabic Naskh, Noto Sans Arabic, Harmattan,''''' Arial, 'Times New Roman', 'Sakkal Majalla', 'Microsoft Uighur', 'Arabic Typesetting', 'Microsoft Sans Serif', 'Segoe UI'. (The newest versions which are available free-of-charge online are marked as '''bold'''.) * A demonstration with ''[http://software.sil.org/scheherazade Scheherazade New]'' or ''[https://software.sil.org/scheherazade/download/previous-versions/ Scheherazade]'' added first at 175%: <span dir="rtl" style="font-family: 'Scheherazade New', Scheherazade, Lateef, 'Microsoft Uighur', 'Arabic Typesetting', 'Sakkal Majalla', Arial, 'Arabic Transparent', 'Times New Roman', 'Noto Naskh Arabic', Harmattan; font-size: 175%">موسوعة</span> That font is freely available online, but if you chose to use it, you must increase the text size, because it shows it very small compared to other fonts. * A demonstration with ''[https://fontlibrary.org/en/font/droid-arabic-naskh 'Droid Arabic Naskh']'' added first at 105%: <span dir="rtl" style="font-family: 'Droid Arabic Naskh', Arial, 'Arabic Transparent', 'Times New Roman', Harmattan; font-size: 105%">موسوعة</span> However, it has an error in displaying the word (<span style="font-size:125%; font-family:'Noto Naskh Arabic', 'KacstOne', 'DejaVu Sans', 'DejaVu Sans Condensed', Harmattan, 'Iranian Sans', Tahoma;margin-right:2px;margin-left:1px">[[riyal|ريال]]</span>), it is folded on itself, rather than normally rendered in ''[[naskh (script)|naskh]]''. * A demonstration with ''[https://fonts.google.com/noto/specimen/Noto+Naskh+Arabic Noto Naskh Arabic]'' added first at 125%: <span dir="rtl" style="font-family: 'Noto Naskh Arabic', Harmattan, Scheherazade, 'Scheherazade New', Lateef, 'Microsoft Uighur', 'Arabic Typesetting', 'Sakkal Majalla', Arial, 'Arabic Transparent', 'Times New Roman'; font-size: 125%">موسوعة</span> That font is freely available online. * A demonstration with ''[http://software.sil.org/harmattan Harmattan]'' added first at 125%: <span dir="rtl" style="font-family: Harmattan, Scheherazade, 'Scheherazade New', Lateef, 'Microsoft Uighur', 'Arabic Typesetting', 'Sakkal Majalla', Arial, 'Arabic Transparent', 'Times New Roman'; font-size: 125%">موسوعة</span> That font is freely available online. Example: <syntaxhighlight lang="css"> .script-arabic { font-size: 125% !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 of the Arabic script: */ 'Noto Naskh Arabic', Scheherazade, 'Scheherazade New', Lateef, 'Droid Arabic Naskh', Harmattan /* 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: */ Arial, /* Warning! Old versions may not support a few characters. */ 'Times New Roman', /* Warning! Old versions may not support a few characters. */ /* 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; } </syntaxhighlight> <br/> Another example without the notes: <syntaxhighlight lang="css"> .script-arabic { font-size: 125% !important; line-height: 95%; font-family: 'Noto Naskh Arabic', Scheherazade, 'Scheherazade New', Lateef, 'Droid Arabic Naskh', Harmattan, Arial, 'Times New Roman', 'Sakkal Majalla', 'Microsoft Uighur', 'Arabic Typesetting', sans-serif !important; } </syntaxhighlight> ==Template Data== {{Template data header}} {{cot|title=Parameter list|bg=#CCC}} <templatedata> { "params": { "1": {}, "no_rtl_mark": {}, "size": {}, "style": {}, "attributes": {} }, "paramOrder": [ "1", "no_rtl_mark", "size", "style", "attributes" ] } </templatedata> {{cob}} == See also == * [[Template:Arabic alphabet shapes]] (its documentation page features a table showing a full test of contextual Arabic letter shapes supported). * [[Template:Ug-textonly]] (enable Uyghur styled fonts) * [[Template:Script/Nastaliq]] (used for the text written in Nastaliq styled Arabic script) <includeonly>{{Sandbox other|| <!-- Categories go here: --> [[Category:Script–font templates|A]] }}</includeonly>
摘要:
请注意,所有对Local Chinese Wikipedia的贡献均可能会被其他贡献者编辑、修改或删除。如果您不希望您的文字作品被随意编辑,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源(详情请见
Project:著作权
)。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)
导航菜单
个人工具
未登录
讨论
贡献
创建账号
登录
命名空间
模板
讨论
大陆简体
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
查看
阅读
编辑
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息