$w$-distances