I replaced the windows on the front of my house with super efficient fiberglass windows.
After mounting the replacement windows in the frame, I used expanding foam to fill in the gaps.
I then carefully repaired the brick mortar around the edges.