diff --git a/bin/scripts/name_parser/FontnameTools.py b/bin/scripts/name_parser/FontnameTools.py index 93904d3254..2e848eed62 100644 --- a/bin/scripts/name_parser/FontnameTools.py +++ b/bin/scripts/name_parser/FontnameTools.py @@ -289,8 +289,9 @@ def weight_string_to_number(w): """ Convert a common string approximation to a PS/2 weight value """ if not isinstance(w, str) or len(w) < 1: return 400 + w = w.lower().replace('-', '').replace(' ', '') for num, strs in FontnameTools.equivalent_weights.items(): - if w.lower() in strs: + if w in strs: return num return None