Some text types are always formal ... You could, for example, write a formal or informal letter depending on whether you were writing to a friend (informal) or your headteacher (formal).