# markdown_preview: Independent code font family \(\#56744\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/003e8211770eb0dbe334f82c01d3f2c095c65a93)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 003e8211770eb0dbe334f82c01d3f2c095c65a93

Requested commit: 003e8211770eb0dbe334f82c01d3f2c095c65a93

Commit: 003e8211770eb0dbe334f82c01d3f2c095c65a93

Tree: bd78f0e8eb3ce3ad8267c2ae30d03a0c114efb76

Author: Lee Nussbaum

Committer: GitHub

## Message

````
markdown_preview: Independent code font family (#56744)

Adds a `markdown_preview_code_font_family` setting that overrides the
font used in the markdown preview for code — inline `code` spans and
fenced code blocks.
This is the counterpart to `markdown_preview_font_family` (#54003),
which already does this for body text. Together they let you choose a
typographically matched body + code font pair for the preview without
forcing the code font onto editor buffers, where it may not be a good
coding font:

```json
{
  "markdown_preview_font_family": "Noto Serif",
  "markdown_preview_code_font_family": "Noto Sans Mono"
}
```

Behavior mirrors `markdown_preview_font_family`:
- Scoped to the markdown preview only (`MarkdownFont::Preview`). The
agent panel, notifications, hover popovers, and REPL output are
unaffected — they keep using the buffer font for code.
- Falls back to the buffer font family when unset, so existing previews
are unchanged.
- Overrides the font family only; fallbacks and features still come from
the buffer font.

Before (uses buffer font, here Iosevka):

<img width="509" height="368" alt="Screenshot 2026-05-14 at 1 39 51 PM"
src="https://github.com/user-attachments/assets/6b7e49b2-fc6e-4db1-9679-392b3447f411"
/>

After (uses specified font, here Noto Sans Mono):

<img width="508" height="368" alt="Screenshot 2026-05-14 at 1 40 51 PM"
src="https://github.com/user-attachments/assets/f911c99b-08f8-4336-83eb-54b555f11c54"
/>

Release Notes:

- Added `markdown_preview_code_font_family` to override the code font in
the markdown preview
````

## Parents

- [f22650bca5ac750bb557c518b0f005b28230845f](https://git.cafe/gitcafe/zed/commit/f22650bca5ac750bb557c518b0f005b28230845f?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/003e8211770eb0dbe334f82c01d3f2c095c65a93?format=markdown)
