#!/usr/bin/python

import sys
import re
import os


for a in sys.argv[1:]:
	contents = open (a).read ()
	filename = os.path.basename (a)
	basename = os.path.splitext (filename)[0]
	name = basename
	m = re.search ('/FontName /([A-Z-0-9a-z_-]+) def', contents)
	if m:
		name = m.group (1)

	print '%s %s <%s' % (basename, name, filename)
