This paper proposes a novel method to text-independent writer identification from online handwriting. The main contributions of our method include two parts: shape primitive representation and hierarchical structure. Both shape primitive's features are developed to represent the robust and distinctive characteristics of handwriting in two hierarchies. In first hierarchy, the shape primitives probability distribution function (SPPDF)is defined as the static features, to characterize orientation information of writing style. For each shape primitive, the statistics of pressure is defined as the dynamic shape primitives probability distribution function (DSPPDF) and the second hierarchy we build Gaussian model in dynamic attributes (DA) according to curvature of shape primitives. Experiments were conducted on the NLPR handwriting database collected from 242 persons. The results show that the new method achieves high accuracy, fast speed and low requirement of the amount of character...