Cut the tofu into 8 equal slabs, slicing parallel to the shortest sides of the block. Set it aside for now.
Heat 1 tablespoon of the oil in a small saucepan over medium heat. Add the shallots and cook them for about 5 minutes, stirring occasionally, until they start to soften.
Add the cranberries, orange juice, brown sugar, orange zest, and rosemary. Bring the mixture to a boil, then reduce the heat and let it simmer for 8 to 10 minutes, until most of the berries have burst, stirring occasionally. You can add a splash of water if the mixture gets too dry. Remove the pot from heat when done. Remove the rosemary sprig. Carefully taste-test the sauce (it will be hot!), and season with ½ teaspoon of salt, or to taste.
While the sauce cooks, coat the bottom of a large skillet with the remaining 1 tablespoon of the oil and place it over medium heat. Give the oil a minute to heat up, then add the tofu slabs, arranging them in a single layer. Cook the tofu for about 10 minutes, turning the pieces about halfway through, until they are golden brown.
Spoon half of the cranberry sauce over the tofu, then flip the pieces and cook for about 1 minute, allowing the sauce to caramelize slightly. Spoon the remaining sauce over the tofu, then flip the pieces again and cook for about 1 minute more, allowing the sauce to caramelize on the other sides.
Remove the tofu from the skillet and transfer it to plates or a serving plate, spooning any sauce left in the pan over the tofu. Serve and enjoy!