From 9f6f89ae415a73d3b2a1b40f4dfb682ec1bc28ef Mon Sep 17 00:00:00 2001 From: negset <15167516+negset@users.noreply.github.com> Date: Wed, 10 May 2023 16:50:50 +0900 Subject: [PATCH] name-parser: Fix REGULAR bit of fsSelection Set bit 6 (REGULAR) of fsSelection only when bit 0 (ITALIC), bit 5 (BOLD), and bit 9 (OBLIQUE) are clear. --- bin/scripts/name_parser/FontnameParser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/scripts/name_parser/FontnameParser.py b/bin/scripts/name_parser/FontnameParser.py index 2fb206017..544452aa9 100644 --- a/bin/scripts/name_parser/FontnameParser.py +++ b/bin/scripts/name_parser/FontnameParser.py @@ -255,7 +255,7 @@ class FontnameParser: elif 'Italic' in self.style_token: b |= ITALIC # Regular is just the basic weight - if len(self.weight_token) == 0: + if len(self.weight_token) == 0 and not b & (ITALIC | BOLD | OBLIQUE): b |= REGULAR b |= WWS # We assert this by our naming process return b