The answer to this question explains how to add space around inline equations, but it doesn't account for punctuation. You can see what I mean in the picture below.
Is there a way to put the space after the comma, rather than before it? The obvious solution of putting the comma inside the equation environment, e.g.,
$A = \pi r^2,$ won't work because the fonts are different (I'm using XeLaTeX). That is, unless you manually specify each time that the comma should be a different font, but I'm hoping for a lazier solution (which accounts for all of the normal punctuation: periods, commas, semicolons, etc.).