Chemical kerning

Chemical drawing software uses various heuristics or hard-coded rules to determine the spacing between labels and bond lines. This leads to suboptimal results, with the structures looking either cramped or too spaced out.

To improve the appearance of chemical structures, we should consider the shapes of the glyphs and adjust the spacing between atoms and bonds accordingly. I call this "chemical kerning".

In the demo below, the gaps between atoms and bonds are calculated based on the offsetted glyph shapes to create the desired optical spacing. The result is a more visually pleasing structure.

You can edit the label to see how the kerning changes and even try inserting emojis.

Demo

F

See also

Made by Anton Vasetenkov.

If you want to say hi, you can reach me on LinkedIn or via email. If you like my work, you can support me by buying me a coffee.