Template:Unicode/doc: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
(Move TOC up)
(Refresh visual style and interwikilink targets)
 
(28 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{documentation subpage}}
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.
{{TOCright}}
==Usage==
{{code|<nowiki>{{unicode|&amp;#x22CA;}}</nowiki>}} and {{code|<nowiki>{{unicode|&amp;#x22C9;}}</nowiki>}} give {{unicode|&#x22CA;}} and {{unicode|&#x22C9;}}.


==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 was created to allow easy switching to [[unicode font]]s. It should ''only'' be used in cases where characters do otherwise not render correctly on some  browsers, such as [[Microsoft]] [[Internet Explorer]].  


The fonts selected are designed to maximize the probability to render 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:
== 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;}}


*For strings in the [[International Phonetic Alphabet]], use {{tl|IPA}}.
== Internal logic ==
*for various non-Latin scripts, use {{tl|lang}} if possible, or {{tl|script}} otherwise.
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:
*for [[MUFI]] encoding (non-Unicode), use {{tl|mufi}}.
<div style="max-width: 33vmax; margin-left: 2.5em;"><syntaxhighlight lang="css">
 
==Guts of template==
<code><nowiki><span class="Unicode">{{{1}}}</span></nowiki></code>
 
...wherein class="Unicode" is defined in [[MediaWiki:Common.css/WinFixes.css]]:
<source lang="CSS">
.Unicode {
.Unicode {
    font-family: Code2000, Code2001, "Free Serif", "TITUS Cyberbit Basic",
  font-family: "Arial Unicode MS", "Lucida Sans Unicode";
                "Doulos SIL", "Chrysanthi Unicode", "Bitstream Cyberbit",
                "Bitstream CyberBase", Thryomanes, Gentium, GentiumAlt,
                "Lucida Grande", "Free Sans", "Arial Unicode MS",
                "Microsoft Sans Serif", "Lucida Sans Unicode";
}
}
</source>
</syntaxhighlight></div>
 
A personal stylesheet (/monobook.css &c, class ''.Unicode'') may be used to enforce a "prettier" display where preferred.
 
==Examples==
<nowiki>{{unicode|&amp;#x22CA;}} and {{unicode|&amp;#x22C9;}}</nowiki> give {{unicode|&#x22CA;}} and {{unicode|&#x22C9;}}.
 
==Technical==
;This portion ported as usage from en.wikipedia talk page [[w:template talk:unicode]]
:Problems and talk discussions should be posted to that page which the programmers have watchlisted.
{{tiw|unicode}} containing:
<noinclude>
;Ver: Update to late P2, P3 call forms. [[User:Fabartus|<B><font color="blue">Fra</font></B>]]<font color="green">[[User talk:Fabartus|nkB]]</font> 15:38, 10 February 2007 (UTC)
</noinclude>
 
== See also ==
* {{tl|IPA}} &mdash; International Phonetic Alphabet.
* {{tl|mufi}} &mdash; Forces a font which supports the [[MUFI]] characters.
* {{tl|transl}} &mdash; generic [[romanization]]
* {{tl|script}} &mdash; Scripts in Unicode navigation box
* {{tl|Unicode navigation}} &mdash; General Unicode navigation box
* {{tl|Table Unicode}} &mdash; General Unicode navigation box (deprecated)
 
<includeonly>
<!-- ADD CATEGORIES BELOW THIS LINE -->


[[Category:MSIE font fix templates|{{PAGENAME}}]]
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.


<!-- ADD INTERWIKIS BELOW THIS LINE -->
== 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>


[[ar:قالب:يونيكود]]
[[be-x-old:Шаблён:Юнікод]]
[[bg:Шаблон:Уникод]]
[[de:Vorlage:Unicode]]
[[dsb:Pśedłoga:Unicode]]
[[es:Plantilla:Unicode]]
[[eo:Ŝablono:Unicode]]
[[ko:틀:Unicode]]
[[hsb:Předłoha:Unicode]]
[[hr:Predložak:Unicode]]
[[it:Template:Unicode]]
[[mk:Шаблон:Уникод]]
[[nl:Sjabloon:Unicode]]
[[pl:Szablon:Unicode]]
[[pnt:Πρότυπον:Unicode]]
[[pt:Predefinição:Unicode]]
[[ro:Format:Unicode]]
[[ru:Шаблон:Unicode]]
[[sq:Stampa:Unicode]]
[[simple:Template:Unicode]]
[[fi:Malline:Unicode]]
[[vi:Tiêu bản:Unicode]]
[[zh:Template:Unicode]]


</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.