Discussion:
[iterm2-discuss] Bold font vs faux bold - how does iTerm choose a bold font?
Timothy Reen
2018-06-09 05:39:52 UTC
Permalink
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
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
George Nachman
2018-06-11 17:36:57 UTC
Permalink
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.
Post by Timothy Reen
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
--
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
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Timothy Reen
2018-06-14 01:14:11 UTC
Permalink
Thank you! 🙇‍♂
Post by George Nachman
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.
Post by Timothy Reen
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
--
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
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...