To prevent distortion, consider using CSS for proportional scaling.
var scale=2200/600;
canvas.style.width*=scale;
canvas.style.height*=scale;
However, be cautious as this may result in a pixelated image and text after scaling.
If the pixelation is too severe, you can recreate the original image with scaled text.
Check out the provided code and Demo: http://jsfiddle.net/m1erickson/dZ4D6/
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" media="all" href="css/reset.css" /> <!-- reset css -->
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<style>
body{ background-color: ivory; }
#canvas{border:1px solid red;}
</style>
<script>
$(function(){
var canvas=document.getElementById("canvas");
var ctx=canvas.getContext("2d");
var scale=1.0;
var fontsize=36;
var fontface="verdana";
var fullImageWidth,fullImageHeight;
var img=new Image();
img.onload=function(){
redraw(img,"Hello",20,35,1.25);
}
img.src="https://dl.dropboxusercontent.com/u/139992952/stackoverflow/KoolAidMan.png";
function redraw(img,text,textX,textY,scale){
canvas.width=img.width*scale;
canvas.height=img.height*scale;
// draw the scaled image
ctx.drawImage(img,0,0,img.width,img.height,0,0,img.width*scale,img.height*scale);
ctx.font=(fontsize*scale)+"px "+fontface;
// draw the scaled text
ctx.fillText(text,textX*scale,textY*scale);
}
$("#redraw").click(function(){
if(scale==1.00){
scale=0.50;
}else{
scale=1.00;
}
redraw(img,"Hello",20,35,scale);
});
}); // end $(function(){});
</script>
</head>
<body>
<button id="redraw">Redraw</button><br>
<canvas id="canvas" width=300 height=300></canvas>
</body>
</html>