The federal judge in Donald Trump's federal election interference case has granted part of the government's request for a narrowly tailored gag order against the former president.