def METHOD_NAME(cls, subs, fp, format_, fps=None, write_fps_declaration=True, apply_styles=True, **kwargs):
    """
    See :meth:`pysubs2.formats.FormatBase.to_file()`
    The only supported styling is marking whole lines italic.
    Keyword args:
        write_fps_declaration: If True, create a zero-duration first subtitle which will contain
            the fps.
        apply_styles: If False, do not write any styling.
    """
    if fps is None:
        fps = subs.fps
    if fps is None:
        raise UnknownFPSError("Framerate must be specified when writing MicroDVD.")
    to_frames = partial(ms_to_frames, fps=fps)
    def is_entirely_italic(line):
        style = subs.styles.get(line.style, SSAStyle.DEFAULT_STYLE)
        for fragment, sty in parse_tags(line.text, style, subs.styles):
            fragment = fragment.replace(r"\h", " ")
            fragment = fragment.replace(r"\n", "\n")
            fragment = fragment.replace(r"\N", "\n")
            if not sty.italic and fragment and not fragment.isspace():
                return False
        return True
    # insert an artificial first line telling the framerate
    if write_fps_declaration:
        subs.insert(0, SSAEvent(start=0, end=0, text=str(fps)))
    for line in subs:
        if line.is_comment or line.is_drawing:
            continue
        text = "|".join(line.plaintext.splitlines())
        if apply_styles and is_entirely_italic(line):
            text = "{Y:i}" + text
        start, end = map(to_frames, (line.start, line.end))
        # XXX warn on underflow?
        if start < 0: start = 0
        if end < 0: end = 0
        print("{%d}{%d}%s" % (start, end, text), file=fp)
    # remove the artificial framerate-telling line
    if write_fps_declaration:
        subs.pop(0)