nfroidure/gulp-iconfont

Can't include svg's with transform anymore

Closed this issue · 3 comments

Since two days our build is failing with the following error:

Error: Got an error parsing the glyph "0042-XXX": Cannot rotate H.

After debugging it seems gulp-iconfont/svgicons2svgfont doesn't like the 'transform' property anymore since they allways build it correctly. Can i expect this feature back again, or do i have to alter my sourcefiles?

<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve">
<style type="text/css">
	.st0{fill:#333F49;}
</style>
<g>
	<path class="st0" d="M426.7,757.3h-32v32V928v32h32h170.7h32v-32V789.3v-32h-32H426.7z M597.4,928h-0.1H426.7V789.3h170.7V928z"/>
	
		<rect x="716.1" y="768.9" transform="matrix(-0.7071 -0.7071 0.7071 -0.7071 783.9925 1892.7616)" class="st0" width="135.8" height="30.2"/>
	
		<rect x="779.5" y="161.5" transform="matrix(0.7071 0.7071 -0.7071 0.7071 394.9526 -494.7059)" class="st0" width="30.2" height="135.8"/>
	
		<rect x="161.5" y="214.3" transform="matrix(0.7071 0.7071 -0.7071 0.7071 229.3685 -95.037)" class="st0" width="135.8" height="30.2"/>
	
		<rect x="224.9" y="716.1" transform="matrix(-0.7071 -0.7071 0.7071 -0.7071 -144.6775 1508.0867)" class="st0" width="30.2" height="135.8"/>
	<path class="st0" d="M714.7,469.3c-0.1-112-90.8-202.6-202.7-202.6s-202.6,90.6-202.7,202.6h0c0,0,0,0,0,0c0,0,0,0,0,0.1h0
		c0,51.9,19.8,103.6,59.4,143.2c32.2,32.2,50,75.1,50,120.7h32c0-51.9-19.8-103.7-59.4-143.3c-32.2-32.2-50-75.1-50-120.7
		c0-94.1,76.6-170.6,170.7-170.6c94.1,0,170.7,76.6,170.7,170.7c0,45.6-17.8,88.4-50,120.6c-39.6,39.6-59.4,91.4-59.4,143.3h32
		c0-45.6,17.8-88.4,50-120.7c39.6-39.6,59.4-91.3,59.4-143.2h0C714.7,469.4,714.7,469.4,714.7,469.3
		C714.7,469.3,714.7,469.3,714.7,469.3L714.7,469.3z"/>
	<rect x="85.3" y="490.7" class="st0" width="149.3" height="32"/>
	<rect x="789.3" y="490.7" class="st0" width="149.3" height="32"/>
	<rect x="496" y="64" class="st0" width="32" height="149.3"/>
</g>
</svg>

It should till work. The following addition seems to have break the transformation of H/V commands: nfroidure/svg-pathdata@6d2c709

We'll investigate. You should go to a prior version in the meanwhile.

Thanks for checking so quickly!

Temporary made it work again using old version (8.0.1). I also set svgicons2svgfont to a fixed version, else it would take 3.0.2 by default and it seems that version contains pathdata with a bug for our icon build.

    "gulp-iconfont": "8.0.1",
    "gulp-svgicons2svgfont": "3.0.1",

Just published nfroidure/gulp-svgicons2svgfont#38 which should solve the semver issue.