Skip to content

Commit

Permalink
[CLI] Font Rig: Font rename [Tool] 1.5 [Update]
Browse files Browse the repository at this point in the history
- Fix encoding detection problems;
  • Loading branch information
kateliev committed Oct 17, 2023
1 parent 406613c commit 181fef5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cli/python/fr-font-rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from fontTools import ttLib

# -- String -------------------------------------
__version__ = 1.4
__version__ = 1.5

tool_name = 'FR-RENAME'
tool_description = 'FontRig | Rename a *.ttf or *.otf file'
Expand All @@ -30,11 +30,7 @@ def _output(i, message):
def _get_record(record_list, index):
for record in record_list:
if record.nameID == index:
try:
return record.string.decode().replace('\x00','')

except UnicodeDecodeError:
return record.string
return record.string.decode(record.getEncoding())

def _set_record(record_list, index, value):
for record in record_list:
Expand Down

0 comments on commit 181fef5

Please sign in to comment.