Template:Unicode/doc: Difference between revisions

Content deleted Content added
No edit summary
update, per request
Line 5:
== Usage ==
 
ThisIn its basic version, this template sets the font for its argument to one which is likely to support special symbols. The argument is specified using [[Html_characters#HTML_character_references|HTML character encoding]], either in decimal (e.g. <tt>&amp;#123;</tt>) or hexadecimal (e.g. <tt>&amp;#xA9;</tt>). Examples:
 
* {{code|<nowiki>{{unicode|&amp;#x22CA;}}</nowiki>}}    {{unicode|&#x22CA;}}
* {{code|<nowiki>{{unicode|&amp;#8906;}}</nowiki>}}    {{unicode|&#8906;}}
* {{code|<nowiki>{{unicode|&#8906;}}</nowiki>}}    {{unicode|&#8906;}} (this may look trivial, but could be helpful in some browsers)
or
* {{code|<nowiki>{{unicode|&amp;#x22C9;}}</nowiki>}}    {{unicode|&#x22C9;}}
* {{code|<nowiki>{{unicode|&amp;#8905;}}</nowiki>}}    {{unicode|&#8905;}}
* {{code|<nowiki>{{unicode|&#8905;}}</nowiki>}}    {{unicode|&#8905;}}
 
The template also takes a ''subject'' parameter, to use alternate fonts for specific sets of characters, organized thematically, where the usual fonts don't provide glyphs. The currently supported subjects are animal, astro, chem, communication, dentistry, education, emoticon, enclosed, event, food, game, map, medicine, money, music, person, picto, plant, politicsreligion, region, sport, technology, time, ui, warning, weather. <!-- EDITORS, complete list of which symbols are included in which subjects, and support for the subjects by various fonts, is in the TALK page for the doco. --> Examples:
 
* Without template: ⚽⚾ ⛳ ⛷⛸⛹ 🎯 🎳 🎽🎾🎿🏀🏁🏂🏃🏄 🏆🏇🏈🏉🏊<br>Template without subject: {{unicode|⚽⚾ ⛳ ⛷⛸⛹ 🎯 🎳 🎽🎾🎿🏀🏁🏂🏃🏄 🏆🏇🏈🏉🏊}}<br>Template with subject: {{unicode|⚽⚾ ⛳ ⛷⛸⛹ 🎯 🎳 🎽🎾🎿🏀🏁🏂🏃🏄 🏆🏇🏈🏉🏊|subject=sport}}
* Without template: ! ? ‼‽ ⁇⁈⁉ ☠☡☢☣ ⚛ ⚠⚡ ⛐ ⛔ ⛚ 💣 💥 🚧 🚫 🚭 🚯 🚱 🚳 🚷<br>Template without subject: {{unicode|! ? ‼‽ ⁇⁈⁉ ☠☡☢☣ ⚛ ⚠⚡ ⛐ ⛔ ⛚ 💣 💥 🚧 🚫 🚭 🚯 🚱 🚳 🚷}}<br>Template with subject: {{unicode|! ? ‼‽ ⁇⁈⁉ ☠☡☢☣ ⚛ ⚠⚡ ⛐ ⛔ ⛚ 💣 💥 🚧 🚫 🚭 🚯 🚱 🚳 🚷|subject=warning}}
 
Depending on your browser's built-in font substitution capabilities, and fonts you have installed, you may or may not see any difference.
 
== Purpose ==
 
This template was created to allow easy switching to [[Unicode font]]s. It shouldhelps ''only''some bebrowsers usedin forwhich characters which do not render correctly on some browsers, such as [[Microsoft]] [[Internet Explorer]] on [[Windows  XP]].
 
The fonts selected are designed to maximize the probability of rendering uncommon [[Unicode]] characters correctly. However, different fonts cover different [[Mapping of Unicode characters|Unicode ranges]]. It is probably mostly useful for various [[Unicode symbols]]. Do not use it for the following:
Line 28 ⟶ 35:
The source for the template is:
<source lang="XML">
<span class="Unicode{{#if:{{{subject|}}}|{{ucfirst:{{lc:{{{subject}}}}}}}}}">{{{1}}}</span>
</source>
and <tt>''class="Unicode"''</tt> is defined in [[MediaWiki:Common.js]] as follows:
Line 36 ⟶ 43:
}
</source>
Note it defines this ''only'' for Windows  XP.
 
You can override this with your own <tt>Unicode</tt> class definition in your [[Help:User_style|personal stylesheet]] (e.g. <tt>User:''username''/common.css</tt>).
 
The <tt>''UnicodeSubject''</tt> classes are defined in [[MediaWiki:Common.css]] for all browsers.
 
== See also ==
 
* {{tl|IPA}} &ndash; To format symbols of the International Phonetic Alphabet
* {{tl|PUA}} – To mark characters from the Private Use Area that should be retained
* {{tl|transl}} &ndash; Generic [[romanization]]
* {{tl|script}} &ndash; Scripts in Unicode navigation box
* {{tl|UnicodeTitle}}
* {{tl|unichar}} to format an [[Unicode]] character description
 
{{Unicode templates}}