From 438843d57ab4e551d929d5452caa4f32c8ab7228 Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Mon, 22 May 2023 12:51:15 +0200 Subject: [PATCH] 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 Signed-off-by: Fini Jastrow --- bin/scripts/name_parser/FontnameParser.py | 3 +++ font-patcher | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/scripts/name_parser/FontnameParser.py b/bin/scripts/name_parser/FontnameParser.py index 544452aa9..248f0d154 100644 --- a/bin/scripts/name_parser/FontnameParser.py +++ b/bin/scripts/name_parser/FontnameParser.py @@ -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 diff --git a/font-patcher b/font-patcher index 97ac4e2e8..6f1fad4d8 100755 --- a/font-patcher +++ b/font-patcher @@ -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"