rebuild_fuzzer_corpus.py
References a public code-forge URLReferences a quoted font file path
SHA-256d24db0cd00ce94aea4cc90d8c9d69b1b20abb88c5fcf0de92bd316f9ba8f9d87
URLhttps://raw.githubusercontent.com/googlefonts/color-fonts/refs/heads/main/rebuild_fuzzer_corpus.py
MaleculeH₂(Cm₂F)
Evidence
1#!/usr/bin/env python3
2"""Output pyftsubset commands to rebuild the fuzzer corpus that is used for fuzzing COLRv1 in FreeType.
3
4Compare https://github.com/freetype/freetype2-testing/tree/master/fuzzing/corpora/colrv1
5"""
6
7import fontTools.ttLib.ttFont as ttFont
8import fontTools.ttLib.tables.C_O_L_R_ as C_O_L_R_
9
10from collections import namedtuple
11from functools import partial
12
13SRC_FONT = "fonts/noto-glyf_colr_1.ttf"
14SAMPLES_FONT = "fonts/more_samples-glyf_colr_1.ttf"
15NUM_TOP_BUSY_PAINTS = 90
16
⋯5 lines
41:11… unks_of_three(gid_list):
42 chunksize = 3
43 for i in range(0, len(gid_list), chunksize):
44 yield gid_list[i : i + chunksize]
45
46 for count, chunk in enumerate(chunks_of_three(high_pa …
46:64… unt_glyphs)):
47 gids = ",".join([str(item) for item in chunk])
48 print(
49 f"pyftsubset {SRC_FONT} --gids={gids} --output-file=noto_complex_glyphs_colrv1_{str(count)}.ttf"
50 )
51
⋯7 lines