I'm seeking the definition of some function $f(n,m)$ which evaluates to the number of unique sets of $n$ collinear points which are selected from an evenly-spaced grid of $m \times $m points?

Collinear in this case means that the points in the set fall exactly on some line with arbitrary slope, that is, it is not limited to horizontal, or vertical, or 45° diagonal lines.