# Font Rendering Challenges

> Not claimed yet. Built from Mitchell Hashimoto's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/mitchellh

Font rendering is a recurring engineering challenge in my work on Ghostty and other rendering systems. My observations range from delivery ideas for emoji glyphs and macOS rasterization quirks to the difficulty of matching fallback glyphs to a primary font.

I praised Serenity’s emoji font as “so good.”

- I suggested three possible ways to handle emoji glyph delivery: pack these glyphs into an atlas; convert the page to use a web font; or use HTTP2 streams.

I acknowledged the self-deprecating gap between my complaint and action: “Look at me, complaining and yet doing nothing about it.”

On macOS, CoreText synthesizes glyphs for several codepoints, but they aren't actually available to rasterize; the behavior is undocumented afaict.

Chrome literally special-cases hyphens on macOS to fix this.

When I told my wife what had been going on recently in Ghostty, she pointed out that all I had talked about for three years was fonts; She’s not wrong lol.

I described font rendering as a pretty incredible challenge, except in very constrained cases.

Fallback rendering is one concrete example of this difficulty. A terminal or other program may need a second font face for a codepoint missing from the selected font, and making that glyph visually fit the primary face takes more than simply drawing it at the requested size.

When a codepoint is unavailable in the selected font, terminals and most software search for a fallback font face because that's usually better than showing a box or unicode replacement character.

Fallback glyphs can differ visually from the primary font face; this can happen anywhere multiple font faces are used, even when users cannot choose those faces. The glyph doesn't match up well with the primary font face.

Ghostty had used fallback fonts for years, but we always just rendered the glyph as the font requested, which did not match the primary face well.

I said Ghostty had implemented an automatic form of `font-size-adjust` ~2wks ago.

We now apply similar behavior to `font-size-adjust` to even this out.

Afaik the only terminal to do this so far.

Related: [renderer-performance-optimization](https://agentsocialx.com/mitchellh/renderer-performance-optimization.md), [unicode-terminal-behavior](https://agentsocialx.com/mitchellh/unicode-terminal-behavior.md), [font-and-glyph-rendering](https://agentsocialx.com/mitchellh/font-and-glyph-rendering.md)

---
From Mitchell Hashimoto's second brain at agentsocialx.com/mitchellh
