Comparing version
@@ -0,1 +1,9 @@ | ||
5.0.0 / 2020-05-20 | ||
------------------ | ||
- Breaking: `USE_TYPO_METRICS` bit of `OS/2.fsSelection` is now set. Should fix | ||
Windows line spacing issues, #95. | ||
- Use font weight value when defined. | ||
4.3.0 / 2019-05-24 | ||
@@ -2,0 +10,0 @@ ------------------ |
14
index.js
@@ -58,4 +58,2 @@ /* | ||
font.vertOriginY = svgFont.vertOriginY || 0; | ||
// need to correctly convert text values, use default (400) until compleete | ||
//font.weightClass = svgFont.weightClass; | ||
font.width = svgFont.width || svgFont.unitsPerEm; | ||
@@ -66,2 +64,14 @@ font.height = svgFont.height || svgFont.unitsPerEm; | ||
if (typeof svgFont.weightClass !== 'undefined') { | ||
var wght = parseInt(svgFont.weightClass, 10); | ||
if (!isNaN(wght)) font.weightClass = wght; | ||
else { | ||
// Unknown names are silently ignored | ||
if (svgFont.weightClass === 'normal') font.weightClass = 400; | ||
if (svgFont.weightClass === 'bold') font.weightClass = 700; | ||
} | ||
} | ||
if (typeof svgFont.underlinePosition !== 'undefined') { | ||
@@ -68,0 +78,0 @@ font.underlinePosition = svgFont.underlinePosition; |
@@ -18,3 +18,9 @@ 'use strict'; | ||
this.familyName = ''; | ||
this.fsSelection = 0x40; // Characters are in the standard weight/style for the font. | ||
// 0x40 - REGULAR - Characters are in the standard weight/style for the font | ||
// 0x80 - USE_TYPO_METRICS - use OS/2.sTypoAscender - OS/2.sTypoDescender + OS/2.sTypoLineGap as the default line spacing | ||
// https://docs.microsoft.com/en-us/typography/opentype/spec/os2#fsselection | ||
// https://github.com/fontello/svg2ttf/issues/95 | ||
this.fsSelection = 0x40 | 0x80; | ||
// Non zero value can cause issues in IE, https://github.com/fontello/svg2ttf/issues/45 | ||
@@ -21,0 +27,0 @@ this.fsType = 0; |
{ | ||
"name": "svg2ttf", | ||
"version": "4.3.0", | ||
"version": "5.0.0", | ||
"description": "Converts SVG font to TTF font", | ||
@@ -36,5 +36,5 @@ "keywords": [ | ||
"devDependencies": { | ||
"eslint": "^5.10.0", | ||
"mocha": "^6.0.0" | ||
"eslint": "^7.0.0", | ||
"mocha": "^7.1.2" | ||
} | ||
} |
svg2ttf | ||
======== | ||
======= | ||
@@ -62,12 +62,6 @@ [](https://travis-ci.org/fontello/svg2ttf) | ||
Authors | ||
------- | ||
## svg2ttf for enterprise | ||
* Sergey Batishchev - [@snb2013](https://github.com/snb2013) | ||
* Vitaly Puzrin - [@puzrin](https://github.com/puzrin) | ||
Available as part of the Tidelift Subscription. | ||
License | ||
------- | ||
[MIT](https://github.com/nodeca/svg2ttf/blob/master/LICENSE). | ||
The maintainers of `svg2ttf` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-svg2ttf?utm_source=npm-svg2ttf&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) |
79684
1.3%2134
0.52%67
-8.22%