// A font sampler // Last edited on 2019-05-27 14:43:54 by stolfilocal #macro font_sampler_single(fnt,dsp) #debug concat("!! font = ", fnt, "\n") #local lab = text { ttf concat("tt-fonts/arial.ttf") concat(fnt, ": ") 0.1, 0.0 texture{ char_texture } } #local txt = concat("MEIO'(1+9)#bpomi ", chr(168), chr(176), chr(207), chr(150), " ") #local obj = text { ttf concat("tt-fonts/", fnt, ".ttf") txt 0.2, 0.0 texture{ char_texture } } union{ object{ lab } object{ obj translate dsp*x } } #local sz = max_extent(obj) - min_extent(obj); #debug concat("!! obj size = <", str(sz.x,4,3), ",", str(sz.y,4,3), ",", str(sz.z,4,3), ">\n") #end #macro font_sampler(fname,N) #local dsp = 6.0; #debug concat("\n!! N = ", str(N,1,0), "\n") union{ #local ty = 0; #for(ii, 0, N-1) #local ty = ty - 0.1; object{ font_sampler_single(fname[ii],dsp) translate ty*y } #local ty = ty - 1.1; #end object{ empty } object{ empty translate <2,2,2> } scale 1.8/(1.2*N) translate < -0.60, +0.90, 00.00 > } #end