Ejemplo n.º 1
0
#-*- coding: utf-8 -*-
import codecs
from TTFRender import generate, get_token_list

token_list = []
file=codecs.open('TTFRender/char.txt','r','utf-8')
while 1:
  char = file.read(1)
  if not char: break
  token_list.append(char)

print token_list

#token_list = ["有","志","者","事","竟","成","中","午"]
ttf_file   = "TTFRender/fonts/new_current.ttf"

generate(token_list, "current.ttf", ttf_file)
Ejemplo n.º 2
0
#-*- coding: utf-8 -*-

from TTFRender import generate, get_token_list


str = """
一
"""

token_list = get_token_list(str)
ttf_file   = "new.ttf"

generate(token_list, "kai", ttf_file)
Ejemplo n.º 3
0
#-*- coding: utf-8 -*-
import codecs
from TTFRender import generate, get_token_list

token_list = []
file = codecs.open('TTFRender/char.txt', 'r', 'utf-8')
while 1:
    char = file.read(1)
    if not char: break
    token_list.append(char)

print token_list

#token_list = ["有","志","者","事","竟","成","中","午"]
ttf_file = "TTFRender/fonts/new_current.ttf"

generate(token_list, "current.ttf", ttf_file)
Ejemplo n.º 4
0
#-*- coding: utf-8 -*-

from TTFRender import generate, get_token_list

# read content.txt file
txtFile = open('content.txt')
str = txtFile.read()
token_list = get_token_list(str)
src_ttf_file = "MComicPRC-Medium"
out_ttf_file   = "MComicPRC-Medium"
print(out_ttf_file)
# generate new font file
generate(token_list, src_ttf_file, out_ttf_file)
Ejemplo n.º 5
0
#-*- coding: utf-8 -*-

from TTFRender import get_token_list
from TTFRender import generate

data = open("data.js").read()
data = eval(data)

title = data['title']
posts = data['posts'][0]
contents = posts['contents']

A = []
B = []

for content in contents:
    if content['type'] == 'headline':
        A = A+get_token_list(content['data']['text'])
    elif content['type'] == 'paragraph':
        B = B+get_token_list(content['data']['text'])
    else:
        continue

A = list(set(A))
B = list(set(B))

generate(A, 'A', 'A.ttf')
generate(B, 'B', 'B.ttf')