The literal translation of gaper would be yawner; the figure is always displayed with an open mouth, and sometimes you can see a pill he has taken resting on his tongue. In fact he wasn't yawning, but opening his mouth to take medicine.
The existing "gapers" in Amsterdam are almost all of Moorish appearance but 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.