Spectroscopic studies of Wolf-Rayet stars. IV - Optical spectrophotometry of the emission lines in galactic and large Magellanic Cloud stars