tancredi / fantasticon

Icon font generation tool
MIT License
943 stars 104 forks source link

Unable to set version using formatOptions for ttf #243

Open miguelsolorio opened 3 years ago

miguelsolorio commented 3 years ago

I've got a config file like:

const package = require('./package.json');
const codepoints = require('./src/template/mapping.json');

module.exports = {
    name: 'codicon',
    prefix: 'codicon',
    codepoints: codepoints,
    inputDir: './src/icons',
    outputDir: './dist',
    fontTypes: ['ttf'],
    normalize: true,
    assetTypes: ['css', 'html'],
    templates: {
        html: './src/template/preview.hbs',
        css: './src/template/styles.hbs'
    },
    formatOptions: {
        ttf: {
            url: package.url,
            description: package.description,
            version: package.version
        }
    }
};

And in the formatOptions, it looks like options can be passed for ttf using the svg2ttf api. It appears that all fields (url, description, copyright) work except for the version:

vg2ttf: invalid option, version - "0.0.17"

If I try to do just version: 1 then I get:

svg2ttf: version option should be a string

So I'm really confused as to why version is not taking my string

miguelsolorio commented 3 years ago

Upstream issue filed at https://github.com/fontello/svg2ttf/issues/114

It appears that multiple dots are not supported so you'll have to use a single dot if you want this to work.