// Sample scene. // yuqk outLineFontMethod.pov +w800 +h800 +p // Using negative area light projected through text cap to turn // and font into an outline font. #version unofficial 3.8; // yuqk #if (file_exists("version.inc")) #include "version.inc" #end #if (!defined(Fork_yuqk)) #error "This POV-Ray SDL code requires the yuqk fork." #end global_settings { assumed_gamma 1.0 } #declare VarOrthoMult = 5.0/max(image_width/image_height,image_height/image_width); #declare Camera01z = camera { orthographic location <0,0,-2> direction z right VarOrthoMult*x*max(1,image_width/image_height) up VarOrthoMult*y*max(1,image_height/image_width) } // Liberation fonts usually ship with Linux distributions. // Use command: 'fc-list | grep LiberationMono' to find // the location on your computer. #declare // FontFile = "/home/pokorny/Fonts/LiberationMono-Regular.ttf" FontFile = "/home/pokorny/Fonts/UbuntuMono-R.ttf" #declare String = "outline" // Use Chris R method to determine character pitches #local _T1 = text { ttf FontFile "A" 1.0, 0 } #local _T2 = text { ttf FontFile "AA" 1.0, 0 } #local _T3 = text { ttf FontFile "│" 1.0, 0 } #local _T1sz = max_extent(_T1) - min_extent(_T1); #local _T2sz = max_extent(_T2) - min_extent(_T2); #local _T3sz = max_extent(_T3) - min_extent(_T3); #declare _Cwidth = (_T2sz - _T1sz).x; #declare _Cheight = _T3sz.y; #declare TxtRight = text { ttf FontFile String, 0, <0,0,0> caps on // At depth of 0 get 2D top cap only translate <-3.5*_Cwidth,-_Cheight/4,0> } #declare Text00 = object { TxtRight pigment { rgb <1,1,0> } finish { emission 1 } interior_texture { pigment { rgb <0,1,1> } finish { emission 1 } } translate <0.0,0.0,-0.5> } #declare Light00 = light_source { <0,0,-10>, rgb -5 parallel point_at <0,0,0> projected_through { union { object { TxtRight translate <0,+1,-0.5> } object { TxtRight translate <0,+0,-0.5> } object { TxtRight translate <0,-1,-0.5> } } } area_light 3*x,5*y,33,55 adaptive 1 jitter circular orient } //--- camera { Camera01z } light_source { Light00 } plane { -z 0 pigment { rgb 1 } finish { emission 1 diffuse 1} } union { object { Text00 translate <0,+2,0> } object { Text00 translate <0,+1,0> } object { Text00 translate <0,+0,0> } object { Text00 translate <0,-1,0> } object { Text00 translate <0,-2,0> } }