def text_properties(*args):
    """
    Create a predicate function that tests if a marker's text properties
    contain all the properties passed as arguments to this function.
    The returned callable can be used as a predicate to the sfilter() function.
    """
    props = set(args)
    def _props(e): return props <= set(e.meta.get('TextProperties', []))
    return _props