updated examples

This commit is contained in:
Vadim Namniak
2015-05-06 00:23:29 -04:00
parent 0debea2d2b
commit da27d152c5
3 changed files with 10 additions and 16 deletions
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -5,7 +5,7 @@ document.onreadystatechange = function() {
var container = document.getElementsByTagName('section')[0]; var container = document.getElementsByTagName('section')[0];
var w = 448; var w = 448;
var h = 250; var h = 250;
var options = optionsArr; var options = model;
createExamples(); createExamples();
@@ -23,7 +23,7 @@ document.onreadystatechange = function() {
canvas.height = h; canvas.height = h;
context = canvas.getContext('2d'); context = canvas.getContext('2d');
context.lineWidth = 2; context.lineWidth = 2;
context.strokeStyle = 'red'; context.strokeStyle = 'yellow';
CanvasTextWrapper(canvas,(options[i].txt),options[i]); CanvasTextWrapper(canvas,(options[i].txt),options[i]);
var hint = document.createElement('div'); var hint = document.createElement('div');
+7 -7
View File
@@ -1,14 +1,14 @@
var optionsArr = [ var model = [
{ {
txt: 'Break text on every next word', txt: 'Break text on every next word',
font: 'bold 25px Arial, sans-serif', font: 'italic 800 36px Arial, sans-serif',
textAlign: 'center', textAlign: 'center',
lineBreak: 'word', lineBreak: 'word',
lineHeight: "160%" lineHeight: "160%"
}, },
{ {
txt: 'Center text block horizontally and vertically', txt: 'Center text block horizontally and vertically',
font: 'bold 35px Verdana, Geneva, sans-serif', font: 'bold 35px Arial, sans-serif',
textAlign: 'center', textAlign: 'center',
verticalAlign: 'middle' verticalAlign: 'middle'
}, },
@@ -21,8 +21,8 @@ var optionsArr = [
paddingY: 30 paddingY: 30
}, },
{ {
txt: 'Justify text lines takes effect only with "auto" break line. One-word lines are skipped', txt: 'Justify text lines takes effect only with "auto" break line. Single word lines are skipped',
font: 'bold 40px Arial, Geneva, sans-serif', font: 'bold 40px Arial, sans-serif',
paddingX: 20, paddingX: 20,
paddingY: 20, paddingY: 20,
verticalAlign: 'middle', verticalAlign: 'middle',
@@ -31,7 +31,7 @@ var optionsArr = [
}, },
{ {
txt: 'Apply text stroke is based on context settings', txt: 'Apply text stroke is based on context settings',
font: 'bold 40px Tahoma, Geneva, sans-serif', font: 'bold 40px Arial, sans-serif',
textAlign: 'right', textAlign: 'right',
paddingX: 25, paddingX: 25,
strokeText: true, strokeText: true,
@@ -39,7 +39,7 @@ var optionsArr = [
}, },
{ {
txt: 'Use\n new line character "\\n"\n to break lines\nwhere needed', txt: 'Use\n new line character "\\n"\n to break lines\nwhere needed',
font: 'bold 30px Tahoma, Geneva, sans-serif', font: 'bold 30px Arial, sans-serif',
verticalAlign: 'bottom', verticalAlign: 'bottom',
allowNewLine: true, allowNewLine: true,
lineHeight: '200%' lineHeight: '200%'