Roger Federer has pulled out of the Gerry Weber Cup in Halle to ensure he is fit for Wimbledon later this month.