  We derive, from conformal invariance and quantum gravity, the multifractal
spectrum f(alpha,c) of the harmonic measure (or electrostatic potential, or
diffusion field) near any conformally invariant fractal in two dimensions,
corresponding to a conformal field theory of central charge c. It gives the
Hausdorff dimension of the set of boundary points where the potential varies
with distance r to the fractal frontier as r^{alpha}. First examples are a
Brownian frontier, a self-avoiding walk, or a percolation cluster. Potts, O(N)
models, and the so-called SLE process are also considered. Higher multifractal
functions are derived, like the universal function f_2(alpha,alpha') which
gives the Hausdorff dimension of the points where the potential jointly varies
with distance r as r^{alpha} on one side of the random curve, and as r^{alpha'}
on the other. We present a duality between external perimeters of
  Potts clusters and O(N) loops at their critical point, obtained in a former
work, as well as the corresponding duality in the SLE_{kappa} process for kappa
kappa'=16.
