Bold font vs faux bold - how does iTerm choose a bold font?

274 views
Skip to first unread message

Timothy Reen

unread,
Jun 9, 2018, 1:39:52 AM6/9/18
to iterm2-discuss
I run with the 'Draw bold text in bold font' option set.

Most of the time this works great — e.g. with the font set to Menlo Regular, bold text is rendered in Menlo Bold.

If the typeface doesn't have a bold font (e.g. Monaco), bold text is rendered as 'faux bold' — just the regular font, distorted to look more bold. Given there's no other option, that's fine.

But sometimes a bold font will be available, but iTerm will use faux bold instead.

On iTerm2 Build 3.1.6beta5, if I select IBM Plex Mono Regular, bold text is rendered with IBM Plex Mono Bold and it looks great. But if I select IBM Plex Mono Medium, iTerm uses faux bold for bold text.

If I better understood the logic iTerm applies to find the right font, I thought it might be possible to change my font the names or metadata.

Based on this information from FontBook.app, it seems there's more going on than just using the bold style font of the same family...otherwise IBM Plex Mono Bold would be used when the main font is Medium, as well as Regular.

PostScript name: IBMPlexMono
Full name: IBM Plex Mono
Family: IBM Plex Mono
Style: Regular
Kind: OpenType TrueType
Script: Cyrillic, Latin
Version: Version 2.000
Location: /Users/tim/Library/Fonts/IBMPlexMono-Regular.ttf
Unique name: 2.000;IBM ;IBMPlexMono

PostScript name: IBMPlexMono-Bold
Full name: IBM Plex Mono Bold
Family: IBM Plex Mono
Style: Bold
Kind: OpenType TrueType
Script: Cyrillic, Latin
Version: Version 2.000
Location: /Users/tim/Library/Fonts/IBMPlexMono-Bold.ttf
Unique name: 2.000;IBM ;IBMPlexMono-Bold

PostScript name: IBMPlexMono-Medium
Full name: IBM Plex Mono Medium
Family: IBM Plex Mono
Style: Medium
Kind: OpenType TrueType
Script: Cyrillic, Latin
Version: Version 2.000
Location: /Users/tim/Library/Fonts/IBMPlexMono-Medium.ttf
Unique name: 2.000;IBM ;IBMPlexMono-Medium

George Nachman

unread,
Jun 11, 2018, 1:37:20 PM6/11/18
to iterm2-...@googlegroups.com
The algorithm looks for a font whose weight is bold relative to the selected weight by at least 4 units (on a 0-9 scale). IBM Plex Mono Medium has a weight of 6 and Bold has a weight of 9, so they're not considered different enough. The difference of 4 was picked conservatively so there'd be an obvious difference between regular and bold, but of course some fonts will work fine with a smaller difference.

I've added an advanced pref "Minimum weight difference between regular and bold font" that lets you tweak this and it'll be in the next beta.

--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Timothy Reen

unread,
Jun 13, 2018, 9:14:11 PM6/13/18
to iterm2-discuss
Thank you! 🙇‍♂️
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discus...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages