I am sure I have said how to fit hammers sometime in the past and it is a reasonably simple process if you dont use files to cut the hammer mounting square. The reason for this is if you look at the square in a hammer boss from a working gun you will find that it has a small taper from the inside to the hammer outside, with the smaller section square on the outside very hard to accomplish with files. There is a very good reason for this taper because on the majority of locks the hammer mounting square is parallel sided. So if you have a tapering square on the hammer when it is fitted to the lock mounting square it will reach a position where it fits it tightly and as the hammer retaining screw is tightened this tightens the fit even more, and of course it can keep the hammer tightly fitting to the lock also allowing for future adjustments.
This is the reason that when you remove the hammer retaining screw the hammer very often will not just drop off you have to do a little levering, also on a well fitted hammer there is a slight gap between the top of the mounting square and the outside face of the hammer so there is no contact with the mounting screw head. If or when the mounting square touches the underside of the screw head the hammer will eventually become loose on its mounting and no amount of tightening the screw will help matters.
The way of fitting a hammer correctly is to swage the square mounting using a tapered Square hardened polished and oiled metal punch having a taper of between 2 to 4 decrees putting into a smaller hole than the mounting square starting on the inside of the hammer then driving it in. Doing it this way you can get the correct angle for the hammer mounting compress and work harden the metal a little also you can continuously try the hammer fit on its mounting square during the whole process.