Template:Unicode/doc: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
No edit summary
(Refresh visual style and interwikilink targets)
 
Line 1: Line 1:
==Usage==
This template exists to allow easy switching to [[wikipedia:Unicode font|Unicode fonts]]. It should ''only'' be used in cases where characters otherwise do not render correctly on some browsers, such as Internet Explorer.
The template looks for letter font families that are broadly supporting incurrent characters (symbols, characters). Input can be decimal like <tt>&amp;#123;</tt> or hexadecimal <tt>&amp;#xA9;</tt>. E.g. (mind the 'x' for hex values):
* {{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 other 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;}}


==Purpose==
The fonts selected are designed to maximize the probability to render uncommon Unicode characters correctly. However, different fonts cover different [[wikipedia:Universal Character Set characters|Unicode ranges]]. It is probably most useful for showing more esoteric [[wikipedia:Unicode symbols|Unicode symbols]].
This template is created to allow easy switching to [[w:unicode font|unicode font]]s. It should ''only'' be used in cases where characters otherwise do not render correctly on some  browsers, such as Internet Explorer.  


The fonts selected are designed to maximize the probability to render uncommon Unicode characters correctly. However, different fonts cover different [[w:Mapping of Unicode characters|Unicode ranges]]. It is probably mostly useful for various [[w:Unicode symbols|Unicode symbols]].
== Usage ==
The template looks for letter font families that are broadly supporting incurrent characters (symbols, characters). Input can be decimal like <code>&amp;#123;</code> or hexadecimal <code>&amp;#xA9;</code>. Remember to mind the <code>x</code> for hexadecimal values.
* {{Tlx|Unicode|&amp;#x22CA;}} ⇒ {{Unicode|&#x22CA;}}
* {{Tlx|Unicode|&amp;#8906;}} ⇒ {{Unicode|&#8906;}}
* {{Tlx|Unicode|&#8906;}} ⇒ {{Unicode|&#8906;}} (this may look trivial, but could be helpful in other browsers)
or
* {{Tlx|Unicode|&amp;#x22C9;}} ⇒ {{Unicode|&#x22C9;}}
* {{Tlx|Unicode|&amp;#8905;}} ⇒ {{Unicode|&#8905;}}
* {{Tlx|Unicode|&#8905;}} ⇒ {{Unicode|&#8905;}}


==Guts of template==
== Internal logic ==
<code><nowiki><span class="Unicode">{{{1}}}</span></nowiki></code>
HTML {{Tag|span|params=class="Unicode"}} tags are wrapped around the template's raw input, wherein <code>class="Unicode"</code> is defined in [[MediaWiki:Common.js]] as:
 
<div style="max-width: 33vmax; margin-left: 2.5em;"><syntaxhighlight lang="css">
...wherein class="Unicode" is defined in [[MediaWiki:Common.js]]:
<source lang="CSS">
.Unicode {
.Unicode {
    font-family: "Arial Unicode MS", "Lucida Sans Unicode";  
  font-family: "Arial Unicode MS", "Lucida Sans Unicode";
}
}
</source>
</syntaxhighlight></div>
 
By extension, this means that an editor may duplicate the output of this template by directly wrapping the raw character codes in {{Tag|span|params=style="font-family: 'Arial Unicode MS','Lucida Sans Unicode';"}} tags when editing the page and thus not need to invoke this template.
 
== User-defined Unicode fonts ==
A [[Special:MyPage/global.css|User stylesheet]] or User skin-specific stylesheet (at [[Special:MyPage/vector.css|vector.css]], [[Special:MyPage/foreground.css|foreground.css]] or [[Special:MyPage/metrolook.css|metrolook.css]]) with class <code>.Unicode { font-family: <var>"preferred-font-family-name"</var>; }</code> may be used to enforce another preferred typeface family on all Kodi Wiki skins or only a single skin, respectively, if desired.<includeonly>


A personal stylesheet (/monobook.css &c, class ''.Unicode'') may be used to enforce a "prettier" display where preferred.


<includeonly>
[[Category:Formatting templates]]</includeonly>
[[Category:Formatting templates]]
</includeonly>

Latest revision as of 22:29, 12 September 2022

This template exists to allow easy switching to Unicode fonts. It should only be used in cases where characters otherwise do not render correctly on some browsers, such as Internet Explorer.

The fonts selected are designed to maximize the probability to render uncommon Unicode characters correctly. However, different fonts cover different Unicode ranges. It is probably most useful for showing more esoteric Unicode symbols.

Usage

The template looks for letter font families that are broadly supporting incurrent characters (symbols, characters). Input can be decimal like &#123; or hexadecimal &#xA9;. Remember to mind the x for hexadecimal values.

  • {{Unicode|&#x22CA;}}
  • {{Unicode|&#8906;}}
  • {{Unicode|⋊}} (this may look trivial, but could be helpful in other browsers)

or

Internal logic

HTML <span class="Unicode">...</span> tags are wrapped around the template's raw input, wherein class="Unicode" is defined in MediaWiki:Common.js as:

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

By extension, this means that an editor may duplicate the output of this template by directly wrapping the raw character codes in <span style="font-family: 'Arial Unicode MS','Lucida Sans Unicode';">...</span> tags when editing the page and thus not need to invoke this template.

User-defined Unicode fonts

A User stylesheet or User skin-specific stylesheet (at vector.css, foreground.css or metrolook.css) with class .Unicode { font-family: "preferred-font-family-name"; } may be used to enforce another preferred typeface family on all Kodi Wiki skins or only a single skin, respectively, if desired.