TIL: OpenType CFF Widths 0 ▲ Yash Garg 32 minutes ago · Tech · hide Why a patched font can look fine on macOS and break on Windows.Recently, I added a toggleable GTA display font to this site (check out the small lever at the bottom). The only issue was that it didn’t have a µ glyph, so µblog fell back to monospace for just the first letter. I patched a matching µ straight into the font by cloning its u and extending the left stem down. I was pleased by the font and everything was looking great on macOS. Then I checked the site on Windows and noticed there was space between the glyph and the next character. Apparently, OpenType CFF fonts store a glyph’s advance width1 in two places: the hmtx spacing table (which had the right 575) and optionally as an extra first number inside the glyph’s Type 2 CFF CharString2. The catch is that this number isn’t the actual width, it’s an offset added on top of a base width (Private.nominalWidthX). In this font, defaultWidthX is 575 and nominalWidthX is 541. My first patch put [575, 30, -199, 'rmoveto', ...],… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town