Lines Matching refs:font
76 def open_font(font): argument
77 font_file, index = font
85 def get_best_cmap(font): argument
86 ttfont = open_font(font)
92 assert bmp_cmap is None, 'More than one BMP cmap in %s' % (font, )
96 'More than one UCS-4 cmap in %s' % (font, ))
102 def get_variation_sequences_cmap(font): argument
103 ttfont = open_font(font)
108 assert vs_cmap is None, 'More than one VS cmap in %s' % (font, )
113 def get_emoji_map(font): argument
115 emoji_map = copy.copy(get_best_cmap(font))
119 vs_dict = get_variation_sequences_cmap(font).uvsDict
128 ttfont = open_font(font)
151 def assert_font_supports_any_of_chars(font, chars): argument
152 best_cmap = get_best_cmap(font)
156 sys.exit('None of characters in %s were found in %s' % (chars, font))
159 def assert_font_supports_all_of_chars(font, chars): argument
160 best_cmap = get_best_cmap(font)
163 'U+%04X was not found in %s' % (char, font))
166 def assert_font_supports_none_of_chars(font, chars, fallbackName): argument
167 best_cmap = get_best_cmap(font)
170 assert char not in best_cmap, 'U+%04X was found in %s' % (char, font)
173 'U+%04X was found in %s in fallback %s' % (char, font, fallbackName))
176 def assert_font_supports_all_sequences(font, sequences): argument
177 vs_dict = get_variation_sequences_cmap(font).uvsDict
180 '<U+%04X, U+%04X> was not found in %s' % (base, vs, font))
197 for font in fonts:
198 assert_font_supports_any_of_chars(font, HYPHENS)
202 def __init__(self, name, scripts, variant, weight, style, fallback_for, font): argument
209 self.font = font
311 record.font for record in _all_fonts
372 assert_font_supports_none_of_chars(record.font, default_emoji, name)
377 missing_text_chars -= set(get_best_cmap(record.font))
630 record.font, record.scripts, record.fallback_for),)
636 font = open_font(record.font)
637 assert font['head'].yMax == 2163 and font['head'].yMin == -555, (
639 record.font,))
643 font = open_font(record.font)
644 assert (font['hhea'].ascent == 1900 and
645 font['hhea'].descent == -500), (
647 'values.' % (record.font,))
658 assert_font_supports_none_of_chars(record.font, cjk_punctuation, name)