In the previous post, I mentioned font embedding as a way to increase the variety of a web page. Another way to do this is to use three dimensional text. Below are several different ways to do this using css or svg or combinations of the two:
click image for larger view
The first sample is created with the css text-shadow:
H1{position: absolute; top: 345px; left: 252px; border-shadow: 5px 5px 5px #000000 color: #000000; font: italic normal 800 162px Times New Roman;}
The others all use extrusion:
<script type='text/javascript'>
function text() {
for (var i = 1; i <=10; i++) {
var layr = "text" + i;
var xpos = 250 + 2*i;
var ypos = 200 + i;
document.getElementById(layr).setAttributeNS(null, "x", xpos);
document.getElementById(layr).setAttributeNS(null, "y", ypos);
layr = "text2" + i;
var ypos = 360 + i;
document.getElementById(layr).setAttributeNS(null, "x", xpos);
document.getElementById(layr).setAttributeNS(null, "y", ypos);
layr = "text3" + i;
var ypos = 520 + i;
document.getElementById(layr).setAttributeNS(null, "x", xpos);
document.getElementById(layr).setAttributeNS(null, "y", ypos);
}
}function position() {
for (var i=1; i<=10; i++) {
var layr = "h1" + i;
var lft = (240 + 2* i).toString() + "px";
var tp = (610 + i).toString() + "px";
document.getElementById(layr).style.left=lft;
document.getElementById(layr).style.top=tp;
}
}
</script>
</head>
<body onload='text(); position();'>
The second sample is just an svg extrusion:
<text id="text1">Test</text><text id="text2">Test</text><text id="text3">Test</text><text id="text4">Test</text><text id="text5">Test</text><text id="text6">Test</text><text id="text7">Test</text><text id="text8">Test</text><text id="text9">Test</text><text id="text10">Test</text>
The third is an svg extrusion with blur to simulate a shadow:
<defs>
<filter id="shadow">
<feGaussianBlur stdDeviation="1.5"/>
</filter>
</defs>
<text id="text21" style="stroke: #000000; filter:url(#shadow);">Test</text><text id="text22">Test</text><text id="text23">Test</text><text id="text24">Test</text><text id="text25">Test</text><text id="text26">Test</text><text id="text27">Test</text><text id="text28">Test</text><text id="text29">Test</text><text id="text210">Test</text>
The fourth is an svg extrusion in combination with a css text-shadow:
body {margin-left:0;margin-right:0;font:italic normal 800 160px Times New Roman; text-shadow: -3px -2px 3px #666666; color:#EEEEEE}
<text id=”text31″>Test</text><text id=”text32″>Test</text><text id=”text33″>Test</text><text id=”text34″>Test</text><text id=”text35″>Test</text><text id=”text36″>Test</text><text id=”text37″>Test</text><text id=”text38″>Test</text><text id=”text39″>Test</text><text id=”text310″>Test</text>
       Test
The fifth is a combination of css extrusion and css text-shadow:
#h11{position: absolute; color: #000000; font:italic normal 800 160px Times new Roman; text-shadow: -2px -2px 2px #000000}
<div id=”h11″>Test</div><div id=”h12″>Test</div><div id=”h13″>Test</div><div id=”h14″>Test</div><div id=”h15″>Test</div><div id=”h16″>Test</div><div id=”h17″>Test</div><div id=”h18″>Test</div><div id=”h19″>Test</div><div id=”h110″>Test</div>
Any one of these methods can be used with an ordinary or embedded font to add a special effect to the web page.