Uses python3 for fontTools
Change-Id: I33bb8881823278c990faeb1a0e119f855c9948b9
This commit is contained in:
parent
3bc5168281
commit
715857dbda
@ -945,13 +945,13 @@ python_defaults {
|
|||||||
name: "base_default",
|
name: "base_default",
|
||||||
version: {
|
version: {
|
||||||
py2: {
|
py2: {
|
||||||
enabled: true,
|
|
||||||
embedded_launcher: true,
|
|
||||||
},
|
|
||||||
py3: {
|
|
||||||
enabled: false,
|
enabled: false,
|
||||||
embedded_launcher: false,
|
embedded_launcher: false,
|
||||||
},
|
},
|
||||||
|
py3: {
|
||||||
|
enabled: true,
|
||||||
|
embedded_launcher: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ def parse_fonts_xml(fonts_xml_path):
|
|||||||
|
|
||||||
if not fallback_for:
|
if not fallback_for:
|
||||||
if not name or name == 'sans-serif':
|
if not name or name == 'sans-serif':
|
||||||
for _, fallback in _fallback_chains.iteritems():
|
for _, fallback in _fallback_chains.items():
|
||||||
fallback.append(record)
|
fallback.append(record)
|
||||||
else:
|
else:
|
||||||
_fallback_chains[name].append(record)
|
_fallback_chains[name].append(record)
|
||||||
@ -327,7 +327,7 @@ def check_emoji_font_coverage(emoji_font, all_emoji, equivalent_emoji):
|
|||||||
assert sequence in all_emoji, (
|
assert sequence in all_emoji, (
|
||||||
'Emoji font should not support %s.' % printable(sequence))
|
'Emoji font should not support %s.' % printable(sequence))
|
||||||
|
|
||||||
for first, second in sorted(equivalent_emoji.items()):
|
for first, second in equivalent_emoji.items():
|
||||||
assert coverage[first] == coverage[second], (
|
assert coverage[first] == coverage[second], (
|
||||||
'%s and %s should map to the same glyph.' % (
|
'%s and %s should map to the same glyph.' % (
|
||||||
printable(first),
|
printable(first),
|
||||||
@ -352,7 +352,7 @@ def check_emoji_font_coverage(emoji_font, all_emoji, equivalent_emoji):
|
|||||||
|
|
||||||
def check_emoji_defaults(default_emoji):
|
def check_emoji_defaults(default_emoji):
|
||||||
missing_text_chars = _emoji_properties['Emoji'] - default_emoji
|
missing_text_chars = _emoji_properties['Emoji'] - default_emoji
|
||||||
for name, fallback_chain in _fallback_chains.iteritems():
|
for name, fallback_chain in _fallback_chains.items():
|
||||||
emoji_font_seen = False
|
emoji_font_seen = False
|
||||||
for record in fallback_chain:
|
for record in fallback_chain:
|
||||||
if 'Zsye' in record.scripts:
|
if 'Zsye' in record.scripts:
|
||||||
@ -369,7 +369,7 @@ def check_emoji_defaults(default_emoji):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# Check default emoji-style characters
|
# Check default emoji-style characters
|
||||||
assert_font_supports_none_of_chars(record.font, sorted(default_emoji), name)
|
assert_font_supports_none_of_chars(record.font, default_emoji, name)
|
||||||
|
|
||||||
# Mark default text-style characters appearing in fonts above the emoji
|
# Mark default text-style characters appearing in fonts above the emoji
|
||||||
# font as seen
|
# font as seen
|
||||||
@ -412,7 +412,7 @@ def parse_unicode_datafile(file_path, reverse=False):
|
|||||||
char_start, char_end = chars.split('..')
|
char_start, char_end = chars.split('..')
|
||||||
char_start = int(char_start, 16)
|
char_start = int(char_start, 16)
|
||||||
char_end = int(char_end, 16)
|
char_end = int(char_end, 16)
|
||||||
additions = xrange(char_start, char_end+1)
|
additions = range(char_start, char_end+1)
|
||||||
else: # singe character
|
else: # singe character
|
||||||
additions = [int(chars, 16)]
|
additions = [int(chars, 16)]
|
||||||
if reverse:
|
if reverse:
|
||||||
@ -478,7 +478,7 @@ def parse_ucd(ucd_path):
|
|||||||
# Unicode 12.0 adds Basic_Emoji in emoji-sequences.txt. We ignore them here since we are already
|
# Unicode 12.0 adds Basic_Emoji in emoji-sequences.txt. We ignore them here since we are already
|
||||||
# checking the emoji presentations with emoji-variation-sequences.txt.
|
# checking the emoji presentations with emoji-variation-sequences.txt.
|
||||||
# Please refer to http://unicode.org/reports/tr51/#def_basic_emoji_set .
|
# Please refer to http://unicode.org/reports/tr51/#def_basic_emoji_set .
|
||||||
_emoji_sequences = {k: v for k, v in _emoji_sequences.iteritems() if not v == 'Basic_Emoji' }
|
_emoji_sequences = {k: v for k, v in _emoji_sequences.items() if not v == 'Basic_Emoji' }
|
||||||
|
|
||||||
|
|
||||||
def remove_emoji_variation_exclude(source, items):
|
def remove_emoji_variation_exclude(source, items):
|
||||||
@ -551,7 +551,7 @@ def reverse_emoji(seq):
|
|||||||
rev = list(reversed(seq))
|
rev = list(reversed(seq))
|
||||||
# if there are fitzpatrick modifiers in the sequence, keep them after
|
# if there are fitzpatrick modifiers in the sequence, keep them after
|
||||||
# the emoji they modify
|
# the emoji they modify
|
||||||
for i in xrange(1, len(rev)):
|
for i in range(1, len(rev)):
|
||||||
if is_fitzpatrick_modifier(rev[i-1]):
|
if is_fitzpatrick_modifier(rev[i-1]):
|
||||||
rev[i], rev[i-1] = rev[i-1], rev[i]
|
rev[i], rev[i-1] = rev[i-1], rev[i]
|
||||||
return tuple(rev)
|
return tuple(rev)
|
||||||
@ -620,7 +620,7 @@ def compute_expected_emoji():
|
|||||||
|
|
||||||
|
|
||||||
def check_compact_only_fallback():
|
def check_compact_only_fallback():
|
||||||
for name, fallback_chain in _fallback_chains.iteritems():
|
for name, fallback_chain in _fallback_chains.items():
|
||||||
for record in fallback_chain:
|
for record in fallback_chain:
|
||||||
if record.variant == 'compact':
|
if record.variant == 'compact':
|
||||||
same_script_elegants = [x for x in fallback_chain
|
same_script_elegants = [x for x in fallback_chain
|
||||||
@ -650,7 +650,7 @@ def check_vertical_metrics():
|
|||||||
def check_cjk_punctuation():
|
def check_cjk_punctuation():
|
||||||
cjk_scripts = {'Hans', 'Hant', 'Jpan', 'Kore'}
|
cjk_scripts = {'Hans', 'Hant', 'Jpan', 'Kore'}
|
||||||
cjk_punctuation = range(0x3000, 0x301F + 1)
|
cjk_punctuation = range(0x3000, 0x301F + 1)
|
||||||
for name, fallback_chain in _fallback_chains.iteritems():
|
for name, fallback_chain in _fallback_chains.items():
|
||||||
for record in fallback_chain:
|
for record in fallback_chain:
|
||||||
if record.scripts.intersection(cjk_scripts):
|
if record.scripts.intersection(cjk_scripts):
|
||||||
# CJK font seen. Stop checking the rest of the fonts.
|
# CJK font seen. Stop checking the rest of the fonts.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user