Permalink
Browse files

glyphs are rotated

  • Loading branch information...
1 parent f6fcb3d commit 50bde34c02393eabffd2996e60ccd70fb8614b51 nagi committed Oct 11, 2010
Showing with 26 additions and 6 deletions.
  1. +1 −0 fontcreator/config.cfg
  2. +15 −0 fontcreator/crazyfonter.py
  3. +4 −0 fontcreator/misc/useg_zurlaga_atom
  4. +6 −6 fontcreator/misc/useg_zurlaga_desc
@@ -15,6 +15,7 @@ FEATURE_FILE = misc/mongolbichig.fea
BASE_FONT = resources/DejaVuSans.sfd
# place where glyphs are
GLYPHS_DIR = /tmp/glyphs
+ROTATE = True
[Mongol useg]
USEG_ATOM = misc/useg_zurlaga_atom
@@ -12,6 +12,8 @@
import fontforge
import ConfigParser
import os
+import psMat
+from math import pi
# GLOBALS
MONGOL_USEG = ''
@@ -24,6 +26,7 @@
FULLNAME = ''
VERSION = ''
FONT = ''
+ROTATE = ''
# internal use
TMP_FONT = '/tmp/temp.sfd'
#BLANK_FONT = '../resources/blank.sfd'
@@ -62,6 +65,7 @@ def read_config():
global FAMILYNAME
global FULLNAME
global VERSION
+ global ROTATE
# read config files
config = ConfigParser.RawConfigParser()
config.read("config.cfg")
@@ -71,11 +75,13 @@ def read_config():
GLYPHS_DIR = config.get('Font creator', 'GLYPHS_DIR')
BASE_FONT = config.get('Font creator', 'BASE_FONT')
FEATURE_FILE = config.get('Font creator', 'FEATURE_FILE')
+ ROTATE = config.get('Font creator', 'ROTATE')
FONTNAME = config.get('General', 'FONTNAME')
FAMILYNAME = config.get('General', 'FAMILYNAME')
FULLNAME = config.get('General', 'FULLNAME')
VERSION = config.get('General', 'VERSION')
+
def read_lines(FileName):
f = file(FileName, 'r')
lines = f.readlines()
@@ -87,6 +93,7 @@ def read_lines(FileName):
def create_standart_zone(Usegs):
global GLYPHS_DIR
global FONT
+ global ROTATE
for letter in Usegs:
letter = letter.strip()
unizone=letter.split("uni")[1]
@@ -96,6 +103,8 @@ def create_standart_zone(Usegs):
# notice that font[glyphname] returns the appropriate glyph
fontpath = GLYPHS_DIR + '/' +letter+".svg"
FONT[letter].importOutlines(fontpath)
+ if ROTATE:
+ rotate_glyph(FONT[letter])
# TODO same spacing for each letter, this is a hack after all TODO!!
FONT[letter].left_side_bearing = 15
FONT[letter].right_side_bearing = 15
@@ -113,6 +122,8 @@ def create_private_zone(Usegs):
print "Glyph image file not found: ", fontpath
continue
FONT[letter].importOutlines(fontpath)
+ if ROTATE:
+ rotate_glyph(FONT[letter])
FONT[letter].left_side_bearing = -15
FONT[letter].right_side_bearing = -15
deccounter = deccounter + 1
@@ -145,5 +156,9 @@ def generate_font(FontFileName):
FONT.fontname = FONTNAME
FONT.generate(FontFileName)
+def rotate_glyph(Glyph):
+ matrix = psMat.rotate(pi/2)
+ Glyph.transform(matrix)
+
if __name__ == '__main__':
main()
@@ -9,6 +9,10 @@
# Мөр бүр дүрсний нэр, файлын нэр, тайлбар гэсэн бүтэцтэй бичигдэнэ.
# эхний хоёроос аль нэг нь байхгүй бол дүрс файлын нэр хоёулаа болох болно
# --------------------------------------------------------------
+fvs1
+fvs2
+fvs3
+mvs
v_4_points # Босоо дөрвөн цэг
one_point # Монгол бичгээр таслал буюу нэг цэг
v_points # Босоо хоёр цэг
@@ -24,14 +24,14 @@ uni1805 = mgl_point
uni1806 = нуруу
uni1807 = нуруу шүд
uni1807.medi = шүд
-uni1808 = NOT_READY
-uni1809 = NOT_READY
+uni1808 = one_point
+uni1809 = v_points
uni180A = нуруу
uni180A.mark = нуруу
-uni180B = NOT_READY
-uni180C = NOT_READY
-uni180D = NOT_READY
-uni180E = NOT_READY
+uni180B = fvs1
+uni180C = fvs2
+uni180D = fvs3
+uni180E = mvs
uni1810 = number0
uni1811 = number1
uni1812 = number2

0 comments on commit 50bde34

Please sign in to comment.