STEIN, Germany — Count Anton-Wolfgang von Faber-Castell has been known to hurl wooden pencils from the tower of his castle to the stone courtyard below.

It is not a petty fit of pique by a mad Bavarian aristocrat. The 72-year-old count, the eighth in a long line of pencil makers, just wants to prove how durable the pencils that carry his family name are.

The Faber-Castell family has been making wooden pencils by the hundreds of millions here in a storybook setting, bisected by the swift Rednitz River, which was once the main source of power here. A torrent of brightly colored pencils flows from clattering machines in a century-old factory with a tile roof and windows framed in pastel hues.

Faber-Castell is the largest maker of wood-encased pencils in the world and also makes a broad range of pens, crayons and art and drawing supplies as well as accessories like erasers and sharpeners. About half the company’s German production is exported, mostly to other countries in the euro zone. That means that Faber-Castell contributes, at least in a small way, to Germany’s large and controversial trade surplus — which now rivals China’s for the world’s largest.