  Let X be a smooth projective curve of positive genus defined over a number
field K. Assume given a Galois covering map x from X to the projective line
over K and a place v of K. We introduce a local canonical height on the set of
K_v-valued points of X associated to x as an integral with logarithmic
integrand, generalizing Tate's local Neron function on an elliptic curve. The
resulting global height can be viewed as a 'Mahler measure' associated to x. We
prove that the local canonical height can be obtained by averaging, and taking
a limit, over divisors of higher order Weierstrass points on X. This
generalizes previous results by Everest-ni Fhlathuin and Szpiro-Tucker. Our
construction of the local canonical height is an application of potential
theory on Berkovich curves in the presence of a canonical measure.
