Help:Extension:WebFonts/zh

这是 Web 字体功能的用户文档，WebFonts 扩展的技术文档也有了.

许多语言中没有方便可用的字体，可能由于系统没有安装而用户不会安装，或用户在没有安装所需字体的公共计算机上阅读维基. 因此，要显示该语言的内容会出现问题. Web 字体通过在 wiki 页面中内嵌字体来解决该问题. 需要时可自动下载字体，这样计算机能显示读者能阅读的内容而不会出现乱码、问号或方框等.

用法


本扩展安装并启用后，登录并进入 wiki 页的选项链接，此时会出现菜单供选择页面字体. 默认该菜单中的首个字体能适用于本 wiki. 用户也可以改变字体，这样其他页面也会以新字体显示. 用户还可以禁用内嵌的字体，这同样会应用于其他页面甚至包括以后的访问，且在 30 天之内有效. 如果 WebFonts 扩展支持语言而打开的页面中没有内容时，则菜单不会出现.

如果本地系统中有可用字体，则不会从 MediaWiki 服务器上下载，而直接从电脑中读取. 在首次需要该字体且本地没有时才从服务器下载，以后直接从本地缓存中读取.

禁用 Web 字体
要在匿名时禁用 Web 字体：请打开 Web 字体菜单并选择底部选项“”（请参阅截图）. 这样通过 cookie 禁用了该功能 30 天. 已缓存的字体仍将用于“font-family”样式的渲染.

要在登录后禁用 Web 字体："" ""  取消选项 ""  点击"" 以保存设置.

支持的文本、语言以及字体列表
There is web fonts support for many scripts. Below you can find an exhaustive list of all scripts that are currently supported and the languages they are active for by default.

Arabic script
Supported languages: Persian (fa).
 * Iranian Sans

Assamese and Bengali script
Supported languages: Bengali (bn), Assamese (as) and Bishnupriya Manipuri (bpy).


 * Lohit Bengali (default)
 * Lohit Assamese

Devanagari script
Supported languages: Hindi (hi), Marathi (mr), Maithili (mai), Bhojpuri (bh, bho), Goan Konkani (gom), Ahirani (ahr).


 * Lohit Devanagari
 * Samyak Devanagari (not available in menu because of rendering issues)
 * Madan (not available in menu because of rendering issues)

Ethiopic (Geʻez) script
Supported languages: Amharic (am), Tigrinya (ti)


 * AbyssinicaSIL

Gujarati script

 * Lohit Gujarati
 * Samyak Gujarati

Gurmukhi script

 * Lohit Punjabi
 * Saab

Hebrew script

 * Miriam CLM
 * Taamey Frank CLM

Khmer script
Supported languages: Khmer (km).


 * KhmerOSbattambang
 * KhmerOSbokor
 * KhmerOSfreehand
 * KhmerOSmuol
 * KhmerOSmuollight
 * KhmerOSmuolpali
 * KhmerOSsiemreap

Kannada script
Supported languages: Kannada (kn), Tulu (tcy)
 * Lohit Kannada
 * Kedage

Latin script

 * Charis SIL – supports Min Dong Chinese
 * Perizia
 * RufScript
 * Ubuntu – stylized font made by Ubuntu

Malayalam script

 * AnjaliOldLipi
 * Meera
 * RaghuMalayalam

Myanmar (Burmese) script

 * Masterpiece Uni Sans
 * Myanmar3
 * Padauk-Regular
 * Yunghkio

Oriya script

 * Lohit Oriya
 * Utkal

Saurashtra script

 * Pagul

Tamil script

 * Lohit Tamil
 * Thendral
 * Thenee

Telugu script

 * Lohit Telugu
 * Pothana2000
 * Vemana2000

Advanced use
There are two ways in wiki text to trigger web fonts functionality. Text can be tagged with a language code and with a specific font style. When language tagging is used, the default web font for that language will be used. Language tagging is necessary when the language is different from the language of a page. Language tagging is encouraged, because it will also lead to improved search engine results, spell-checking, speech synthesis, speech recognition, etc.

To mark a paragraph of text as Hindi and load the default web font for it:

To mark a paragraph of text as Hindi and load the non-standard web font "Samyak Devanagari" for it:

Limitations and known issues
Even if a browser supports web fonts, there is no guarantee that it can render the text correctly. This is often a problem for example in Indic scripts, where the glyphs are not just placed one after another without any changes, like in Latin and Cyrillic scripts. The correct rendering and rendering quality also depend on the browser and the operating system that is used. Modern web browsers and operating systems like recent Linux desktop distributions, Mac OS X and Windows 7 perform pretty well, but older web browsers (like Internet Explorer 6) and operating systems like Windows XP may provide a sub-optimal user experience.

Because of the flash of unstyled text (FOUT) that happens on first load, this technology gets unpractical if the font files grow very big. This currently prevents adding fonts for Chinese for example. The WebFonts extension does not support partial font downloading, where only those glyphs that are used in the page would be loaded.

Web fonts are currently not supported for Internet Explorer 6 on any Windows version or Internet Explorer 8 on Windows XP because of known issues.

A list of known issues is in the MediaWiki bug tracker.

New scripts, languages and translations
Only free fonts can be used for web fonts. The font license must allow redistributing the font and converting it to another formats. SIL Open Font License is preferred. Bugs or bad rendering caused by missing hinting information in the font may prevent using a font as a web font. If you are aware of a suitable font, please request it to be added in the the bug tracker.

Please report all issues in the bug tracker and translate this functionality at translatewiki.net.