Using custom fonts for processing.js in web2py -
how use custom fonts in processing.js inside web2py server? more specifically, what's path , why have use directives?
been looking answer months thought i'd put out there in case gets few google hits. turns out enable fonts in processing.js instances in html 5 canvases in web2py servers have to, known, declare directive:
/* @pjs font="/nameofyourapplication/nameofyourfont.ttf"; */
this, explained in reference page of processing.org, done preload font browser doesn't spaz on load. , next , final step go setup function , this:
textfont(createfont("/nameofyourapplication/nameofyourfont",32));
that's it. sounds dumb , know how may common sense given out there talks "data" folder, tends frustrating , pointless.
i suggest putting fonts in static folder of application beyond it's you.
Comments
Post a Comment