You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using the library, I noticed that fonts with SemiBold in the name return an incorrect value when processing their weight.
Expected: let weight = parseNumericWeightFromName('Helvetica Neue SemiBold') console.log(weight) // 600
Exit: let weight = parseNumericWeightFromName('Helvetica Neue SemiBold') console.log(weight) // 700
I tried three names: "Helvetica Neue SemiBold", "HelveticaNeueSemiBold", "HelveticaNeue-SemiBold", but in none of the cases was the weight determined correctly.
Your library was uploaded via NPM.
The text was updated successfully, but these errors were encountered:
@Ulyanov-programmer
Thank you so much for the bugfind!
I fixed it in in 1.0.1, along with a handful of new tests to assure expected behaviour in that regard.
Please let me know if you find more cases!
Always happy to help!
By the way, I also tested names with extensions like Font-Name.ttf and Font-Name.woff, everything worked correctly.
Consider adding parsing of such files to the readme so that users do not delete the extension before using the functions of your library.
Sure, why not – added it to the readme. In theory you may supply full file paths with parent directory names as well as long as there are no contradictory directory names, eg. /extralight/Font-Bold.ttf. But I won't recommend the latter in the readme to avoid confusion.
Thanks!
While using the library, I noticed that fonts with SemiBold in the name return an incorrect value when processing their weight.
Expected:
let weight = parseNumericWeightFromName('Helvetica Neue SemiBold')
console.log(weight) // 600
Exit:
let weight = parseNumericWeightFromName('Helvetica Neue SemiBold')
console.log(weight) // 700
I tried three names: "Helvetica Neue SemiBold", "HelveticaNeueSemiBold", "HelveticaNeue-SemiBold", but in none of the cases was the weight determined correctly.
Your library was uploaded via NPM.
The text was updated successfully, but these errors were encountered: