Mission: Impossible II's Thandie Newton has also signed to portray Secretary of State Condoleeza Rice in W.
Josh Brolin is attached to play the title role, with Scrubs actress Elizabeth Banks as first lady Laura Bush.
Other confirmed cast members include James Cromwell and Ellen Burstyn as George Bush senior and wife Barbara.
W tells the story of the president's formative years, touching on his relationship with his father, his heavy drinking and his conversion to Christianity.
Gruffudd recently agreed to star in the pilot for new US show The Meant to Be's.