// Text sizer, a utility to determine the length of a text string // By Eric Freeman // 01-29-98 #include "colors.inc" // change the "camera_z" value to zoom in and out on the text // start far away (20 is farther away than 10) so you can see the whole text line // count the number of lines till the end of the text // NOTE: the first line on the left is at position 0 (zero), // the next line is at position 1 (one), etc. // I've put a "0" on the zero line and hash marks every five lines to help you count // then set the "camera_x" value to the end of the text (ie, line count) // then zoom in (lower "camera_z" value) till you can judge the exact end // of the text. #declare camera_z = 11 // 11 is a good starting point // change this value to move the camera along the x-axis (left-right) #declare camera_x = 5 // 5 is a good starting point // put your font path/name here (don't ferget the quotes) #declare font_name = "C:\WINDOWS\FONTS\TT0310M_.TTF" // put your text line here (don't ferget the quotes) #declare text_string = "CDR Conn sux seawater" // that's it. render and count the lines!!!!!!!!!!!!!!!!! // adjust the "camera_x" and "camera_z" values and u will see that the example text line // is about 11.5 units long // remember, if u scale the image in your scene, the length will also scale // i.e., if u will use the example text and scale it to three times it's default size, // the text will be 34.5 units long //************************************************************************************* // DON'T MESS WITH THE CODE BELOW THIS LINE * //************************************************************************************* background { color Khaki } camera { location < camera_x, camera_z/4, -camera_z > look_at < camera_x, 0.3, 0 > } light_source { < camera_x, 19, -60 > color White } box { < 0, -0.1, -0.1 > < 40, 0, 0.1 > pigment { color White } } #declare looper = 0 #while (looper < 41) box { < looper-0.01, 0.0, -0.1 > < looper+0.01, 0.9, 0.1 > pigment { color Blue } finish { ambient 0.5 } } #declare looper = looper+1 #end text { ttf font_name , text_string, 0.01, 0.0 pigment { color Red } } #declare ruler_zero = difference { cylinder { < 0.0, -0.1, -0.11 >, < 0.0, -0.1, -0.1 > 0.15 } cylinder { < 0.0, -0.1, -0.11001 >, < 0.0, -0.1, -0.0999 > 0.07 } pigment { color Black } } ruler_zero #declare looper = 5 #while (looper < 41) box { < looper-0.05, -0.3, -0.11 >, < looper+0.05, 0, -0.1> pigment { color Black } } #declare looper = looper+5 #end