Anonymous avatar Anonymous committed ae92e3e

Enabled unicode mode in font generator.

Comments (0)

Files changed (1)

contrib/gen_sfont_image.py

     if argv is None:
         argv = sys.argv
 
-    if len(argv) != 5:
-        sys.exit("Usage: python font.py /path/to/font.ttf font_size(e.g. 11) font_color(e.g. 000000) /path/to/save/dir/")
+    print len(argv)
+    if len(argv) < 5:
+        sys.exit("Usage: python font.py /path/to/font.ttf font_size(e.g. 11) font_color(e.g. 000000) /path/to/save/dir/ [unicode]")
 
     ttf_font_fullpathname = argv[1]
     fontsize = int(argv[2])
     fontcolor = argv[3]
     fontpng = argv[4]
-    ttf2image(ttf_font_fullpathname, fontsize, fontcolor, fontpng)
+    if len(argv) > 5:
+        use_unicode = True
+    else:
+        use_unicode = False
+    ttf2image(ttf_font_fullpathname, fontsize, fontcolor, fontpng, use_unicode)
 
 if __name__ == "__main__":
     sys.exit(main())
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.