Difference between revisions of "Template:Accidental"

From blackwiki
Jump to navigation Jump to search
blackwiki>Mike Peel
blackwiki>Mscuthbert
(Use Template:Music now)
Line 1: Line 1:
<span class="accidental" style="font-family: Arial Unicode MS, Lucida Sans Unicode;">{{#switch: {{{1}}}
+
#REDIRECT [[Template:Music]]
| flat = &#x266d;
 
| doubleflat = [[Image:Doubleflat.svg|8px|double flat]]
 
| natural = &#x266e;
 
| sharp = &#x266f;
 
| doublesharp = [[Image:DoubleSharp.svg|6px|double sharp]]
 
| #default = {{{1}}}
 
}}</span><noinclude>
 
 
 
<!--Hopefully the inline style attribute will be replace by a class reference to "accidental" in [[MediaWiki:Common.css]]-->
 
 
 
==Benefits==
 
The template correctly renders Unicode sharps ({{accidental|sharp}}) flats ({{accidental|flat}}) and natural signs ({{accidental|natural}}) in [[Internet Explorer]] which would otherwise display [[Mojibake|empty squares]]. The choice of fonts also improves the rendering in other browsers on [[Microsoft Windows]] such as [[Mozilla Firefox]]. See the table below to compare the results in your current browser.
 
 
 
{| cellspacing="14"
 
! !! Without template !! With template
 
|-
 
! Flat
 
| &#x266d; || {{accidental|flat}}
 
|-
 
! Natural
 
| &#x266e; || {{accidental|natural}}
 
|-
 
! Sharp
 
| &#x266f; || {{accidental|sharp}}
 
|-
 
! double flat
 
| &#x1D12B; || {{accidental|doubleflat}}
 
|-
 
! double sharp
 
| &#x1D12A; || {{accidental|doublesharp}}
 
|}
 
 
 
The template also makes use of [[Scalable Vector Graphics|SVG]] to display double flat ({{accidental|doubleflat}}) and double sharp ({{accidental|doublesharp}}) signs since the corresponding Unicode characters are not widely supported.
 
 
 
==Examples==
 
===Flat sign===
 
<nowiki>{{accidental|flat}}</nowiki> renders {{accidental|flat}}<br/>
 
<nowiki>{{accidental|doubleflat}}</nowiki> renders {{accidental|doubleflat}}
 
 
 
===Natural sign===
 
<nowiki>{{accidental|natural}}</nowiki> renders {{accidental|natural}}
 
 
 
===Sharp sign===
 
<nowiki>{{accidental|sharp}}</nowiki> renders {{accidental|sharp}}<br/>
 
<nowiki>{{accidental|doublesharp}}</nowiki> renders {{accidental|doublesharp}}
 
 
 
==Goals==
 
# The template code should be easy to remember
 
# The template should improve cross-browser support for music symbols
 
# The template should reduce edit squabbles between [[Unicode]] sharps and flats versus [[ASCII]] #'s and b's. It should not be used to create new edit wars
 
 
 
[[Category:MSIE font fix templates|{{PAGENAME}}]]
 
</noinclude>
 

Revision as of 15:52, 10 July 2007

Redirect to: