Whisk 3 cups of flour, 1 teaspoon of baking powder and 1/2 teaspoon of salt in a medium bowl and set aside. In a large bowl, beat 1 cup of softened unsalted butter and 1 cup of granulated sugar on medium-high speed for about 3 minutes, until light and fluffy. Beat in 1 large egg, 2 teaspoons of vanilla extract and 1/2 teaspoon of almond extract. Turn the mixer to low and add the dry ingredients a little at a time, mixing only until the flour disappears.
Divide the dough in half. Place each half between two sheets of parchment paper and roll out to 1/4 inch thick. Stack the sheets on a baking tray and refrigerate for 1 hour. Press a 3-inch heart cutter straight down without twisting, lift the hearts onto parchment-lined baking sheets 2 inches apart, gather the scraps, re-roll once and cut more hearts.
Heat the oven to 350°F. If the cut hearts have softened, freeze the trays for 10 minutes. Bake one tray at a time for 10 to 12 minutes, until the edges are just barely golden and the centers have lost their raw shine. Cool on the tray for 5 minutes, then move to a wire rack and cool completely before decorating.
Combine 4 cups of sifted powdered sugar, 3 tablespoons of meringue powder and 9 tablespoons of room-temperature water in a large bowl. Beat on high speed for 1 1/2 to 2 minutes, until shiny, stiff and bright white. Beat in 1/2 teaspoon of light corn syrup and 1 teaspoon of vanilla extract. Scoop out about 1/3 of the stiff icing into a small bowl and keep it covered for outlining and details. Thin the rest a teaspoon of water at a time until a ribbon of icing dripped back into the bowl disappears in about 15 seconds. Tint the flood icing pink and red in separate bowls, keeping one bowl white.
Work on 2 or 3 cookies at a time. Pipe a thin border of outlining icing around the edge of a heart, fill the middle with flood icing, and nudge it to the border with a toothpick. While the flood is still wet, add dots of contrasting flood icing for polka dots, or drag a toothpick down through each dot to make tiny hearts. Leave the cookies uncovered on the counter.
Leave the decorated cookies in a single layer, uncovered, at room temperature for 8 to 12 hours (overnight). Do not stack, wrap or package them until the icing is hard all the way through.