mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -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) {
|
||||
var attrs = 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);
|
||||
var node = createElement('text', getTransform(item, true));
|
||||
node.textContent = item._content;
|
||||
return node;
|
||||
}
|
||||
|
|
|
@ -375,10 +375,6 @@ new function() {
|
|||
'fill-opacity': applyOpacity,
|
||||
'stroke-opacity': applyOpacity,
|
||||
|
||||
'font-family': function(item, value) {
|
||||
item.setFont(value.split(',')[0].replace(/^\s+|\s+$/g, ''));
|
||||
},
|
||||
|
||||
visibility: function(item, value) {
|
||||
item.setVisible(value === 'visible');
|
||||
},
|
||||
|
|
|
@ -24,6 +24,7 @@ var SVGStyles = Base.each({
|
|||
center: 'middle',
|
||||
right: 'end'
|
||||
}],
|
||||
font: ['font-family', 'string'],
|
||||
fontSize: ['font-size', 'number']
|
||||
}, function(entry, key) {
|
||||
var part = Base.capitalize(key),
|
||||
|
|
Loading…
Reference in a new issue