The judge, before making the order for trial in vacation or afterward, may impose such terms, and make such requirements as to costs and payment thereof or security therefor, as he thinks proper, and shall tax the costs of the case as he may deem just.