HTML and CSS   XSLT   JavaScript   Images   Soft   Etc  
Kirill Klenov Artur Chafonov

The rouble sign in HTML 8 August 2007


Task:

Introduce the rouble symbol.

August 1, 2007 Art. Lebedev Studio proposed to all professional designers the new rouble sign. For the first time it was used offline on Art. Lebedev Store price tags. Here you can find several suggestions on how it can be introduced online.



The symbol is not available for PC and Mac users until it is included in ISO and Unicode tables, so we have to find alternative ways of displaying it. The sign must be resizable. We also have to think about the way it will be read off screen and copied into clipboard. Possible solutions include Flash, PNG, GIF and HTML.

Using flash has obvious drawbacks—it would require certain software which a user might not have, a click on the object would disable text selection, and it would not be easy to change the color of the sign.

If we chose to work with images, we would have to deal with limited size, fixed color range, zero search efficiency and a graphic anchor.

An approached based on images is shown below (there is a hidden “RUR” expansion that gets copied into clipboard):

Bunnies 100 RUR each

Bunnies 100 RUR each

Bunnies 100 RUR each

Bunnies 100 RUR each

01 
02 
03 
04 
05 
06 
07 
08 
<style type="text/css">
    img.ruble-img { height: 1.5ex; }
    span.dot { position:absolute; text-indent: -1000em; }
</style>
<p style="font-size:1em">Bunnies 100 <img src="ruble.gif" class="ruble-img" /><span class="dot">RUR</span> each</p>
<p style="font-size:1.2em">Bunnies 100 <img src="ruble.gif" class="ruble-img" /><span class="dot">RUR</span> each</p>
<p style="font-size:1.5em">Bunnies 100 <img src="ruble.gif" class="ruble-img" /><span class="dot">RUR</span> each</p>
<p style="font-size:2em">Bunnies 100 <img src="ruble.gif" class="ruble-img" /><span class="dot">RUR</span> each</p>

Bunnies 100 RUR each

Bunnies 100 RUR each

Bunnies 100 RUR each

Bunnies 100 RUR each

01 
02 
03 
04 
05 
06 
07 
08 
09 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
<style type="text/css">
    span.roparent { // display:none; }
    .robject { width: 1.5ex; height: 1.5ex; }
    span.adot { position:absolute; text-indent: -1000em; // position: static; // text-indent: 0; }
</style>
<p style="font-size:1em">Bunnies 100 <span class="roparent">
    <object class="robject" name="object" data="http://www.artlebedev.ru/;-)/ruble.svg" type="image/svg+xml">
        <embed name="object2" src="http://www.artlebedev.ru/;-)/ruble.svg" type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/" />
    </object>
</span><span class="adot">RUR</span> each</p>
<p style="font-size:1.2em">Bunnies 100 <span class="roparent">
    <object class="robject" name="object" data="http://www.artlebedev.ru/;-)/ruble.svg" type="image/svg+xml">
        <embed name="object2" src="http://www.artlebedev.ru/;-)/ruble.svg" type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/" />
    </object>
</span><span class="adot">RUR</span> each</p>
<p style="font-size:1.5em">Bunnies 100 <span class="roparent">
    <object class="robject" name="object" data="http://www.artlebedev.ru/;-)/ruble.svg" type="image/svg+xml">
        <embed name="object2" src="http://www.artlebedev.ru/;-)/ruble.svg" type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/" />
    </object>
</span><span class="adot">RUR</span> each</p>
<p style="font-size:2em">Bunnies 100 <span class="roparent">
    <object class="robject" name="object" data="http://www.artlebedev.ru/;-)/ruble.svg" type="image/svg+xml">
        <embed name="object2" src="http://www.artlebedev.ru/;-)/ruble.svg" type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/" />
    </object>
</span><span class="adot">RUR</span> each</p>

Bunnies 100 p each

Bunnies 100 p each

Bunnies 100 p each

Bunnies 100 p each

01 
02 
03 
04 
05 
06 
07 
08 
09 
<style type="text/css">
    span.ruble { text-transform:uppercase; }
    span.line-through { text-decoration: line-through; }
    span.dot { position:absolute; text-indent: -1000em; }
</style>
<p style="font-size:1em">Bunnies 100 <span class="ruble line-through">p</span><span class="dot"></span> each</p>
<p style="font-size:1.2em">Bunnies 100 <span class="ruble line-through">p</span><span class="dot"></span> each</p>
<p style="font-size:1.5em">Bunnies 100 <span class="ruble line-through">p</span><span class="dot"></span> each</p>
<p style="font-size:2em">Bunnies 100 <span class="ruble line-through">p</span><span class="dot"></span> each</p>

If the computer generated line can’t be adjusted, then we can draw one. Lets use border. Line thickness in the sample suits well when browsed with Firefox, but appears insufficient for Opera. The result is too unpredictable.

Bunnies 100 p. each

Bunnies 100 p. each

Bunnies 100 p. each

Bunnies 100 p. each

01 
02 
03 
04 
05 
06 
07 
08 
09 
10 
<style type="text/css">
    span.ruble { text-transform:uppercase; }
    span.rel { position: relative; }
    span.dborder { top: -1.5ex; left: 0; width:.9ex; border-bottom: 0.16ex solid black; // top: -1.3ex; }
    span.dot { position:absolute; text-indent: -1000em; }
</style>
<p style="font-size:1em">Bunnies 100 <span class="ruble rel">p<span class="dot dborder">.</span></span> each</p>
<p style="font-size:1.2em">Bunnies 100 <span class="ruble rel">p<span class="dot dborder">.</span></span> each</p>
<p style="font-size:1.5em">Bunnies 100 <span class="ruble rel">p<span class="dot dborder">.</span></span> each</p>
<p style="font-size:2em">Bunnies 100 <span class="ruble rel">p<span class="dot dborder">.</span></span> each</p>

Bunnies 100 p each

Bunnies 100 p each

Bunnies 100 p each

Bunnies 100 p each

01 
02 
03 
04 
05 
06 
07 
08 
09 
10 
<style type="text/css">
    span.dot { position:absolute; text-indent: -1000em; }
    span.ruble { text-transform:uppercase; }
    span.hyphen:after { content: '\2013'; }
    span.hyphen { position:absolute; margin:.1ex 0 0; behavior: expression(this.innerHTML = '&ndash;'); }
</style>
<p style="font-size:1em">Bunnies 100 <span class="hyphen"></span><span class="ruble">p</span><span class="dot"></span> each</p>
<p style="font-size:1.2em">Bunnies 100 <span class="hyphen"></span><span class="ruble">p</span><span class="dot"></span> each</p>
<p style="font-size:1.5em">Bunnies 100 <span class="hyphen"></span><span class="ruble">p</span><span class="dot"></span> each</p>
<p style="font-size:2em">Bunnies 100 <span class="hyphen"></span><span class="ruble">p</span><span class="dot"></span> each</p>

Bunnies 100 քRUR each

Bunnies 100 քRUR each

Bunnies 100 քRUR each

Bunnies 100 քRUR each

01 
02 
03 
04 
05 
06 
07 
08 
09 
<style type="text/css">
    span.dot { position:absolute; text-indent: -1000em; }
    span.rel { position: relative; }
    span.arm{ top:-.52ex; }
</style>
<p style="font-size:1em">Bunnies 100 <span class="rel arm">&#x584;</span><span class="dot">RUR</span> each</p>
<p style="font-size:1.2em">Bunnies 100 <span class="rel arm">&#x584;</span><span class="dot">RUR</span> each</p>
<p style="font-size:1.5em">Bunnies 100 <span class="rel arm">&#x584;</span><span class="dot">RUR</span> each</p>
<p style="font-size:2em">Bunnies 100 <span class="rel arm">&#x584;</span><span class="dot">RUR</span> each</p>

Internet Explorer is required to view this example.

Bunnies 100 p each

Bunnies 100 p each

Bunnies 100 p each

Bunnies 100 p each

01 
02 
03 
04 
05 
06 
07 
08 
<style type="text/css">
    @font-face { font-family: "Rubl Sign"; src: url(http://www.artlebedev.ru/;-)/ruble.eot); }
    span.eot { // font-family: "Rubl Sign"; }
</style>
<p style="font-size:1em">Bunnies 100 <span class="eot">p</span><span class="dot"></span> each</p>
<p style="font-size:1.2em">Bunnies 100 <span class="eot">p</span><span class="dot"></span> each</p>
<p style="font-size:1.5em">Bunnies 100 <span class="eot">p</span><span class="dot"></span> each</p>
<p style="font-size:2em">Bunnies 100 <span class="eot">p</span><span class="dot"></span> each</p>

Users of other browsers will have to stick with en dash or images. This last sample combines the advantages of the methods described above.

Bunnies 100 p each

Bunnies 100 p each

Bunnies 100 p each

Bunnies 100 p each

01 
02 
03 
04 
05 
06 
07 
08 
09 
10 
<style type="text/css">
    @font-face { font-family: "Rubl Sign"; src: url(http://www.artlebedev.ru/;-)/ruble.eot); }
    span.rur { font-family: "Rubl Sign"; text-transform: uppercase; // text-transform: none;}    
    span.rur span { position: absolute; overflow: hidden; width: .45em; height: 1em; margin: .1ex 0 0 -.55em; // display: none; }
    span.rur span:before { content: '\2013'; }
</style>
<p style="font-size:1em">Bunnies 100 <span class="rur">p<span></span></span> each</p>
<p style="font-size:1.2em">Bunnies 100 <span class="rur">p<span></span></span> each</p>
<p style="font-size:1.5em">Bunnies 100 <span class="rur">p<span></span></span> each</p>
<p style="font-size:2em">Bunnies 100 <span class="rur">p<span></span></span> each</p>

Order a design...