The literal translation of "gaper" would be yawner; the figure is always displayed with an open mouth, sometimes with a pill resting on his tongue. This indicates that in fact he wasn't yawning, but opening his mouth to take medicine.
The existing gapers in Amsterdam are almost all of Moorish appearance. This wasn't supposed to be the forefather of today's pharmacist, but rather to indicate the exotic origin of the medicines. The apothecary would attend market days all over the country and his assistant would play the character of an ill man. After taking the pill, the assistant (often dressed as a Moor) would all of a sudden feel much better and perform a dance.
Later, when pharmacists opened shops instead of travelling through the country, the symbol of the Moorish man (often depicted with a pill on his tongue) would tell the illiterate audience that this was the home of a pharmacist.
Nowadays these symbols are rare. Outside museum collections, fewer than 50 can be seen on buildings. Some have now lent their names to cafes, such as De Vergulde Gaper in Amsterdam.