def build_stylemap_names(<EOL>family_name, style_name, is_bold=False, is_italic=False, linked_style=None<EOL>):
styleMapStyleName = (<EOL>"<STR_LIT:U+0020>".join(<EOL>s for s in ("<STR_LIT>" if is_bold else "<STR_LIT>", "<STR_LIT>" if is_italic else "<STR_LIT>") if s<EOL>)<EOL>or "<STR_LIT>"<EOL>)<EOL>if not linked_style or linked_style == "<STR_LIT>":<EOL><INDENT>linked_style = _get_linked_style(style_name, is_bold, is_italic)<EOL><DEDENT>if linked_style:<EOL><INDENT>styleMapFamilyName = (family_name or "<STR_LIT>") + "<STR_LIT:U+0020>" + linked_style<EOL><DEDENT>else:<EOL><INDENT>styleMapFamilyName = family_name<EOL><DEDENT>return styleMapFamilyName, styleMapStyleName<EOL>
Build UFO `styleMapFamilyName` and `styleMapStyleName` based on the
    family and style names, and the entries in the "Style Linking" section
    of the "Instances" tab in the "Font Info".

    The value of `styleMapStyleName` can be either "regular", "bold", "italic"
    or "bold italic", depending on the values of `is_bold` and `is_italic`.

    The `styleMapFamilyName` is a combination of the `family_name` and the
    `linked_style`.

    If `linked_style` is unset or set to 'Regular', the linked style is equal
    to the style_name with the last occurrences of the strings 'Regular',
    'Bold' and 'Italic' stripped from it.