Classical Ehrhart theory for a lattice polytope encodes the relation between the volume of the polytope and the number of lattice points the polytope contains. In this talk, I will discuss a geometric interpretation, via the (equivariant) Hirzebruch-Riemann-Roch formalism, of a generalized weighted Ehrhart theory depending on a homogeneous function on the polytope and with Laurent polynomial weights attached to each of its faces. In the special case when the weights correspond to Stanley's g-function of the polar polytope, we recover in geometric terms a recent combinatorial formula of Beck-Gunnells-Materov. (Based on joint work with Jörg Schürmann.)