FontnameParser: Fix fsSelection for --has-no-italic

[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 <liaoya@gmail.com>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2023-05-22 12:51:15 +02:00 committed by Fini
parent 6903e2f393
commit 438843d57a
2 changed files with 4 additions and 1 deletions

View file

@ -252,6 +252,9 @@ class FontnameParser:
# 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

View file

@ -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"