Permalink
Browse files

almost ready!

  • Loading branch information...
nagi nagi
nagi authored and nagi committed Sep 27, 2010
1 parent 51f564c commit da52927e78718b670c1b6e0eadb990abd1b855e7
Showing with 20 additions and 11 deletions.
  1. +1 −1 fontcreator/config.cfg
  2. +2 −1 fontcreator/misc/useg_zurlaga_atom
  3. +4 −4 fontcreator/misc/useg_zurlaga_desc
  4. +13 −5 fontcreator/mongoluseg.py
View
@@ -14,4 +14,4 @@ GLYPHS_DIR = /tmp/svgs
USEG_ATOM = misc/useg_zurlaga_atom
USEG_DESC = misc/useg_zurlaga_desc
ATOM_FOLDER = atoms
-GLYPH_OUT = tmp/glyphs
+GLYPH_OUT = /tmp/glyphs
@@ -71,8 +71,9 @@ number9
к k # К эхэнд
к-дунд kmedi # K дунд
к-сүүлд kfina # К сүүлд
-кх-эхэнд khstart # KX эхэнд
+кх kh # KX эхэнд
кх-дунд khmedi # КХ дунд
+кх-сүүлд khfina # КХ сүүлд
ца cha # ЦА
за dza # ЗА
лха lha # ЛХА гэдэс
@@ -225,7 +225,7 @@ uni182C.fina = шүд богино-сүүл
uni182C.finavar1 = шүд богино-сүүлГ
uni182C.finavar2 = шүд богино-сүүл
uni182C.init = ха
-uni182C.initfem = хэ
+uni182C.initfem = гэ
uni182C.initvar1 = га
uni182C.isolfem = гэГ
uni182C.medi = шүд шүд
@@ -332,7 +332,7 @@ uni182D1825.medivar1 = хөГ нуруу
uni182D1825.medivar2 = хө нуруу шилбэ
uni182D1825.medivar3 = хөГ нуруу шилбэ
uni182D1825.var1 = хөГ
-uni182D1825.var2 = хө хуруу оготорсүүл
+uni182D1825.var2 = хө нуруу оготорсүүл
uni182D1825.var3 = хөГ нуруу оготорсүүл
uni182D1826 = хө
uni182D1826.fina = хө
@@ -462,8 +462,8 @@ uni18391827 = фо в-гэдэс оготорсүүл
uni18391827.fina = фо в-гэдэс оготорсүүл
uni18391827.init = фо в-гэдэс
uni18391827.medi = фо в-гэдэс
-uni183A = k
-uni183A.fina = k-сүүлд
+uni183A = к
+uni183A.fina = к-сүүлд
uni183A.init = к
uni183A.initvar1 = гэ-нум
uni183A.medi = к
View
@@ -3,7 +3,9 @@
# crazy font creator
#
import ConfigParser
+import subprocess
import re
+import os
def main():
# read config file
@@ -14,14 +16,16 @@ def main():
USEG_DESC = config.get('Useg zurah', 'USEG_DESC')
ATOM_FOLDER=config.get('Useg zurah', 'ATOM_FOLDER')
GLYPH_OUT = config.get('Useg zurah', 'GLYPH_OUT')
+ if not os.path.exists(GLYPH_OUT):
+ os.makedirs(GLYPH_OUT)
# read atom and desc
usegatoms = readlines(USEG_ATOM)
usegdesc = readlines(USEG_DESC)
atoms = read_atoms(usegatoms)
descs = read_desc(usegdesc)
#for k, v in descs.items():
# print k, ' = ', v
- useg_uusge(atoms, descs, ATOM_FOLDER)
+ useg_uusge(atoms, descs, GLYPH_OUT)
# TODO: check file if exits!
def useg_uusge(Atoms, Desc, AFolder):
@@ -32,11 +36,15 @@ def useg_uusge(Atoms, Desc, AFolder):
if not I in atomkeys:
print Name, ':', "Key not found: ", I
break
- if l == ' ':
+ if I == ' ':
continue
li.append(AFolder+'/' + Atoms[I] + '.svg')
- Cmd = 'pythonx ' + " ".join(li) + ' > ' + Name + '.svg'
- print Cmd
+ Cmd = 'pythonx ' + " ".join(li) + ' > ' + AFolder +'/'+Name + '.svg'
+ Cmd1 = Cmd.split(' ')
+ if not subprocess.call(Cmd, shell=True) == 0:
+ print "Not created: " + Cmd
+ else:
+ print Name, " created succesfully!"
def read_atoms(List):
dic = dict()
@@ -69,7 +77,7 @@ def read_desc(List):
return dic
def splitAndStrip(Line, Pattern):
- return [ X.strip() for X in Line.split(Pattern)]
+ return [ X.strip() for X in Line.split(Pattern) if X != '']
def isEmptyOrComment(Line):
if Line.startswith('#') or len(Line) == 0:

0 comments on commit da52927

Please sign in to comment.