[feaLib] Fix parsing name records

Don’t override supplied encoding and language ids.
This commit is contained in:
Khaled Hosny 2016-03-18 14:00:56 +04:00
parent 6a07beb699
commit 53dc98be55

View File

@ -736,6 +736,8 @@ class Parser(object):
# TODO: issue a warning
return None
platEncID = None
langID = None
if self.next_token_type_ == Lexer.NUMBER:
platformID = self.expect_number_()
if platformID not in (1, 3):
@ -748,11 +750,11 @@ class Parser(object):
platformID = 3
if platformID == 1: # Macintosh
platEncID = 0 # Roman
langID = 0 # English
platEncID = platEncID or 0 # Roman
langID = langID or 0 # English
else: # 3, Windows
platEncID = 1 # Unicode
langID = 0x0409 # English
platEncID = platEncID or 1 # Unicode
langID = langID or 0x0409 # English
string = self.expect_string_()
self.expect_symbol_(";")