[ttx] Strip BOM from beginning of file

Fixes #896
This commit is contained in:
Miguel Sousa 2017-03-27 03:55:53 -07:00
parent 9adf3d8aca
commit 4fce7a0b7b
2 changed files with 2 additions and 1 deletions

View File

@ -290,7 +290,7 @@ def guessFileType(fileName):
return "TTF" return "TTF"
if ext == ".dfont": if ext == ".dfont":
return "TTF" return "TTF"
header = f.read(256) header = f.read(256).lstrip(b'\xef\xbb\xbf')
head = Tag(header[:4]) head = Tag(header[:4])
if head == "OTTO": if head == "OTTO":
return "OTF" return "OTF"

View File

@ -1,3 +1,4 @@
- [ttx] Support reading TTX files with BOM (#896)
- [CFF2] Fixed the reporting of the number of regions in the font. - [CFF2] Fixed the reporting of the number of regions in the font.
3.9.1 (released 2017-03-20) 3.9.1 (released 2017-03-20)