Yes, Rafael Federer was the world highest paid tennis player in 2017. With sponsorship deals of about 60 million in a year (highest any athlete earns from endorsements). Roger Federer earned about $64 million between June 2016 to June 2017.
His biggest endorsement is from Nike, he earns about $10 million from his deal with Nike. His earnings in 2017 made it the 12th consecutive year of being the highest paid tennis player. Roger Federer has won over $108 million in competition prize money in his career.
Roger had a knee injury in the second half of 2016, he didn't win any tournament in 2016. He returned to the court in 2017 winning Australian Open and Wimbledon.