Detect both types of quotes when detecting OTF vs TTF XML.
Fixes: http://sourceforge.net/p/fonttools/bugs/47/
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@616 4cde692c-a291-49d1-8350-778aa11640f8
diff --git a/Lib/fontTools/ttx.py b/Lib/fontTools/ttx.py
index 0968a29..477c0d9 100644
--- a/Lib/fontTools/ttx.py
+++ b/Lib/fontTools/ttx.py
@@ -68,6 +68,7 @@
numberAddedRE = re.compile("(.*)#\d+$")
+opentypeheaderRE = re.compile('''sfntVersion=['"]OTTO["']'''):
def makeOutputFileName(input, outputDir, extension):
dir, file = os.path.split(input)
@@ -237,7 +238,7 @@
elif head in ("\0\1\0\0", "true"):
return "TTF"
elif head.lower() == "<?xm":
- if header.find('sfntVersion="OTTO"') > 0:
+ if opentypeheaderRE.match(header):
return "OTX"
else:
return "TTX"