fontello / svg2ttf

SVG -> TTF font convertor
MIT License
521 stars 80 forks source link

Expose all fontNames metas #60

Closed bialikover closed 3 years ago

bialikover commented 7 years ago

Would it be possible to add the ability to expose options for the following fontNames metas?:

[7] Trademark [8] Manufacturer [9] Designer [10] Description [11] URL vendor [12] URL designer [13] License [14] License URL [15] Preferred family [16] Preferred subfamily [17] Mac Name [18] Sample text [19] Ps findfont name [20] WWS family [21] WWS subfamily

font.sfntNames.push({ id: 7, value: options.trademark || 'default trademark' });
...

based on this line: L34

puzrin commented 7 years ago
  1. I'm not sure that this properties are supported in SVG
  2. No plans to develop this package actively, but PR-s are acceptable if do not break general approach

Prior to so something, i'd suggest to check twice if you need svg -> ttf convertor, or ttf writer.

bialikover commented 7 years ago

Needed to transform svgs to ttf.

I'm getting the metas from type3.2 app:

screen shot 2017-08-11 at 10 59 08 am

puzrin commented 7 years ago

Could you provide example of your SVG font with those fields filled? I don't remember those in svg specification.

bialikover commented 7 years ago

Those fields are the ttf font names, some of them are being added when generating the ttf file: https://github.com/fontello/svg2ttf/blob/master/lib/ttf/tables/name.js#L9

I was wondering if we can expose them all as optional. name.js file is already iterating for the ids: https://github.com/fontello/svg2ttf/blob/master/lib/ttf/tables/name.js#L52

but we might want to add them to font.sfntNames array like here: https://github.com/fontello/svg2ttf/blob/master/index.js#L29

For the svgs let me get an example, we potentially use a fallback value as the line above.

puzrin commented 7 years ago

As i said, this package was done to use SVG as source, not to write any possible data supported by ttf. I don't like idea to increase number of kludges if those are not supported in SVG. Better TTF writer needs different approach to API.

yisibl commented 5 years ago

I have done some work here. https://github.com/fontello/svg2ttf/pull/86

puzrin commented 3 years ago

Close in favor of #111. Let's continue there. Seems i found approach how to allow arbitrary records without bloating code & options.