mirror of
https://github.com/wassname/CanvasTextWrapper.git
synced 2026-06-27 23:36:32 +08:00
updated examples
This commit is contained in:
File diff suppressed because one or more lines are too long
+2
-2
@@ -5,7 +5,7 @@ document.onreadystatechange = function() {
|
||||
var container = document.getElementsByTagName('section')[0];
|
||||
var w = 448;
|
||||
var h = 250;
|
||||
var options = optionsArr;
|
||||
var options = model;
|
||||
|
||||
createExamples();
|
||||
|
||||
@@ -23,7 +23,7 @@ document.onreadystatechange = function() {
|
||||
canvas.height = h;
|
||||
context = canvas.getContext('2d');
|
||||
context.lineWidth = 2;
|
||||
context.strokeStyle = 'red';
|
||||
context.strokeStyle = 'yellow';
|
||||
CanvasTextWrapper(canvas,(options[i].txt),options[i]);
|
||||
|
||||
var hint = document.createElement('div');
|
||||
|
||||
+7
-7
@@ -1,14 +1,14 @@
|
||||
var optionsArr = [
|
||||
var model = [
|
||||
{
|
||||
txt: 'Break text on every next word',
|
||||
font: 'bold 25px Arial, sans-serif',
|
||||
font: 'italic 800 36px Arial, sans-serif',
|
||||
textAlign: 'center',
|
||||
lineBreak: 'word',
|
||||
lineHeight: "160%"
|
||||
},
|
||||
{
|
||||
txt: 'Center text block horizontally and vertically',
|
||||
font: 'bold 35px Verdana, Geneva, sans-serif',
|
||||
font: 'bold 35px Arial, sans-serif',
|
||||
textAlign: 'center',
|
||||
verticalAlign: 'middle'
|
||||
},
|
||||
@@ -21,8 +21,8 @@ var optionsArr = [
|
||||
paddingY: 30
|
||||
},
|
||||
{
|
||||
txt: 'Justify text lines takes effect only with "auto" break line. One-word lines are skipped',
|
||||
font: 'bold 40px Arial, Geneva, sans-serif',
|
||||
txt: 'Justify text lines takes effect only with "auto" break line. Single word lines are skipped',
|
||||
font: 'bold 40px Arial, sans-serif',
|
||||
paddingX: 20,
|
||||
paddingY: 20,
|
||||
verticalAlign: 'middle',
|
||||
@@ -31,7 +31,7 @@ var optionsArr = [
|
||||
},
|
||||
{
|
||||
txt: 'Apply text stroke is based on context settings',
|
||||
font: 'bold 40px Tahoma, Geneva, sans-serif',
|
||||
font: 'bold 40px Arial, sans-serif',
|
||||
textAlign: 'right',
|
||||
paddingX: 25,
|
||||
strokeText: true,
|
||||
@@ -39,7 +39,7 @@ var optionsArr = [
|
||||
},
|
||||
{
|
||||
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',
|
||||
allowNewLine: true,
|
||||
lineHeight: '200%'
|
||||
|
||||
Reference in New Issue
Block a user