...

View Full Version : HTML5 Text Canvas in variable



angelali
11-22-2012, 09:08 PM
I am writing text on Canvas. I want to know if the font can be placed in variable?

For example you want the text to be italic, 30pt in size and Arial as font family, so the code is like this:

context.font = 'italic 30pt Arial';

What I want is to place the font-style, size and family in variables, so I tried this:


var style = 'italic';
var size = '30pt';
var family = 'Arial'

context.font = 'style size family';

It does not work I think...

angelali
11-22-2012, 09:35 PM
Already tackled. Forgot to remove quotes.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum