Federer fired five aces and saved three of the five break points he faced to defeat Alejandro Falla, 7-6 (2), 7-6 (3), in the final in Halle, Germany. It was the 14th title on grass and 79th overall for the 32-year-old Swiss.
The seven-time Wimbledon champion improved his record to 46-5 in 12 appearances at the tournament where he made his debut 14 years ago.
"I've left a little bit of my heart here," Federer said after his ninth Halle final. "I'm very pleased now to go to Wimbledon."
Federer broke to go 5-3 up in the first set, only for Falla to respond with a break and take it to the tiebreaker.
Federer then started the second set with a break, but a forehand error allowed Falla to respond with a break in the next set. Both held serve to set up the second tiebreaker, where Federer's experience saw him through.
The former world No. 1. beat Zahlavova-Strycova, 6-3, 6-2, with her opponent also playing in her first major tournament final.
Although Ivanovic started shakily for the second day in succession, and dropped serve immediately, she recovered quickly, her heavy ground strokes and willingness to attack soon dominating her unseeded opponent.
It suggested that, at 26, not only can she adapt to a variable surface, but underlined this as her best year so far since 2008.
It was Ivanovic's 37th win and her third title of the year.
Grigor Dimitrov saved a match point to defeat