Skip to content

Add ability to pass additional parameters to svgicons2svgfont #21

@davidhouweling

Description

@davidhouweling

I have the following SVG...

<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title></title>
    <defs></defs>
    <g id="chevron" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <path d="M10.1464466,9.35355339 C9.95118446,9.15829124 9.95118446,8.84170876 10.1464466,8.64644661 C10.3417088,8.45118446 10.6582912,8.45118446 10.8535534,8.64644661 L13.8535534,11.6464466 C14.0488155,11.8417088 14.0488155,12.1582912 13.8535534,12.3535534 L10.8535534,15.3535534 C10.6582912,15.5488155 10.3417088,15.5488155 10.1464466,15.3535534 C9.95118446,15.1582912 9.95118446,14.8417088 10.1464466,14.6464466 L12.7928932,12 L10.1464466,9.35355339 Z" id="Mask" fill="#072456" fill-rule="nonzero"></path>
    </g>
</svg>

Which results in the following:
image

However, the SVG is a lot sharper. Doing a bit of research and it seems that fontHeight should be the appropriate fix.

I modified the my locally installed version of icons-to-woff.js to pass a hard coded fontHeight: 1000 as suggested by nfroidure/svgicons2svgfont#85 and it fixed the issue.

image

It would be good to have the ability to pass along any other options that svgicons2svgfont can accept so that it offers a lot more flexibility and does not require you to intervene.

Furthermore, if fontHeight is provided, then https://github.com/jantimon/iconfont-webpack-plugin/blob/master/lib/icons-to-woff.js#L54 can be removed as svgicons2svgfont automatically normalizes before needing to be passed through the subsequent libraries to get the woff file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions