def write_json(f: TextIO, deja_vu_sans_path: str,<EOL>measurer: text_measurer.TextMeasurer,<EOL>encodings: Iterable[str]) -> None:
supported_characters = list(<EOL>generate_supported_characters(deja_vu_sans_path))<EOL>kerning_characters = '<STR_LIT>'.join(<EOL>generate_encodeable_characters(supported_characters, encodings))<EOL>char_to_length = calculate_character_to_length_mapping(measurer,<EOL>supported_characters)<EOL>pair_to_kerning = calculate_pair_to_kern_mapping(measurer, char_to_length,<EOL>kerning_characters)<EOL>json.dump(<EOL>{'<STR_LIT>': statistics.mean(char_to_length.values()),<EOL>'<STR_LIT>': char_to_length,<EOL>'<STR_LIT>': kerning_characters,<EOL>'<STR_LIT>': pair_to_kerning},<EOL>f, sort_keys=True, indent=<NUM_LIT:1>)<EOL>
Write the data required by PrecalculatedTextMeasurer to a stream.