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
This commit is contained in:
parent
5f4193373b
commit
e83b4c4482
@ -68,6 +68,7 @@ def usage():
|
|||||||
|
|
||||||
|
|
||||||
numberAddedRE = re.compile("(.*)#\d+$")
|
numberAddedRE = re.compile("(.*)#\d+$")
|
||||||
|
opentypeheaderRE = re.compile('''sfntVersion=['"]OTTO["']'''):
|
||||||
|
|
||||||
def makeOutputFileName(input, outputDir, extension):
|
def makeOutputFileName(input, outputDir, extension):
|
||||||
dir, file = os.path.split(input)
|
dir, file = os.path.split(input)
|
||||||
@ -237,7 +238,7 @@ def guessFileType(fileName):
|
|||||||
elif head in ("\0\1\0\0", "true"):
|
elif head in ("\0\1\0\0", "true"):
|
||||||
return "TTF"
|
return "TTF"
|
||||||
elif head.lower() == "<?xm":
|
elif head.lower() == "<?xm":
|
||||||
if header.find('sfntVersion="OTTO"') > 0:
|
if opentypeheaderRE.match(header):
|
||||||
return "OTX"
|
return "OTX"
|
||||||
else:
|
else:
|
||||||
return "TTX"
|
return "TTX"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user