Template:Unicode/doc: Difference between revisions

From Wikishire
Jump to navigation Jump to search
RB (talk | contribs)
Created page with '{{documentation subpage}} {{TOCright}} == Usage == In its basic version, this template sets the font for its argument to one which is likely to support special symbols. The ar…'
 
No edit summary
 
Line 1: Line 1:
{{documentation subpage}}
{{documentation subpage}}
{{TOCright}}


== Usage ==
== Usage ==


In 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:
In 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 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;#x22CA;}}</nowiki>}} → {{unicode|&#x22CA;}}
Line 38: Line 36:
Note it defines this ''only'' for Windows XP.
Note it defines this ''only'' for Windows XP.


You can override this with your own <code>Unicode</code> class definition in your [[Help:User_style|personal stylesheet]] (e.g. <tt>User:''username''/common.css</tt>).
You can override this with your own <code>Unicode</code> class definition in a personal stylesheet (e.g. <tt>User:''username''/common.css</tt>).


== Template data ==
== Template data ==
Line 63: Line 61:
* {{tl|UnicodeTitle}}
* {{tl|UnicodeTitle}}
* {{tl|unichar}} – to format a Unicode character description
* {{tl|unichar}} – to format a Unicode character description
{{Unicode templates}}


<includeonly>
<includeonly>
[[Category:Templates|Unicode]]
[[Category:Templates|Unicode]]
</includeonly>
</includeonly>

Latest revision as of 07:00, 4 September 2013

Template:Mbox

Usage

In 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 character encoding, either in decimal (e.g. &#123;) or hexadecimal (e.g. &#xA9;). Examples:

  • <syntaxhighlight lang="text" enclose="none">{{unicode|&#x22CA;}}</syntaxhighlight>
  • <syntaxhighlight lang="text" enclose="none">{{unicode|&#8906;}}</syntaxhighlight>
  • <syntaxhighlight lang="text" enclose="none">{{unicode|⋊}}</syntaxhighlight> (this may look trivial, but could be helpful in some browsers)

or

  • <syntaxhighlight lang="text" enclose="none">{{unicode|&#x22C9;}}</syntaxhighlight>
  • <syntaxhighlight lang="text" enclose="none">{{unicode|&#8905;}}</syntaxhighlight>
  • <syntaxhighlight lang="text" enclose="none">{{unicode|⋉}}</syntaxhighlight>

Purpose

This template was created to allow easy switching to Unicode fonts. It helps some browsers in which characters which do not render correctly, 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 Unicode ranges. It is probably mostly useful for various Unicode symbols. Do not use it for the following:

  • For strings in the International Phonetic Alphabet, use {{IPA}}.
  • For various non-Latin scripts, use {{lang}} if possible, or {{script}} otherwise.

Internals

The source for the template is: <source lang="XML"> {{{1}}} </source> and class="Unicode" is defined in MediaWiki:Common.js as follows: <source lang="CSS"> .Unicode {

   font-family: "Arial Unicode MS", "Lucida Sans Unicode";

} </source> Note it defines this only for Windows XP.

You can override this with your own Unicode class definition in a personal stylesheet (e.g. User:username/common.css).

Template data

Template:TemplateDataHeader <templatedata> { "description": "This template is used to set the font so that Unicode symbols are more likely to work.", "params": { "1": { "label": "Symbol", "type": "string", "description": "The code, either in decimal, hexadecimal, or symbol form." } } } </templatedata>

See also

  • {{IPA}} – To format symbols of the International Phonetic Alphabet
  • {{PUA}} – To mark characters from the Private Use Area that should be retained
  • {{transl}} – Generic romanization
  • {{script}} – Scripts in Unicode navigation box
  • {{UnicodeTitle}}
  • {{unichar}} – to format a Unicode character description