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

More precise widths #1

Closed
Tethik opened this issue Aug 28, 2017 · 0 comments
Closed

More precise widths #1

Tethik opened this issue Aug 28, 2017 · 0 comments

Comments

@Tethik
Copy link
Owner

Tethik commented Aug 28, 2017

Right now I guesstimate the width of the texts to be simply 5 * len(text). However this is not quite the same as the shields.io specification, and badger will in the sample case generate an image that is one pixel wider than the shields.io one.

The way shields.io does it is by using pdfkit and literally measuring the width. I think most efficient way would probably be to read the font files from the OS (or bundle them with the package) and calculate the correct width that way.

@Tethik Tethik closed this as completed in d6641e1 Sep 12, 2017
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

1 participant