def read_profile(profile_filename):
    """
    Reads profile file from disk.

    Profile is a normal Python source file, that must define a function named
    `profile`. Function must take the following parameters:

    * `font`
    * `color`
    * `size`
    * `bold`
    * `italic`

    and return an instance of `odt2md.emphasis.MarkdownStyle`.
    """
    g = {}
    with open(profile_filename) as f:
        exec(f.read(), g)
    if 'profile' not in g:
        raise ValueError(
            f'profile {profile_filename} is expected to define a function named "profile"'
            )
    if not callable(g['profile']):
        raise ValueError(
            f'name "profile" in {profile_filename} must be a function')
    return g['profile']
