Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added vs table script

  • Loading branch information...
commit bf66e12fabbca06e71f56ff0ef1de43355a3de4e 1 parent 91b916c
nagi authored
Showing with 85 additions and 0 deletions.
  1. +5 −0 fontcreator/config.cfg
  2. +80 −0 fontcreator/vs_table.py
View
5 fontcreator/config.cfg
@@ -22,3 +22,8 @@ USEG_ATOM = misc/useg_zurlaga_atom
USEG_DESC = misc/useg_zurlaga_desc
ATOM_FOLDER = ../../mongoluseg/sudar
GLYPH_OUT = /tmp/glyphs
+
+[VS TABLE]
+V1_FOLDER = png
+V2_FOLDER = png_sudar
+MGL_LETTERS = misc/mglletters.txt
View
80 fontcreator/vs_table.py
@@ -0,0 +1,80 @@
+#!/usr/bin/env python
+# __ __ ___ _ _ ____ ___ _ _ _ ____ _____ ____
+# | \/ |/ _ \| \ | |/ ___|/ _ \| | | | | / ___|| ____/ ___|
+# | |\/| | | | | \| | | _| | | | | | | | \___ \| _|| | _
+# | | | | |_| | |\ | |_| | |_| | |___ | |_| |___) | |__| |_| |
+# |_| |_|\___/|_| \_|\____|\___/|_____| \___/|____/|_____\____|
+#
+# vs table generator
+# Author: nagi (natsag2000@googlemail.com)
+#
+
+import ConfigParser
+import os
+import sys
+
+# GLOBALS
+V1_FOLDER = ''
+V2_FOLDER = ''
+MGL_LETTERS = ''
+
+def main(Filename):
+ global V1_FOLDER
+ global V2_FOLDER
+ global MGL_LETTERS
+ html = []
+ read_config()
+ mongoluseg = read_lines(MGL_LETTERS)
+ F = open(Filename, 'w')
+ F.write(get_html_head())
+ F.writelines(make_table(V1_FOLDER, V2_FOLDER, mongoluseg))
+ F.write(get_html_foot())
+ F.close()
+
+def make_table(f1, f2, letters):
+ t = []
+ for l in letters:
+ l = l.strip()
+ l = l.replace("\n", '')
+ t.append('<tr><td><img src='+f1+'/'+l+'.png></td><td><img src='+f2+'/'+l+'.png></td><td>'+l+'</td></tr>\n')
+ return t
+
+def get_html_foot():
+ return '</table></body></html>'
+
+def get_html_head():
+ h = '<head> \
+<meta http-equiv="Content-Type" content="text/html; \
+charset=UTF-8" /> \
+</head> \
+<body> \
+<h1> \
+<table>'
+ return h
+
+def read_config():
+ global V1_FOLDER
+ global V2_FOLDER
+ global MGL_LETTERS
+ # read config files
+ config = ConfigParser.RawConfigParser()
+ config.read("config.cfg")
+ # TODO: check if they exist!
+ V1_FOLDER = config.get('VS TABLE', 'V1_FOLDER')
+ V2_FOLDER = config.get('VS TABLE', 'V2_FOLDER')
+ MGL_LETTERS = config.get('VS TABLE', 'MGL_LETTERS')
+
+def read_lines(FileName):
+ f = file(FileName, 'r')
+ lines = f.readlines()
+ f.close()
+ return lines
+
+def usage():
+ print "USAGE: " + sys.argv[0] + " html_file_name"
+ sys.exit()
+
+if __name__ == '__main__':
+ if len(sys.argv) != 2:
+ usage()
+ main(sys.argv[1])
Please sign in to comment.
Something went wrong with that request. Please try again.