How to get a square brush in texture paint?
Blender paints within a circular brush, you can use an image like a stencil when painting to get different shaped brushes.

When you create a image to be used for a brush there are a few things you need to keep in mind. When you have a square image, blender's brush will only paint within it's circle and that circle will be contained within the image dimensions, in practice I would also leave a little margin inside that circle as well.



Anything in the red area will not show in blender's brush, while the green area can be considered a safe zone for brush shapes.

To create a square brush using gimp you can create a 100x100 image and fill it with white then resize the canvas to 200x200 and click the center button then export to png.

Draw the shape you want in white and leave the non-drawing part of the image as transparent and save it as a png. Then in blender create a new brush texture as an "Image or Movie" and select your brush image. The transparent parts show as black in the preview, unlike normal transparent texture previews. You can use multi-coloured images as brushes, the colours will be mixed with the active brush colour based on the blend mode, so white will maintain the brush colours while other colours will tint the brush accordingly. Feel free to experiment with different alpha values for soft edges.



Texture masks work in a similar way but they don't mix colours like a texture brush, any colour info will only be used as a greyscale mask for the brush.

To get a crisp edge you will want to give the brush a sharp curve, this can easily be set by clicking the square preset button at the end.