Let $S$ be a connected closed oriented surface of genus $g$. Given a triangulation (resp. quadrangulation) of $S$, define the index of each of its vertices to be the number of edges originating from this vertex minus $6$ (resp. minus $4$). Call the set of integers recording the non-zero indices the profile of the triangulation (resp. quadrangulation). If $kappa$ is a profile for triangulations (resp. quadrangulations) of $S$, for any $min mathbb{Z}_{>0}$, denote by $mathscr{T}(kappa,m)$ (resp. $mathscr{Q}(kappa,m)$) the set of (equivalence classes of) triangulations (resp. quadrangulations) with profile $kappa$ which contain at most $m$ triangles (resp. squares). In this paper, we will show that if $kappa$ is a profile for triangulations (resp. for quadrangulations) of $S$ such that none of the indices in $kappa$ is divisible by $6$ (resp. by $4$), then $mathscr{T}(kappa,m)sim c_3(kappa)m^{2g+|kappa|-2}$ (resp. $mathscr{Q}(kappa,m) sim c_4(kappa)m^{2g+|kappa|-2}$), where $c_3(kappa) in mathbb{Q}cdot(sqrt{3}pi)^{2g+|kappa|-2}$ and $c_4(kappa)in mathbb{Q}cdotpi^{2g+|kappa|-2}$. The key ingredient of the proof is a result of J. Kollar on the link between the curvature of the Hogde metric on vector subbundles of a variation of Hodge structure over algebraic varieties, and Chern classes of their extensions. By the same method, we also obtain the rationality (up to some power of $pi$) of the Masur-Veech volume of arithmetic affine submanifolds of translation surfaces that are transverse to the kernel foliation.