Lines Matching refs:font

93 def open_font(font):  argument
94 font_file, index = font
102 def get_best_cmap(font): argument
103 ttfont = open_font(font)
109 assert bmp_cmap is None, 'More than one BMP cmap in %s' % (font, )
113 'More than one UCS-4 cmap in %s' % (font, ))
119 def get_variation_sequences_cmap(font): argument
120 ttfont = open_font(font)
125 assert vs_cmap is None, 'More than one VS cmap in %s' % (font, )
130 def get_emoji_map(font): argument
132 emoji_map = copy.copy(get_best_cmap(font))
136 vs_cmap = get_variation_sequences_cmap(font)
146 ttfont = open_font(font)
169 def assert_font_supports_any_of_chars(font, chars): argument
170 best_cmap = get_best_cmap(font)
174 sys.exit('None of characters in %s were found in %s' % (chars, font))
177 def assert_font_supports_all_of_chars(font, chars): argument
178 best_cmap = get_best_cmap(font)
181 'U+%04X was not found in %s' % (char, font))
184 def assert_font_supports_none_of_chars(font, chars, fallbackName): argument
185 best_cmap = get_best_cmap(font)
188 assert char not in best_cmap, 'U+%04X was found in %s' % (char, font)
191 'U+%04X was found in %s in fallback %s' % (char, font, fallbackName))
194 def assert_font_supports_all_sequences(font, sequences): argument
195 vs_dict = get_variation_sequences_cmap(font).uvsDict
198 '<U+%04X, U+%04X> was not found in %s' % (base, vs, font))
215 for font in fonts:
216 assert_font_supports_any_of_chars(font, HYPHENS)
220 def __init__(self, name, psName, scripts, variant, weight, style, fallback_for, font): argument
228 self.font = font
342 return [ record.font for record in _all_fonts if 'Zsye' in record.scripts ]
468 assert_font_supports_none_of_chars(record.font, default_emoji, name)
473 missing_text_chars -= set(get_best_cmap(record.font))
716 record.font, record.scripts, record.fallback_for),)
722 font = open_font(record.font)
723 assert font['head'].yMax == 2163 and font['head'].yMin == -555, (
725 record.font,))
729 font = open_font(record.font)
730 assert (font['hhea'].ascent == 1900 and
731 font['hhea'].descent == -500), (
733 'values.' % (record.font,))
744 assert_font_supports_none_of_chars(record.font, cjk_punctuation, name)
746 def getPostScriptName(font): argument
747 font_file, index = font
763 file_name, index = record.font
765 psName = getPostScriptName(record.font)