Skip to content

Commit

Permalink
Fix 3270 naming
Browse files Browse the repository at this point in the history
[why]
Somehow the `IBM 3270 SemiCondensed` font turn out as
`IBM3270Semi Nerd Font Condensed`.

The 3270 font always had the quirk to have a non-standard style with a
dash. We have specific code to circumvent that.

[how]
After updating 3270 the 'Narrow' had been renamed to 'Condensed' and so
our specific patch did not work anymore.

Adapt the regex to find the new style that needs correction.

[note]
#1012 (comment)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
  • Loading branch information
Finii committed Jan 17, 2023
1 parent 1d8efb6 commit b52f0a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/scripts/name_parser/FontnameTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def _parse_simple_font_name(name):
@staticmethod
def parse_font_name(name):
"""Expects a filename following the 'FontFamilyName-FontStyle' pattern and returns ... parts"""
name = re.sub(r'\bsemi-narrow\b', 'SemiNarrow', name, 1, re.IGNORECASE) # Just for "3270 Semi-Narrow" :-/
name = re.sub(r'\bsemi-condensed\b', 'SemiCondensed', name, 1, re.IGNORECASE) # Just for "3270 Semi-Condensed" :-/
name = re.sub('[_\s]+', ' ', name)
matches = re.match(r'([^-]+)(?:-(.*))?', name)
familyname = FontnameTools.camel_casify(matches.group(1))
Expand Down

0 comments on commit b52f0a7

Please sign in to comment.