@@ -79,7 +79,8 @@ _html2canvas.Parse = function (images, options) {
7979 var align = false ,
8080 bold = getCSS ( el , "fontWeight" ) ,
8181 family = getCSS ( el , "fontFamily" ) ,
82- size = getCSS ( el , "fontSize" ) ;
82+ size = getCSS ( el , "fontSize" ) ,
83+ shadow = getCSS ( el , "textShadow" ) ;
8384
8485 switch ( parseInt ( bold , 10 ) ) {
8586 case 401 :
@@ -94,6 +95,17 @@ _html2canvas.Parse = function (images, options) {
9495 ctx . setVariable ( "font" , [ getCSS ( el , "fontStyle" ) , getCSS ( el , "fontVariant" ) , bold , size , family ] . join ( " " ) ) ;
9596 ctx . setVariable ( "textAlign" , ( align ) ? "right" : "left" ) ;
9697
98+ if ( shadow !== "none" ) {
99+ var shadows = _html2canvas . Util . parseTextShadows ( shadow ) ;
100+
101+ // TODO: support multiple text shadows
102+ // apply the first text shadow
103+ ctx . setVariable ( "shadowColor" , shadows [ 0 ] . color ) ;
104+ ctx . setVariable ( "shadowOffsetX" , shadows [ 0 ] . offsetX ) ;
105+ ctx . setVariable ( "shadowOffsetY" , shadows [ 0 ] . offsetY ) ;
106+ ctx . setVariable ( "shadowBlur" , shadows [ 0 ] . blur ) ;
107+ }
108+
97109 if ( text_decoration !== "none" ) {
98110 return _html2canvas . Util . Font ( family , size , doc ) ;
99111 }
0 commit comments