Skip to content

Commit 5142be6

Browse files
committed
add text-shadow, text-decoration-line & text-transform in drawing.font
1 parent 6f34028 commit 5142be6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/components/drawing/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ drawing.font = function(s, font) {
3434
var color = font.color;
3535
var size = font.size;
3636
var family = font.family;
37+
var shadow = font.shadow;
38+
var striding = font.striding;
39+
var capitalize = font.capitalize;
3740

3841
if(family) s.style('font-family', family);
3942
if(size + 1) s.style('font-size', size + 'px');
@@ -42,6 +45,10 @@ drawing.font = function(s, font) {
4245
if(weight) s.style('font-weight', weight);
4346
if(style) s.style('font-style', style);
4447
if(variant) s.style('font-variant', variant);
48+
49+
if(shadow) s.style('text-shadow', shadow === 'auto' ? svgTextUtils.makeTextShadow(Color.contrast(color)) : shadow);
50+
if(striding) s.style('text-decoration-line', striding);
51+
if(capitalize) s.style('text-transform', capitalize === 'word' ? 'capitalize' : capitalize);
4552
};
4653

4754
/*

0 commit comments

Comments
 (0)