Charmed-particle production by photon-gluon fusion