I did this by leveraging ratatui-image, which I also had written for another thing. MdFried tries to get your terminal's font, or otherwise prompts you with a font picker. The headers are then rendered as images with cosmic-text. Notably, on kitty there is a [text sizing protocol], which is implemented by MdFried as alternative.
Images are of course also displayed. Note that not every terminal can display images, or display images reliably enough for a TUI. Your best bets are popular terminals such as Kitty, Ghostty, Foot, or WezTerm. Terminals that don't have image support can of course still use MdFried as plain (and boring) markdown viewer.
[text sizing protocol]: https://sw.kovidgoyal.net/kitty/text-sizing-protocol