In a food processor, pulse the flour, sugar, baking powder and salt a few times to mix them. Add the butter pieces and pulse until the dough resembles small crumbs. Add the eggs, and pulse until the dough more or less forms a ball. It is a very forgiving dough, so don’t fuss too much.
Tip the dough onto a work surface and knead it two or three times just to bring it together. Line an 8- or 9-inch square pan with a long piece of plastic wrap. Press and flatten the dough into the pan. Cover with the overhanging plastic wrap and refrigerate for 1 to 2 hours, or until firm. The dough can be refrigerated for up to five days if you want to shape and bake the cookies later.
Preheat the oven to 350ºF. On a baking sheet, spread the almonds. Bake them for 8 to 10 minutes, or until they smell toasty. Cool briefly.
With scissors, snip the stems off the figs, and snip each fig into 3 or 4 pieces.
In a food processor, combine the figs, raisins, cinnamon, salt, cloves, nutmeg, vanilla and orange zest. Pulse until they are finely chopped. Add the almonds, marmalade and rum. Pulse until the mixture holds together but is not ground to a paste—it should have a little texture.
Transfer to a bowl, cover and refrigerate until you are ready to assemble the cookies. The filling will keep for at least one week.
Have on hand 2 parchment lined baking sheets. Divide the dough in half.
Place a piece of parchment on the work surface and sprinkle it generously with flour. Working with half the dough at a time, roll it into a 12- by 14-inch rectangle. Slide it onto the baking sheet and refrigerate it for 20 to 30 minutes, or until cold. Repeat with the second half of the dough.
While the dough is chilling, shape the filling. Line a baking sheet with plastic wrap. Divide the filling into 8 pieces (about 1/3 cup each) and roll each one into a 14-inch log. (This is easiest to accomplish by rolling about half of each portion at a time and piece the small logs together to form a long log.) The logs should be about 1/2-inch thick. Place on the baking sheet.
Remove one sheet of chilled pastry from the refrigerator. With the dough still on the baking sheet, position it so that the 12-inch edge of the rectangle is parallel to the countertop. With a pastry wheel or pizza cutter, cut the dough into 4 long strips that are 3 inches wide.
Center 1 log of filling on each dough strip. Fold one side of dough over it and roll it so the seam is on the bottom. Return the baking sheet to the refrigerator for 20 to 30 minutes before cutting and shaping.
Beat 1 egg with 1 tablespoon of water to make an egg wash. Line 2 baking sheets with parchment. If you have turned off the oven, preheat it now to 350ºF.
For small cookies, cut the logs into 1 1/2-inch pieces. Brush with egg wash and sprinkle with colored sprinkles and bake, or glaze (see recipe below) with icing and top with sprinkles after baking.
For X cookies, cut into 2 1/2- to 3-inch pieces. With a paring knife, make a slit on both ends of each piece and open them out slightly to form an X. Brush with egg wash and sprinkle with colored sprinkles and bake, or glaze with icing and top with sprinkles after baking.
For curved cookies, cut into 2 1/2- to 3-inch pieces. With a paring knife, make 3 or 4 1/4-inch cuts on 1 side of each cookie, being careful not to cut all the way through. Curve them into a crescent shape. Brush with egg wash and sprinkle with colored sprinkles and bake, or glaze with icing and top with sprinkles after baking.
Bake for 18 to 20 minutes, or until light golden brown.
Whisk together 2 egg whites and 2 1/2 cups of confectioner’s sugar. Pour into a shallow dish. Carefully dip the tops of the cookies in the icing and set them on a rack. Sprinkle with colored sprinkles and leave until set.
Store between sheets of wax paper in a tin with a tight-fitting lid for up to 1 week.