The one-particle density matrix of the one-dimensional Tonks-Girardeau gas with inhomogeneous density profile is calculated, thanks to a recent observation that relates this system to a two-dimensional conformal field theory in curved space. The result is asymptotically exact in the limit of large particle density and small density variation, and holds for arbitrary trapping potentials. In the particular case of a harmonic trap, we recover a formula obtained by Forrester et al. [Phys. Rev. A 67, 043607 (2003)] from a different method.