示例#1
0
    def __init__(self):
        # distribution over the type of text:
        load_cfg(self)

        self.curvature = Curvature()

        # text-source : gets english text:
        self.corpora = Corpora()

        # get font-state object:
        self.text_state = TextState()

        pygame.init()
示例#2
0
    def __init__(self):
        """
        TXT_FP : path to file containing text data.
        """
        load_cfg(self)
        #fp = osp.join(self.data_dir, 'newsgroup/newsgroup.txt')
        #fp = osp.join(self.data_dir, 'newsgroup/alpha_words.txt')
        self.fdict = {
            'WORD': self.sample_word,
            'LINE': self.sample_line,
            'PARA': self.sample_para
        }

        with open(self.corpora_fp, 'r') as f:
            self.txt = [l.strip() for l in f.readlines()]
示例#3
0
 def __init__(self):
     # # get a list of background-images:
     # imlist = [osp.join(im_path,f) for f in os.listdir(im_path)]
     # self.bg_list = [p for p in imlist if osp.isfile(p)]
     load_cfg(self)
     self.font_color = FontColor(self.font_fp)
示例#4
0
 def __init__(self):
     load_cfg(self)
示例#5
0
 def __init__(self):
     load_cfg(self)
     self.text_render = text_renderer.TextRenderer()
     self.colorizer = Colorizer()