Will not play at the French Open don't know for other Grand Slams such as Wimbledon and US Open where he still wants to add more tittle Grand Slam.
Source :
https://edition.cnn.com/2020/02/20/tennis/roger-federer-knee-injury-french-open-spt-intl/index.html
I don't want to say that he's finished because Federer is one of those players who has a good determination with his career.
He had a run of injuries in the past and was able to defy the odds by winning more grand slams. So this is not new to him, so mentally he can return and resume and chase more tennis accolades. Although age could be a limiting factor for his recovery this time, but I have no doubts that his career is not yet finished.
So it will be a battle for Djokovic and Nadal for the top one this year. Djokovic looks fresher and strong between the two, so for me, Djokovic will continue to end the year as the number one tennis player. Wish Federer for a swift recovery.
Remember that Djokovic also come back from injury and regain his form and became the number one player again. But it did take some time and even himself admitted that it is really a tough road. Andy Murray was once in a comeback trail, but his body was not the same anymore.
We do hope that Roger body can still hold on after the operation and can comeback like Djokovic did. Now that we only have him and Nadal, we would like to see the young generations to take over and at least filled the 3rd spot.