Template:Script/Runic/doc: Difference between revisions

Content deleted Content added
new
 
m I am sorry if I damage something
 
(27 intermediate revisions by 12 users not shown)
Line 1:
{{documentationDocumentation subpage}}
{{Uses TemplateStyles|Template:Script/styles runic.css}}
<!--
PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE
-->
=== Usage ===
This template marks a string as [[Runic alphabet|Runic script]]. It is transcluded by {{tl|script}} or, alternatively, by {{tl|runic}}. Do not include this template directly, but instead use: {{tlx|script|Runr|‹Runic script string›}}.
 
=== Under the hood ===
The template contains <code>class="script-runic"</code>, which allows users to specify their own style for Runic script. Proper display of the characters is achieved by explicit font declarations, with the font Junicode automatically provided by the [[:meta:Universal Language Selector|Universal Language Selector]].
This template fixes font size at 125&nbsp;%. It contains:
 
The {{para|rtl}} parameter changes the direction of the text to right-to-left.
<nowiki><span title="runes" lang="gem" xml:lang="gem" class="script-runic">{{{1}}}</span></nowiki>
 
The <code>class="script-runic"</code> has two goals. It allows fixing broken display of Runic characters in Internet Explorer, and it allows users to specify their own style for Runic script.
 
The broken display of Runic characters in Internet Explorer is fixed by explicit font declarations in [[MediaWiki:Common.css/WinFixes.css]], which is invoked by [[MediaWiki:Common.js]]. The following fonts are declared for Internet Explorer:
 
.script-runic {
font-family: Junicode, FreeMono, Code2000, Hnias;
}
 
Registered Wikipedia users can specify their own style for Runic script text by including a custom font declaration for <code>.script-runic</code> in their user CSS, see [[Help:User style]].
Line 28 ⟶ 18:
The result will be a span with a class attribute, like this:
 
<nowiki><span title="runes" lang="gem" xml:lang="gem-Runr" class="script-runic">ᚠᚢᚦᚨᚱᚲ</span></nowiki>
 
Which appears in your browser as:
Line 34 ⟶ 24:
: {{script|Runr|ᚠᚢᚦᚨᚱᚲ}}
 
: Another example with {{script|Runr|ᚠᚢᚦᚨᚱᚲ}} displayed inline.
Without {{tl|script}}:
 
Please mark all Runic text with {{tlx|script|Runr}}. This will allow users to format all examples of Runic text consistently, with their choice of fonts, colours, etc.
: ᚠᚢᚦᚨᚱᚲ
 
=== RTL example ===
The last two should only look different if you are using Internet Explorer 6 or lower on Windows, or if you have a custom style defined for <code>class="script-runic"</code>.
In order to display runic text with right-to-left directionality add an "rtl" parameter '''after''' the runic script:
 
{{tlx|script|Runr|ᚠᚢᚦᚨᚱᚲ|rtl}}
Please mark all Runic text with {{tlx|script|Runr}}. This will allow users to format all examples of Runic text consistently, with their choice of fonts, colours, etc.
 
Result is that the runic script should display reading from right to left :
==See also==
*{{tl|unicode}}
*{{tl|mufi}}
 
: {{script|Runr|ᚠᚢᚦᚨᚱᚲ|rtl}}
<includeonly>
 
[[Category:MSIE font fix templates|Runic]]
Note that runic letters should be mirrored in right-to-left (RTL) layout, but glyph mirroring is done at the font level using OpenType technology (''rtlm'' feature), and very few fonts support glyph mirroring in RTL contexts. Even if using a runic font that supports mirrored glyphs in RTL contexts, some browsers (e.g. IE and Edge) do not apply the ''rtlm'' feature so mirroring does not happen in RTL text. With fonts that support the ''rtlm'' feature, runic text is correctly displayed with mirrored glyphs in RTL layout in the latest versions of the Firefox and Chrome browsers (see [http://www.babelstone.co.uk/Fonts/AngloSaxon.html#Mirroring here] for details).
 
=== Mirror example ===
Runes that are subsequently inverted either horizontally or vertically can be added by a third parameter which has better chances to mirror the runes. Here, the example is given along with the ''rtl'' parameter.
 
{{tlx|script|Runr|ᚠᚢᚦᚨᚱᚲ|rtl|mirrorY}}
 
Result is that the runic script should be mirrored :
 
: {{Script/Runic|ᚠᚢᚦᚨᚱᚲ|rtl|mirrorY}}
 
<code>mirrorX</code> turns runes upside-down.
<code>mirrorY</code> turns runes horizontally.
 
If a rune sequence has only certain characters mirrored, this template has to be used numerous times.
 
==Template data==
{{Template data header}}
{{cot|title=Template data|bg=#ddd}}
<templatedata>
{
"params": {
"1": {}
}
}
</templatedata>
{{cob}}
==See also==
*{{tl|unicodeMUFI}}
 
<includeonly>{{Sandbox other||
[[ja:Template:Script/Runic]]
[[Category:MSIE font fixScript–font templates|RunicR]]
</includeonly>
}}</includeonly>