[feaLib] Fix parsing name records
Don’t override supplied encoding and language ids.
This commit is contained in:
parent
6a07beb699
commit
53dc98be55
@ -736,6 +736,8 @@ class Parser(object):
|
|||||||
# TODO: issue a warning
|
# TODO: issue a warning
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
platEncID = None
|
||||||
|
langID = None
|
||||||
if self.next_token_type_ == Lexer.NUMBER:
|
if self.next_token_type_ == Lexer.NUMBER:
|
||||||
platformID = self.expect_number_()
|
platformID = self.expect_number_()
|
||||||
if platformID not in (1, 3):
|
if platformID not in (1, 3):
|
||||||
@ -747,12 +749,12 @@ class Parser(object):
|
|||||||
else:
|
else:
|
||||||
platformID = 3
|
platformID = 3
|
||||||
|
|
||||||
if platformID == 1: # Macintosh
|
if platformID == 1: # Macintosh
|
||||||
platEncID = 0 # Roman
|
platEncID = platEncID or 0 # Roman
|
||||||
langID = 0 # English
|
langID = langID or 0 # English
|
||||||
else: # 3, Windows
|
else: # 3, Windows
|
||||||
platEncID = 1 # Unicode
|
platEncID = platEncID or 1 # Unicode
|
||||||
langID = 0x0409 # English
|
langID = langID or 0x0409 # English
|
||||||
|
|
||||||
string = self.expect_string_()
|
string = self.expect_string_()
|
||||||
self.expect_symbol_(";")
|
self.expect_symbol_(";")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user