With an intense thermal variation, optical encoder yields measuring error because of the generation of nonlinear strain due to the difference of the thermal expantion coefficient between a glass scale and a metallic parts of machines. In this study, a method of using a grating which is directly manufactured on a metallic surface of parts of machines is proposed. Using this method, the thermal strain is made linear and the error becomes simplified to calibrate. Furthermore, it realizes a miniaturization of the system and improves its vibration-resistance. This paper shows the process of making a grating on a metallic surface by photolithography using some methods and ascertains the sufficient performance of this scale in an optical encoder.