An ion beam lithography system for light and heavy ions has been developed at the University of Jyväskylä's Accelerator Laboratory. The system employs a programmable proximity aperture to define the beam. The proximity aperture is made up of four Ta blades with precise straight edges that cut the beam in the horizontal and vertical directions. The blade positions and dimensions are controlled by a pair of high-precision linear-motion positioners. The sample is mounted on a X-Y-Z stage capable of moving with 100 nm precision steps under computer control. The resolution performance of the system is primarily governed by the proximity aperture. Pattern edge sharpness is set by the beam divergence, aperture blade straightness, and secondary and scattered particles from the aperture blade edges. Ray tracing simulations using object oriented toolkit GEANT4 were performed to investigate the beam spatial resolution on the sample defined by the proximity aperture. The results indicate that the edge-scattering does not significantly affect the pattern edge sharpness.