I use a ruler next to the sewing machine foot (standard not a special ruler foot) to keep a straight line for many uses.
To stitch 1/4" from the diagonal line across a square first adjust your needle position to 1/4" from the left of the foot. Now place a ruler diagonally, as if you were going to draw the line, but making sure the left hand side of the foot stays in contact with the ruler, just sew. You are sewing 1/4" from the centre line which is the same as if you were following a drawn line. Make a test piece first to check on your needle position.
I use a 1/2" x 6" ruler which is designed to draw 1/4" lines and I find it really useful for echoing and sewing straight lines around borders etc if I don't want the faff of changing to the ruler foot and thicker rulers.