// POV-Ray macros to define geometric fonts. // Last edited on 2010-04-01 22:42:25 by stolfi #ifndef (glyphChar) #declare widthChar = array[65536] #declare heightChar = array[65536] #declare depthChar = array[65536] #declare glyphChar = array[65536] #end #macro defchar(cod,wd,ht,dp,obj) // Saves the glyph {obj} // in the {glyphChar} table under the code {cod}. // Also saves the associated character metrics {wd,ht,dp}. #local hi = div(cod,256); #local hioct = 100*div(hi,64) + 10*mod(div(hi,8),8) + mod(hi,8); #local lo = mod(cod,256); #local looct = 100*div(lo,64) + 10*mod(div(lo,8),8) + mod(lo,8); // #debug concat("defining character ", str(cod,-5,0), " = '\\", str(hioct,-3,0), "\\", str(looct,-3,0), "'") // #debug concat(" [", str(wd,5,3), " ", str(ht,5,3), " ", str(dp,5,3), "] = '", chr(cod), "'\n") #ifdef (glyphChar[cod]) #error concat("character code ", str(cod,3,0), " multiply defined\n") #end #declare widthChar[cod] = wd; #declare heightChar[cod] = ht; #declare depthChar[cod] = dp; #declare glyphChar[cod] = object{ obj } #end