Scroll waves of electrical excitation in heart tissue are implicated in the development of lethal cardiac arrhythmias. Here we study the relation between the geometry of myocardial fibers and the equilibrium shape of a scroll wave filament. Our theory accommodates a wide class of myocardial models with spatially varying diffusivity tensor, adjusted to fit fiber geometry. We analytically predict the exact equilibrium shapes of the filaments. The major conclusion is that the filament shape is a compromise between a straight line and full alignment with the fibers. The degree of alignment increases with the anisotropy ratio. The results, being purely geometrical, are independent of details of ionic membrane mechanisms. Our theoretical predictions have been verified to excellent accuracy by numerically simulating the stable equilibration of a scroll filament in a model of the FitzHugh-Nagumo type.