def getConstrainedLocation(font, location):
    """Answers the location with applied min/max values for each axis. Don't
    change the values if they are positioned between their min/max values.
    Don't change values for axes that are not defined in the font."""
    constrainedLocation = {}
    axes = font.axes
    for name, value in location.items():
        if name in axes:
            value = min(max(axes[name][0], value), axes[name][2])
        constrainedLocation[name] = value
    return constrainedLocation