Prepare the Pan: Preheat the oven to 350°F. Butter a 9 × 5-inch loaf pan, then line the bottom and sides with parchment paper.
Mix the Dry Ingredients: Whisk the all-purpose flour, almond flour, baking powder, and salt together in a medium bowl until evenly combined. Set aside.
Prepare Fresh Blueberries: If using fresh blueberries, wash them and pat them dry with paper towels. Place them in a bowl, add 1 tablespoon of all-purpose flour, and gently toss until coated. Set aside. Prepare Frozen Blueberries: If using frozen blueberries, keep them frozen until they are added to the batter. Do not thaw them and do not coat them with flour.
Infuse the Sugar: Place the granulated sugar in a large mixing bowl. Add the lemon zest and rub the zest into the sugar with your fingertips until well distributed. Cream the Butter: Add the room-temperature butter to the lemon sugar and beat with an electric mixer on medium-high speed for about 3 minutes, until the mixture becomes light and fluffy.
Blend in the Ricotta: Add the ricotta cheese to the butter mixture and beat until mostly smooth and well combined. A few small lumps are fine.
Add the Eggs: Reduce the mixer speed to low and add the eggs one at a time, beating after each addition until incorporated.
Add the Flavorings: Add the lemon juice, vanilla extract, and optional almond extract, then beat just until the flavorings are incorporated.
Combine the Batter: Add the dry ingredients to the wet mixture and gently fold with a spatula until just combined. Avoid overmixing.
Fold in the Blueberries: Gently fold the prepared fresh blueberries or the frozen blueberries into the batter, distributing them throughout without overworking the mixture.
Fill the Pan: Transfer the batter to the prepared loaf pan and spread it evenly.
Bake the Cake: Bake at 350°F for 55–65 minutes, or until a toothpick inserted into the center comes out clean. Because oven temperatures vary, begin checking for doneness at 50 minutes. Protect the Top: If the surface begins browning too much during baking, loosely tent the cake with aluminum foil, making sure the foil does not touch the cake.
Cool the Cake: Let the baked cake cool in the pan for 10 minutes, then carefully turn it out onto a wire rack and allow it to cool completely before icing or slicing.
Mix the Lemon Icing: For the optional icing, combine the powdered sugar, lemon zest, kosher salt, and lemon juice in a small bowl. Stir until smooth, adding a little more lemon juice if necessary. Keep the icing thick but fluid enough to pour over the cooled cake.