Place bread cubes in a large roasting pan. Bake at 250° for 30 minutes, tossing occasionally. Turn oven off, and let bread stand in oven 1 to 1 1/2 hours or until dried. (Cover roasting pan with foil and leave bread in oven overnight, if desired.)
Melt butter in a large skillet over high heat. Add onion, and cook 15 minutes, stirring occasionally. Reduce heat to medium, and cook, stirring often, 15 to 20 minutes or until onion is caramelized. Remove from heat. Refrigerate overnight, if desired.
Toss bread and caramelized onion together in pan.
Whisk together eggs, half-and-half, rosemary, salt, and pepper in a large bowl; pour over bread and onion in pan, and stir gently. Let stand at room temperature at least 1 hour, stirring occasionally to coat bread.
Bake, uncovered, at 375° for 1 to 1 1/4 hours or until firm and lightly browned. Let stand 10 minutes before serving.