7 Commits

Author SHA1 Message Date
Vadim Namniak 77617bae67 Update bower.json 2015-09-20 20:20:17 -04:00
Vadim Namniak ab03d8fc09 Update package.json 2015-09-20 20:20:01 -04:00
Vadim Namniak 348fd5cfac Update README.md 2015-09-20 20:19:45 -04:00
Vadim ed3fa124d6 added keywords 2015-09-20 20:16:21 -04:00
Vadim 0391cacffa versions 2015-09-19 22:57:07 -04:00
Vadim Namniak 4ae38b6eb8 Update README.md 2015-09-19 22:54:46 -04:00
Vadim eaf4897b0c version updated 2015-09-19 20:18:56 -04:00
3 changed files with 12 additions and 10 deletions
+8 -7
View File
@@ -1,7 +1,7 @@
CanvasTextWrapper CanvasTextWrapper
================= =================
##Syntax # Syntax
``` ```
CanvasTextWrapper(HTMLCanvasElement, String [, options]); CanvasTextWrapper(HTMLCanvasElement, String [, options]);
``` ```
@@ -23,7 +23,7 @@ CanvasTextWrapper(HTMLCanvasElement, String [, options]);
NOTE: if a single word is too long to fit the width with specified font size, it will break on any letter unless ```sizeToFill``` option is enabled. NOTE: if a single word is too long to fit the width with specified font size, it will break on any letter unless ```sizeToFill``` option is enabled.
##Defaults # Defaults
``` ```
{ {
font: "18px Arial, sans-serif", font: "18px Arial, sans-serif",
@@ -41,9 +41,11 @@ NOTE: if a single word is too long to fit the width with specified font size, it
} }
``` ```
##Usage # Usage
Configure context settings properties such as "fillStyle", "lineWidth" or "strokeStyle" before using CanvasTextWrapper like so: Configure context settings properties such as "fillStyle", "lineWidth" or "strokeStyle" before using CanvasTextWrapper like so:
``` ```
var CanvasTextWrapper = require('canvas-text-wrapper').CanvasTextWrapper;
var canvas = document.getElementById("#canvasText"); var canvas = document.getElementById("#canvasText");
canvas.width = 200; canvas.width = 200;
canvas.height = 200; canvas.height = 200;
@@ -53,13 +55,12 @@ context.strokeStyle = "#ff0000";
CanvasTextWrapper(canvas,"Hello"); //default options will apply CanvasTextWrapper(canvas,"Hello"); //default options will apply
``` ```
##Examples # Examples
http://namniak.github.io/CanvasTextWrapper/ http://namniak.github.io/CanvasTextWrapper/
##Installation # Installation
``` ```
bower install canvas-text-wrapper bower install canvas-text-wrapper
npm i canvas-text-wrapper
npm install canvas-text-wrapper
``` ```
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "canvas-text-wrapper", "name": "canvas-text-wrapper",
"version": "0.4.0", "version": "0.4.3",
"ignore": [ "ignore": [
"**/.*", "**/.*",
"**/*.log", "**/*.log",
+3 -2
View File
@@ -1,9 +1,10 @@
{ {
"name": "canvas-text-wrapper", "name": "canvas-text-wrapper",
"description": "Pure JavaScript canvas text wrapper that automatically splits a string into lines on specified rule with alignment and padding.", "description": "Pure JavaScript canvas text wrapper that automatically splits a string into lines on specified rule with alignment and padding.",
"version": "0.3.2", "version": "0.4.3",
"license": "MIT", "license": "MIT",
"main": "CanvasTextWrapper.min.js", "main": "CanvasTextWrapper.min.js",
"keywords": ["canvas", "canvas text", " text", "split"],
"homepage": "http://namniak.github.io/CanvasTextWrapper/", "homepage": "http://namniak.github.io/CanvasTextWrapper/",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -17,4 +18,4 @@
"grunt-contrib-uglify": "^0.9.1", "grunt-contrib-uglify": "^0.9.1",
"uglify-save-license": "^0.4.1" "uglify-save-license": "^0.4.1"
} }
} }