1
1
#!/usr/bin/env python
2
2
3
- from __future__ import division
3
+ from __future__ import division , print_function
4
4
5
5
import fontforge
6
6
import time
@@ -427,7 +427,7 @@ def find_centerpoint(edgepoint):
427
427
# it earlier in the next_point(curpt) call.
428
428
start_from = find_centerpoint (curpt )
429
429
if start_from is None :
430
- print "find_centerpoint({}) failed..." .format (curpt )
430
+ print ( "find_centerpoint({}) failed..." .format (curpt ) )
431
431
start_from = curpt
432
432
edit_line_after_recording = False
433
433
else :
@@ -519,17 +519,17 @@ def create_dotted_font(fname):
519
519
glyph = input_font [glyphname ]
520
520
new_glyph = new_font [glyphname ]
521
521
new_glyph .clear ()
522
- print "Processing glyph at codepoint U+{:04X} named {}" .format (glyph .encoding , glyphname )
522
+ print ( "Processing glyph at codepoint U+{:04X} named {}" .format (glyph .encoding , glyphname ) )
523
523
glyph .unlinkRef ()
524
524
copy_glyph (glyph , new_glyph )
525
525
font_type = args .output .lower ().rsplit ('.' , 1 )[- 1 ]
526
526
if font_type == 'sfd' :
527
527
new_font .save (args .output )
528
528
else :
529
529
new_font .generate (args .output )
530
- print "Dotted font created as" , args .output
530
+ print ( "Dotted font created as" , args .output )
531
531
if args .visualize :
532
- print "Press any key to exit"
532
+ print ( "Press any key to exit" )
533
533
import visualization
534
534
visualization .wait_for_keypress (args .em , args .zoom )
535
535
@@ -546,7 +546,7 @@ def extraction_demo(fname, letter):
546
546
glyph = font [codepoint ]
547
547
glyph .unlinkRef ()
548
548
dots = extract_dots (glyph , args .visualize )
549
- print "{} dots found" .format (len (dots ))
549
+ print ( "{} dots found" .format (len (dots ) ))
550
550
if args .visualize :
551
551
import visualization
552
552
visualization .wait_for_keypress (args .em , args .zoom )
@@ -674,9 +674,9 @@ def debug(s, *args, **kwargs):
674
674
if not DEBUG :
675
675
return
676
676
if not args and not kwargs :
677
- print s
677
+ print ( s )
678
678
else :
679
- print s .format (* args , ** kwargs )
679
+ print ( s .format (* args , ** kwargs ) )
680
680
681
681
def parse_args ():
682
682
"Parse the arguments the user passed in"
0 commit comments