3
3
4
4
import os .path
5
5
import fontforge
6
+ import sys , logging
6
7
from argparse import ArgumentParser
7
8
8
9
sys .path .insert (0 , os .path .abspath (os .path .dirname (sys .argv [0 ])) + '/bin/scripts/name_parser/' )
@@ -23,7 +24,8 @@ SIL_TABLE = [('cascadia ?(code|mono)( ?pl)?', args.name), ]
23
24
print ("\n Renaming process\n {}\n as {}\n -> {}" .format (args .input , args .orig , args .output ))
24
25
25
26
fname = os .path .splitext (os .path .basename (args .orig ))[0 ]
26
- n = FontnameParser (fname )
27
+ logger = logging .getLogger ()
28
+ n = FontnameParser (fname , logger )
27
29
n .add_name_substitution_table (SIL_TABLE )
28
30
n .set_keep_regular_in_family (False )
29
31
if not n .parse_ok :
@@ -36,15 +38,15 @@ delugia=fontforge.open(args.input)
36
38
n .rename_font (delugia )
37
39
38
40
# Other information
39
- delugia .appendSFNTName ("English (US)" , "UniqueID" , "{};{}" .format (args .version , n .ps_fontname ()))
41
+ delugia .appendSFNTName ("English (US)" , "UniqueID" , "{};{}" .format (args .version , n .psname ()))
40
42
delugia .appendSFNTName ("English (US)" , "Trademark" , "" )
41
43
42
44
# Mix our version information in
43
45
delugia .sfntRevision = None # Auto-set (refreshed) by fontforge
44
46
delugia .appendSFNTName ("English (US)" , "Version" , args .version )
45
47
delugia .version = args .version
46
48
47
- if n .ps_fontname ().lower ().find ("mono" ):
49
+ if n .psname ().lower ().find ("mono" ):
48
50
# For MS-Windows console apps
49
51
panose = list (delugia .os2_panose )
50
52
if panose [0 ] < 3 : # https://forum.high-logic.com/postedfiles/Panose.pdf
0 commit comments