Description: Add support for toilet's .tlf files.
 There are .tlf files which are compatible with figlet.
Author: Stefano Rivera <stefano@rivera.za.net>
Forwarded: https://sourceforge.net/tracker/?func=detail&aid=2939616&group_id=200820&atid=975076
Last Update: 2010-01-25

--- a/pyfiglet.py
+++ b/pyfiglet.py
@@ -62,7 +62,7 @@
 		self.width = {}
 		self.data = None
 
-		self.reMagicNumber = re.compile(r'^flf2.')
+		self.reMagicNumber = re.compile(r'^[ft]lf2.')
 		self.reEndMarker = re.compile(r'(.)\s*$')
 
 		self.readFontFile()
@@ -73,8 +73,11 @@
 	a superclass to create different font sources.
 	"""
 	def readFontFile(self):
-		fontPath = '%s/%s.flf' % (self.dir, self.font)
-		if os.path.exists(fontPath) is False:
+		for ext in ('flf', 'tlf'):
+			fontPath = '%s/%s.%s' % (self.dir, self.font, ext)
+			if os.path.exists(fontPath):
+				break
+		else:
 			raise FontNotFound, "%s doesn't exist" % fontPath
 
 		try:
@@ -86,7 +89,8 @@
 		finally: fo.close()
 
 	def getFonts(self):
-		return [font[:-4] for font in os.walk(self.dir).next()[2] if font.endswith('.flf')]
+		return [font[:-4] for font in os.walk(self.dir).next()[2]
+		        if font.endswith('.flf') or font.endswith('.tlf')]
 		
 
 
@@ -228,25 +232,27 @@
 		if os.path.exists(self.zipfile) is False:
 			raise FontNotFound, "%s doesn't exist" % self.zipfile
 
-		fontPath = 'fonts/%s.flf' % self.font
+		for ext in ('.flf', '.tlf'):
+			fontPath = 'fonts/%s.%s' % (self.font, ext)
 
-		try:
-			z = ZipFile(self.zipfile, 'r')
-			files = z.namelist()
-			if fontPath not in files:
-				raise FontNotFound, '%s not found in %s' % (self.font, self.zipfile)
+			try:
+				z = ZipFile(self.zipfile, 'r')
+				files = z.namelist()
+				if fontPath not in files:
+					raise FontNotFound, '%s not found in %s' % (self.font, self.zipfile)
 
-			self.data = z.read(fontPath)
+				self.data = z.read(fontPath)
 
-		except Exception, e:
-			raise FontError, "couldn't open %s: %s" % (fontPath, e)
+			except Exception, e:
+				raise FontError, "couldn't open %s: %s" % (fontPath, e)
 
 	def getFonts(self):
 		if os.path.exists(self.zipfile) is False:
 			raise FontNotFound, "%s doesn't exist" % self.zipfile
 
 		z = ZipFile(self.zipfile, 'r')
-		return [font[6:-4] for font in z.namelist() if font.endswith('.flf')]
+		return [font[6:-4] for font in z.namelist()
+		        if font.endswith('.flf') and font.endswith('.tlf')]
 
 
 
