def METHOD_NAME(
    file_handle, font_file_name, min_allowed, max_allowed, language=None
):
    """Test the rendering of the contents of a file for vertical extents.
    Supports both text files and XTB files.
    """
    input_data = file_handle.read()
    if input_data.startswith("<?xml"):
        # XML mode, assume .xtb file
        root = xml.etree.ElementTree.fromstring(input_data)
        assert root.tag == "translationbundle"
        test_strings = []
        for child in root:
            if child.text is not None:
                test_strings.append(child.text)
        input_data = "\n".join(test_strings)
    else:
        # Assume text file, with all the data as one large string
        # input_data = input_data.decode("UTF-8")
        pass
    # Now, input_data is just a long string, with new lines as separators.
    return test_rendering(
        input_data, font_file_name, min_allowed, max_allowed, language
    )