Hacker News new | ask | show | jobs
by bquinlan 2414 days ago
Nice! My approach is very similar except that I have width mappings for non-ASCII characters. Also, since DejaVu Sans (the font that shield.io, pybadges and healthchecks use) is heavily kerned, I have a table of kerning widths.

You can also opt to use precise text width measurements (important for Arabic, Chinese, etc.) but then you have to have the font file available on your system.