In chemistry, molecular structures are often represented as skeletal formulas. When these formulas are rendered on a computer screen, the quality of the rendering can be poor, especially when the formulas are complex. I've built this Structural Formula Viewer tool to try to address this problem.
One of the key features of this viewer is how it handles the rendering of labels within the structures and the "kerning" between the labels and the bonds. I've built a custom algorithm to calculate the optimal distance between the labels and the bonds that takes into account the precise shapes of the glyphs, pixel by pixel. The result is a high-quality rendering of the structures. In the demo below, you can drag the atoms around to see how the labels are rendered.