Template:Unicode/doc: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
(Refresh visual style and interwikilink targets)
 
(51 intermediate revisions by 19 users not shown)
Line 1: Line 1:
<includeonly>{{template doc page transcluded}}</includeonly><noinclude>{{template doc page viewed directly}}</noinclude>
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.
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->


<includeonly>{{Interwikitmp-grp|V=3|cat=MSIE font fix templates|Unicode2}}</includeonly>
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]].


==Usage==
== Usage ==
;This portion ported as usage from en.wikipedia talk page [[w:template talk:unicode]]
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.
:Problems and talk discussions should be posted to that page which the programmers have watchlisted.
* {{Tlx|Unicode|&amp;#x22CA;}} ⇒ {{Unicode|&#x22CA;}}
{{tiw|unicode}} containing:
* {{Tlx|Unicode|&amp;#8906;}} ⇒ {{Unicode|&#8906;}}
<noinclude>
* {{Tlx|Unicode|&#8906;}} ⇒ {{Unicode|&#8906;}} (this may look trivial, but could be helpful in other browsers)
;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)
or
{{Interwikitmp-grp|V=D|cat=MSIE font fix templates|Unicode2}}
* {{Tlx|Unicode|&amp;#x22C9;}} ⇒ {{Unicode|&#x22C9;}}
</noinclude>
* {{Tlx|Unicode|&amp;#8905;}} ⇒ {{Unicode|&#8905;}}
==Purpose==
* {{Tlx|Unicode|&#8905;}} ⇒ {{Unicode|&#8905;}}


This template was created to allow easy switching to [[unicode]] fonts.  This is useful for pages that require unicode to display correctly, such as those written in [[International Phonetic Alphabet]] (commons: [[International Phonetic Alphabet]]). On some browsers, such as [[Microsoft]] [[Internet Explorer]], unicode does not seem to be activated automatically, so this template lets you force it manually.
== Internal logic ==
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">
.Unicode {
  font-family: "Arial Unicode MS", "Lucida Sans Unicode";
}
</syntaxhighlight></div>


One might ask why bother to use a template for this.  Simply:
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.
# The template code is easier to remember than the HTML font style specification, which must be entered fairly precisely for this to work.
# The template code, although not completely transparent, is more transparent than asking new editors to use inline HTML CSS style tags.  At least for many editors.
# Using the template allows us to change unicode display properties for all articles that employ the template at once.  This is useful as the prefered fonts for displaying unicode are somewhat disputable and will change as new, more complete unicode fonts continue to be developed.  The way font specification works, we can provide a whole list of suggested fonts and the first one that is active on the user's machine will be selected.


:When the page says Unicode, Internet Explorer will activate Unicode.
== User-defined Unicode fonts ==
:However, when the page says Arial, Internet Explorer will display Arial. While Arial does include e. g. basic Greek and Cyrillic, it does not include e. g. IPA extensions. These are displayed in Arial anyway when the page says so – that is, they are displayed as the famous rectangles.
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>
:David Marjanović | david.marjanovic_at_gmx.at | 00:44 | 2006/5/16
{{TOCright}}


==Fonts==
The fonts currently in use are, in order:


: ''{{Unicode_fonts}}''
[[Category:Formatting templates]]</includeonly>
 
Controlled by [[Template:Unicode_fonts]].
 
I realize this is not preferable for everyone (I prefer Gentium over Code2000, and Lucida Sans Unicode over Arial Unicode MS), but the reason is simply that the current order will result in the most characters being displayed, and thus is imnhso the best choice for the Wikipedia. I highly recommend using a personal stylesheet (/monobook.css &c, class ''.Unicode'') to enforce a "prettier" display where preferred. [[User talk:Anárion]] 12:46, 16 Mar 2005 (UTC)
 
==Guts of template==
<nowiki><span class="Unicode">{{{1}}}</span></nowiki>.
----
wherein class="Unicode" is defined in [[MediaWiki:Common.css]].
 
==Examples==
<nowiki>{{unicode|&amp;#x22CA;}} and {{unicode|&amp;#x22C9;}}</nowiki> give {{unicode|&#x22CA;}} and {{unicode|&#x22C9;}}.
 
== See also ==
* {{tl|latinx}} &mdash; favours fonts supporting all the characters in the Latin Exteneded B range (includes Old/Middle English).
* {{tl|IPA}} &mdash; International Phonetic Alphabet.
* {{tl|polytonic}} &mdash; Polytonic Greek.
* {{tl|cuneiform}}
* {{tl|runic}}
* {{tl|mufi}} &mdash; Forces a font which supports the [[MUFI]] characters.
* {{tl|transl}} &mdash; generic [[romanization]]
 
<includeonly>
<!-- ADD CATEGORIES BELOW THIS LINE -->
 
[[Category:MSIE font fix templates|{{PAGENAME}}]]
 
<!-- ADD INTERWIKIS BELOW THIS LINE -->
[[de:Vorlage:Unicode]]
[[hr:Predložak:Unicode]]
[[it:Template:Unicode]]
[[mk:Шаблон:Уникод]]
[[nl:Sjabloon:Unicode]]
[[pl:Szablon:Unicode]]
[[ru:Шаблон:Unicode]]
[[simple:Template:Unicode]]
[[vi:Tiêu bản:Unicode]]
[[zh:Template:Unicode]]
 
</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.