Text fixes for node-canvas. Version 1.0.9

This commit is contained in:
kangax 2013-02-13 20:20:57 +01:00
parent 24e9bb8513
commit a77cbfe2be
7 changed files with 15 additions and 11 deletions

View file

@ -1,6 +1,6 @@
/*! Fabric.js Copyright 2008-2013, Printio (Juriy Zaytsev, Maxim Chernyak) */
var fabric = fabric || { version: "1.0.7" };
var fabric = fabric || { version: "1.0.9" };
if (typeof exports !== 'undefined') {
exports.fabric = fabric;

10
dist/all.js vendored
View file

@ -1,7 +1,7 @@
/* build: `node build.js modules=ALL exclude=gestures` */
/*! Fabric.js Copyright 2008-2013, Printio (Juriy Zaytsev, Maxim Chernyak) */
var fabric = fabric || { version: "1.0.7" };
var fabric = fabric || { version: "1.0.9" };
if (typeof exports !== 'undefined') {
exports.fabric = fabric;
@ -15356,7 +15356,7 @@ fabric.Image.filters.Pixelate.fromObject = function(object) {
* @property
* @type Number
*/
fontWeight: 400,
fontWeight: 'normal',
/**
* Font family
@ -15914,8 +15914,9 @@ fabric.Image.filters.Pixelate.fromObject = function(object) {
*/
_getFontDeclaration: function() {
return [
this.fontStyle,
this.fontWeight,
// node-canvas needs "weight style", while browsers need "style weight"
(fabric.isLikelyNode ? this.fontWeight : this.fontStyle),
(fabric.isLikelyNode ? this.fontStyle : this.fontWeight),
this.fontSize + 'px',
(fabric.isLikelyNode ? ('"' + this.fontFamily + '"') : this.fontFamily)
].join(' ');
@ -16382,6 +16383,7 @@ fabric.Image.filters.Pixelate.fromObject = function(object) {
var fabricCanvas = new FabricCanvas(canvasEl);
fabricCanvas.contextContainer = nodeCanvas.getContext('2d');
fabricCanvas.nodeCanvas = nodeCanvas;
fabricCanvas.Font = Canvas.Font;
return fabricCanvas;
};

4
dist/all.min.js vendored

File diff suppressed because one or more lines are too long

BIN
dist/all.min.js.gz vendored

Binary file not shown.

View file

@ -1,7 +1,7 @@
{
"name": "fabric",
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.",
"version": "1.0.7",
"version": "1.0.9",
"author": "Juriy Zaytsev <kangax@gmail.com>",
"keywords": ["canvas", "graphic", "graphics", "SVG", "node-canvas", "parser", "HTML5", "object model"],
"repository": "git://github.com/kangax/fabric.js",

View file

@ -112,6 +112,7 @@
var fabricCanvas = new FabricCanvas(canvasEl);
fabricCanvas.contextContainer = nodeCanvas.getContext('2d');
fabricCanvas.nodeCanvas = nodeCanvas;
fabricCanvas.Font = Canvas.Font;
return fabricCanvas;
};

View file

@ -31,7 +31,7 @@
* @property
* @type Number
*/
fontWeight: 400,
fontWeight: 'normal',
/**
* Font family
@ -589,8 +589,9 @@
*/
_getFontDeclaration: function() {
return [
this.fontStyle,
this.fontWeight,
// node-canvas needs "weight style", while browsers need "style weight"
(fabric.isLikelyNode ? this.fontWeight : this.fontStyle),
(fabric.isLikelyNode ? this.fontStyle : this.fontWeight),
this.fontSize + 'px',
(fabric.isLikelyNode ? ('"' + this.fontFamily + '"') : this.fontFamily)
].join(' ');