def export_kern_feature(font):
    """
    Export the font's kerning dict to OpenType ``kern`` feature.

    """
    kern_feature = 'feature kern {\n'
    for pair in sorted(font.kerning.keys()):
        value = font.kerning[pair]
        if pair[0] in list(font.keys()) and pair[1] in list(font.keys()):
            kern_feature += '\tpos %s %s %s;\n' % (pair[0], pair[1], value)
    kern_feature += '} kern;\n'
    return kern_feature