We study the CP-violating phase of the quark sector on T2/ZN (N = 2, 3, 4, 6) with non-vanishing magnetic fluxes, where properties of possible origins of the CP violation are investigated minutely. In this system, a non-vanishing value is mandatory in the real part of the complex modulus parameter τ of the two-dimensional torus in order to explain the CP violation in the quark sector. On T2 without orbifolding, underlying discrete flavor symmetries severely restrict the form of Yukawa couplings and it is very difficult to reproduce the observed pattern in the quark sector including the CP-violating phase δCP. When multiple Higgs doublets emerge on T2/Z2, the mass matrices of the zero-mode fermions can be written in the Gaussian textures by choosing appropriate configurations of vacuum expectation values of the Higgs fields. When such Gaussian textures of mass matrices are realized, we show that all of the quark profiles, which are mass hierarchies among the quarks, quark mixing angles, and δCP can be simultaneously realized. © 2017, The Author(s).