Skip to content

Commit

Permalink
FontnameParser: Fix fsSelection for --has-no-italic
Browse files Browse the repository at this point in the history
[why]
For fonts that have no Italic but an Oblique - i.e. when Oblique shall
replace the Italic role in RIBBI font grouping (classic group of 4) -
that grouping fails.

This affects DejaVu on Putty.

[how]
For RIBBI grouping only the classic bits are considered. That means that
for fonts that have Oblique instead of Italic (and not additionally) we
need to set the ITALIC bit and the OBLIQUE bit. This has been
overlooked.

Cite from the specs:

> This bit, unlike the ITALIC bit (bit 0), is not related to style-linking
> in applications that assume a four-member font-family model comprised
> of regular, italic, bold and bold italic. It may be set or unset
> independently of the ITALIC bit. In most cases, if OBLIQUE is set, then
> ITALIC will also be set, though this is not required.

[note]
Also increase font-patcher version.

Fixes: #1249

Reported-by: Huifeng Shen <[email protected]>
Signed-off-by: Fini Jastrow <[email protected]>
  • Loading branch information
Finii committed May 22, 2023
1 parent 6903e2f commit 438843d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions bin/scripts/name_parser/FontnameParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ def fs_selection(self, fs):
# Ignore Italic if we have Oblique
if 'Oblique' in self.weight_token:
b |= OBLIQUE
if not self.rename_oblique:
# If we have no dedicated italic, than oblique = italic
b |= ITALIC
elif 'Italic' in self.style_token:
b |= ITALIC
# Regular is just the basic weight
Expand Down
2 changes: 1 addition & 1 deletion font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from __future__ import absolute_import, print_function, unicode_literals

# Change the script version when you edit this script:
script_version = "4.3.1"
script_version = "4.3.2"

version = "3.0.1"
projectName = "Nerd Fonts"
Expand Down

0 comments on commit 438843d

Please sign in to comment.