Skip to main content
Syntax coloring
Source Link
Victor Stafusa
  • 8.8k
  • 5
  • 40
  • 61

HTML 5 + Javascript

<!DOCTYPE html>
<html>
<body>

<canvas id="monalisa" width="200" height="200" style="border:1px solid #000000;">
Your browser is non-artistic !! 
</canvas>

</body>
<script>
    var question = "Answer to life the universe and everything";
    var c = document.getElementById("monalisa");
    var context = c.getContext("2d");
    context.fillStyle = "rgb(255, 0, 0)";
    var text = question.length;
    context.font = "180px Arial";
    context.strokeText(text, 1, 160);
</script>
</html>
<!DOCTYPE html>
<html>
<body>

<canvas id="monalisa" width="200" height="200" style="border:1px solid #000000;">
Your browser is non-artistic !! 
</canvas>

</body>
<script>
    var question = "Answer to life the universe and everything";
    var c = document.getElementById("monalisa");
    var context = c.getContext("2d");
    context.fillStyle = "rgb(255, 0, 0)";
    var text = question.length;
    context.font = "180px Arial";
    context.strokeText(text, 1, 160);
</script>
</html>

Output:

Canvas

Demo:

http://jsfiddle.net/NmHty/1/

HTML 5 + Javascript

<!DOCTYPE html>
<html>
<body>

<canvas id="monalisa" width="200" height="200" style="border:1px solid #000000;">
Your browser is non-artistic !! 
</canvas>

</body>
<script>
    var question = "Answer to life the universe and everything";
    var c = document.getElementById("monalisa");
    var context = c.getContext("2d");
    context.fillStyle = "rgb(255, 0, 0)";
    var text = question.length;
    context.font = "180px Arial";
    context.strokeText(text, 1, 160);
</script>
</html>

Output:

Canvas

Demo:

http://jsfiddle.net/NmHty/1/

HTML 5 + Javascript

<!DOCTYPE html>
<html>
<body>

<canvas id="monalisa" width="200" height="200" style="border:1px solid #000000;">
Your browser is non-artistic !! 
</canvas>

</body>
<script>
    var question = "Answer to life the universe and everything";
    var c = document.getElementById("monalisa");
    var context = c.getContext("2d");
    context.fillStyle = "rgb(255, 0, 0)";
    var text = question.length;
    context.font = "180px Arial";
    context.strokeText(text, 1, 160);
</script>
</html>

Output:

Canvas

Demo:

http://jsfiddle.net/NmHty/1/

added 107 characters in body
Source Link
Ashwin
  • 151
  • 1
  • 4

HTML 5 + Javascript

<!DOCTYPE html>
<html>
<body>

<canvas id="monalisa" width="200" height="200" style="border:1px solid #000000;">
Your browser is non-artistic !! 
</canvas>

</body>
<script>
    var question = "Answer to life the universe and everything";
    var c = document.getElementById("monalisa");
    var context = c.getContext("2d");
    context.fillStyle = "rgb(255, 0, 0)";
    var text = "42";question.length;
    context.font = "180px Arial";
    context.strokeText(text, 1, 160);
</script>
</html>

Output:

Canvas

Demo:

http://jsfiddle.net/NmHty/1/

HTML 5 + Javascript

<!DOCTYPE html>
<html>
<body>

<canvas id="monalisa" width="200" height="200" style="border:1px solid #000000;">
Your browser is non-artistic !! 
</canvas>

</body>
<script>
var c = document.getElementById("monalisa");
var context = c.getContext("2d");
context.fillStyle = "rgb(255, 0, 0)";
var text = "42";
context.font = "180px Arial";
context.strokeText(text, 1, 160);
</script>
</html>

Output:

Canvas

Demo:

http://jsfiddle.net/NmHty/

HTML 5 + Javascript

<!DOCTYPE html>
<html>
<body>

<canvas id="monalisa" width="200" height="200" style="border:1px solid #000000;">
Your browser is non-artistic !! 
</canvas>

</body>
<script>
    var question = "Answer to life the universe and everything";
    var c = document.getElementById("monalisa");
    var context = c.getContext("2d");
    context.fillStyle = "rgb(255, 0, 0)";
    var text = question.length;
    context.font = "180px Arial";
    context.strokeText(text, 1, 160);
</script>
</html>

Output:

Canvas

Demo:

http://jsfiddle.net/NmHty/1/

added 4 characters in body
Source Link
Ashwin
  • 151
  • 1
  • 4

HTML 5 + Javascript

<!DOCTYPE html>
<html>
<body>

<canvas id="monalisa" width="200" height="200" style="border:1px solid #000000;">
Your browser is non-artistic !! 
</canvas>

</body>
<script>
var c = document.getElementById("monalisa");
var context = c.getContext("2d");
context.fillStyle = "rgb(255, 0, 0)";
var text = "42";
context.font = "180px Arial";
context.strokeText(text, 1, 160);
</script>
</html>

Output:

Canvas

Canvas

Demo: http://jsfiddle.net/NmHty/

http://jsfiddle.net/NmHty/

HTML 5 + Javascript

<!DOCTYPE html>
<html>
<body>

<canvas id="monalisa" width="200" height="200" style="border:1px solid #000000;">
Your browser is non-artistic !! 
</canvas>

</body>
<script>
var c = document.getElementById("monalisa");
var context = c.getContext("2d");
context.fillStyle = "rgb(255, 0, 0)";
var text = "42";
context.font = "180px Arial";
context.strokeText(text, 1, 160);
</script>
</html>

Output:

Canvas

Demo: http://jsfiddle.net/NmHty/

HTML 5 + Javascript

<!DOCTYPE html>
<html>
<body>

<canvas id="monalisa" width="200" height="200" style="border:1px solid #000000;">
Your browser is non-artistic !! 
</canvas>

</body>
<script>
var c = document.getElementById("monalisa");
var context = c.getContext("2d");
context.fillStyle = "rgb(255, 0, 0)";
var text = "42";
context.font = "180px Arial";
context.strokeText(text, 1, 160);
</script>
</html>

Output:

Canvas

Demo:

http://jsfiddle.net/NmHty/

added 13 characters in body
Source Link
Ashwin
  • 151
  • 1
  • 4
Loading
Source Link
Ashwin
  • 151
  • 1
  • 4
Loading