mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Move Style#font support to SVGStyles.
This commit is contained in:
parent
ad034fbb56
commit
938433c51f
3 changed files with 2 additions and 13 deletions
|
@ -198,15 +198,7 @@ new function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function exportText(item) {
|
function exportText(item) {
|
||||||
var attrs = getTransform(item, true),
|
var node = createElement('text', getTransform(item, true));
|
||||||
style = item.getStyle(),
|
|
||||||
font = style.getFont(),
|
|
||||||
fontSize = style.getFontSize();
|
|
||||||
if (font)
|
|
||||||
attrs['font-family'] = font;
|
|
||||||
if (fontSize)
|
|
||||||
attrs['font-size'] = fontSize;
|
|
||||||
var node = createElement('text', attrs);
|
|
||||||
node.textContent = item._content;
|
node.textContent = item._content;
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
|
@ -375,10 +375,6 @@ new function() {
|
||||||
'fill-opacity': applyOpacity,
|
'fill-opacity': applyOpacity,
|
||||||
'stroke-opacity': applyOpacity,
|
'stroke-opacity': applyOpacity,
|
||||||
|
|
||||||
'font-family': function(item, value) {
|
|
||||||
item.setFont(value.split(',')[0].replace(/^\s+|\s+$/g, ''));
|
|
||||||
},
|
|
||||||
|
|
||||||
visibility: function(item, value) {
|
visibility: function(item, value) {
|
||||||
item.setVisible(value === 'visible');
|
item.setVisible(value === 'visible');
|
||||||
},
|
},
|
||||||
|
|
|
@ -24,6 +24,7 @@ var SVGStyles = Base.each({
|
||||||
center: 'middle',
|
center: 'middle',
|
||||||
right: 'end'
|
right: 'end'
|
||||||
}],
|
}],
|
||||||
|
font: ['font-family', 'string'],
|
||||||
fontSize: ['font-size', 'number']
|
fontSize: ['font-size', 'number']
|
||||||
}, function(entry, key) {
|
}, function(entry, key) {
|
||||||
var part = Base.capitalize(key),
|
var part = Base.capitalize(key),
|
||||||
|
|
Loading…
Reference in a new issue