Template:Unicode
{{{1}}}
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. {) or hexadecimal (e.g. ©). Examples:
{{unicode|⋊}}
→ ⋊{{unicode|⋊}}
→ ⋊{{unicode|⋊}}
→ ⋊ (this may look trivial, but could be helpful in some browsers)
or
{{unicode|⋉}}
→ ⋉{{unicode|⋉}}
→ ⋉{{unicode|⋉}}
→ ⋉
Subject
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. Depending on your browser's built-in font substitution capabilities, and fonts you have installed, you may or may not see any difference.
Template:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/exampleTemplate:Unicode/examplesubject | template (class) | result |
---|
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:
<span class="Unicode{{#if:{{{subject|}}}|{{ucfirst:{{lc:{{{subject}}}}}}}}}">{{{1}}}</span>
and class="Unicode"
is defined in MediaWiki:Common.js as follows:
.Unicode {
font-family: "Arial Unicode MS", "Lucida Sans Unicode";
}
Note it defines this only for Windows XP.
You can override this with your own Unicode
class definition in your personal stylesheet (e.g. User:username/common.css).
The UnicodeSubject
classes are defined in MediaWiki:Common.css for all browsers.
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 an Unicode character description
The above documentation is transcluded from Template:Unicode/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |