We present a mixed-signal CMOS front-end cell designed for semiconductor pixel detectors for X-gamma ray imaging and spectroscopy. The readout pixel cell (RPC) comprises an analog and a digital section to accomplish all the functionality of a spectroscopic-grade signal readout. The analog section includes a low noise charge preamplifier, a two stage shaper amplifier with digitally selectable shaping times from 1 mus to 10 mus, a baseline restorer, a high precision peak stretcher and an output amplifier. The digital section includes an amplitude discriminator with coarse and fine digital control of the threshold level, a peak discriminator, a current-mode trigger generator, a logic circuit to accomplish the pulse pile-up rejection and the RPC reset after the A/D conversion, the disable functions of the preamplifier and of the discriminators. The RPC has been designed and manufactured in 0.35 mum CMOS technology with a size of 300 mumtimes300 mum. The full functionality of the RPC has been successfully tested. At room temperature, the intrinsic equivalent noise charge is 15.7 electrons r.m.s. at 3.3 mus and the minimum noise slope is 22 electrons/pF at 8 mus, the linearity error is between -1.4% and +1.2% within 1.9 fC input signal dynamic. The RPC has separate voltage supplies (+3.3 V) and grounds for the analog and digital sections and the total power consumption is 495 muW.