mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-03-27 11:10:24 +00:00
Text fixes for node-canvas. Version 1.0.9
This commit is contained in:
parent
24e9bb8513
commit
a77cbfe2be
7 changed files with 15 additions and 11 deletions
|
|
@ -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
10
dist/all.js
vendored
|
|
@ -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
4
dist/all.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/all.min.js.gz
vendored
BIN
dist/all.min.js.gz
vendored
Binary file not shown.
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@
|
|||
var fabricCanvas = new FabricCanvas(canvasEl);
|
||||
fabricCanvas.contextContainer = nodeCanvas.getContext('2d');
|
||||
fabricCanvas.nodeCanvas = nodeCanvas;
|
||||
fabricCanvas.Font = Canvas.Font;
|
||||
|
||||
return fabricCanvas;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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(' ');
|
||||
|
|
|
|||
Loading…
Reference in a new issue