无法将SVG图像上载到任何字形制作器,但在Inkscape中正确呈现

时间:2018-05-25 01:16:33

标签: svg fonts

我一直试图让操作员类似的字体被创建为TTF,但由于某种原因,每当我尝试将其上传到服务时它似乎都是空的。我能够正确地在Inkscape中渲染它,所以我认为这不会是精确的SVG图像的问题。这是大写字母B,供参考(简化):

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg preserveAspectRatio="xMinYMin none" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="">
    		<g i:e="1" transform="matrix(10,27.5,0,1.25,0,-168)" style="height:auto;overflow-x:visible;overflow-y:visible;width:auto;perspective-origin:0px 0px;transform:matrix(10, 27.5, 0, 1.25, 0, -168);transform-origin:0px 0px;">
    			<i:p style="height:auto;overflow-x:visible;overflow-y:visible;width:auto;perspective-origin:50% 50%;transform-origin:0px 0px;"/>
    			<g q:rq="0" style="height:auto;overflow-x:visible;overflow-y:visible;width:auto;perspective-origin:0px 0px;transform-origin:0px 0px;">
    				<path fill="#414141" d="M3.773 86.883L4.0 81.723C3.766 80.938 3.52 80.418 3.258 80.211L2.938 87.258C2.676 99.059 2.43 110.379 2.195 121.488L2.414 116.656C2.492 113.035 2.566 109.441 2.645 105.77L3.539 86.129C3.617 86.344 3.699 86.59 3.773 86.883ZM3.078 85.84L3.105 85.207C3.234 85.43 3.359 85.652 3.48 85.957L2.703 103.063C2.828 97.375 2.953 91.605 3.078 85.84Z" style="height:auto;overflow-x:visible;overflow-y:visible;width:auto;perspective-origin:0px 0px;transform-origin:0px 0px;fill:rgb(65, 65, 65);d:path('M 3.773 86.883 L 4 81.723 C 3.766 80.938 3.52 80.418 3.258 80.211 L 2.938 87.258 C 2.676 99.059 2.43 110.379 2.195 121.488 L 2.414 116.656 C 2.492 113.035 2.566 109.441 2.645 105.77 L 3.539 86.129 C 3.617 86.344 3.699 86.59 3.773 86.883 Z M 3.078 85.84 L 3.105 85.207 C 3.234 85.43 3.359 85.652 3.48 85.957 L 2.703 103.063 C 2.828 97.375 2.953 91.605 3.078 85.84 Z');"/>
    			</g>
    		</g>
    	</svg>

这可能是它创建方式的问题吗?我确实尝试在Inkscape中重新保存它,但即使这样它似乎也没有正常工作。

1 个答案:

答案 0 :(得分:0)

当我测试你SVG时,它不是一个有效的代码而且对我不起作用,但它的大写A和下面的新SVG

<?xml version="1.0" encoding="utf-8"?>
<svg width="100" height="100" 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 27.2 32.6" enable-background="new 0 0 27.2 32.6" xml:space="preserve">
<g>
	<path d="M7.9,22.1L4.7,32H0.5L11.2,0.6H16L26.8,32h-4.3l-3.4-9.9H7.9z M18.2,18.9l-3.1-9c-0.7-2-1.2-3.9-1.6-5.7h-0.1
		c-0.5,1.9-1,3.8-1.6,5.7l-3.1,9.1H18.2z"/>
</g>
</svg>

尝试一下,让我知道它是否有效。

我添加了heightwidth,但您可以删除它们或更改值