Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect definition of a SemiBold font weight. #1

Closed
Ulyanov-programmer opened this issue Sep 12, 2022 · 3 comments
Closed

Incorrect definition of a SemiBold font weight. #1

Ulyanov-programmer opened this issue Sep 12, 2022 · 3 comments

Comments

@Ulyanov-programmer
Copy link

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.

@tom2strobl
Copy link
Owner

tom2strobl commented Sep 13, 2022

@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!

@Ulyanov-programmer
Copy link
Author

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.

@tom2strobl
Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants