Here are three mechanisms which approximate a straight line, and one which doesn't.
A Crank Piston
Chebyshev's Linkage
Hoeken's Linkage
Watt's Linkage