The word choice shaping the tone of a text is called diction.
To add, diction in its original, primary meaning, refers to the writer's or the speaker's distinctive vocabulary choices and style of expression in a poem or story.
If you have any other questions, please don’t hesitate to ask again.