The text document can calculate the size of its contents, so just use it.