He was a talented student who read widely in the classics. He served under the Sui Dynasty in 611 as Imperial Doctor. He served under the Tang Dynasty as censor and scholar at the Hongwen Academy. There he taught calligraphy. He was a principal contributor to the Yiwen Leiju.

He became the Imperial Calligrapher and inscribed several major imperial steles. He was good at regular script and his most famous work is the Stele in the Jiucheng Palace. He was considered a cultured scholar and a government official. Along with Yu Shinan, Xue Ji, and Chu Suiliang he became known as one of the Four Great Calligraphers of the Early Tang.