Example #1
0
 def load_text(self, string, font_size=None, font_path=None, color=None):
     if not font_path:
         assert os.path.isfile(share.GLOBAL_FONT_PATH)
     if not string:
         return
     try:
         self.clear()
         self.text = string
         for pimg in image_list_from_text(string, self.length_once,
                                          self.width, self.height,
                                          font_path, font_size, color):
             img = image.Image(show=False)
             img.set_image(image.image_from_auto_resize(pimg))
             self.image_list.append(img)
         self.start_index = 0
         self.end_index = len(self.image_list) - 1
         self.index_range = len(self.image_list)
         self.setup()
     except:
         log.err(
             repr(self),
             string,
             font_size,
             font_path,
             color,
             traceback.format_exc(),
         )
Example #2
0
	def load_text(self, string, font_size=None, font_path=None, color=None):
		if not font_path:
			assert os.path.isfile(share.GLOBAL_FONT_PATH)
		if not string:
			return
		try:
			self.clear()
			self.text = string
			for pimg in image_list_from_text(
				string,
				self.length_once,
				self.width,
				self.height,
				font_path,
				font_size,
				color
			):
				img = image.Image(show=False)
				img.set_image(image.image_from_auto_resize(pimg))
				self.image_list.append(img)
			self.start_index = 0
			self.end_index = len(self.image_list)-1
			self.index_range = len(self.image_list)
			self.setup()
		except:
			log.err(repr(self),
				string,
				font_size,
				font_path,
				color,
				traceback.format_exc(),
			)
Example #3
0
File: text.py Project: pyzzz/mygtk
 def load_text(self, string, font_size=None, font_path=None, color=None):
     if not font_path:
         assert os.path.isfile(share.GLOBAL_FONT_PATH)
     try:
         self.text = string
         self.set_image(
             image.image_from_auto_resize(
                 image_from_text(
                     string,
                     font_path,
                     font_size,
                     color,
                 )))
     except:
         log.err(
             repr(self),
             string,
             font_size,
             font_path,
             color,
             traceback.format_exc(),
         )
Example #4
0
File: text.py Project: pyzzz/mygtk
	def load_text(self, string, font_size=None, font_path=None, color=None):
		if not font_path:
			assert os.path.isfile(share.GLOBAL_FONT_PATH)
		try:
			self.text = string
			self.set_image(
				image.image_from_auto_resize(
					image_from_text(
						string,
						font_path,
						font_size,
						color,
					)
				)
			)
		except:
			log.err(repr(self),
				string,
				font_size,
				font_path,
				color,
				traceback.format_exc(),
			)