Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Commit bdff2e0

Browse files
authored
patch fixing static fonts renaming
changed name ID 1 and name ID 2
1 parent b6185a4 commit bdff2e0

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

fontbro/font.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,10 +984,19 @@ def rename(self, family_name="", style_name="", style_flags=True):
984984
postscript_name_old, postscript_name
985985
)
986986

987+
if not style_name in ["Regular", "Bold", "Italic", "Bold Italic"]:
988+
ext = " ".join(style_name.replace("Italic", "").split())
989+
if ext:
990+
family_name = f"{typographic_family_name} {ext}"
991+
if "Italic" in style_name:
992+
style_name = "Italic"
993+
else:
994+
style_name = "Regular"
995+
987996
# update name records
988997
names = {
989998
self.NAME_FAMILY_NAME: family_name,
990-
self.NAME_SUBFAMILY_NAME: subfamily_name,
999+
self.NAME_SUBFAMILY_NAME: style_name,
9911000
self.NAME_UNIQUE_IDENTIFIER: unique_identifier,
9921001
self.NAME_FULL_NAME: full_name,
9931002
self.NAME_POSTSCRIPT_NAME: postscript_name,

0 commit comments

Comments
 (0)