[reportlab-users] registering fonts
carl at personnelware.com
Thu Jan 1 20:47:48 EST 2009
Roberto Alsina wrote:
> Carl Karsten writes:
>> I am finding myself trying to write generic code to register fonts.
>> Looking at reportlab/pdfbase/pdfmetrics.py I see much the same code,
>> but it depends on external stuff (system wide config files, editing
>> /usr/lib/python2.5/site-packages/reportlab/rl_config.py, and maybe
>> setting an environment var, but I couldn't get that to work.)
>> Or maybe I am missing something.
>> Here is what I am hoping for: my app that uses reportlab these 2 fonts:
>> /usr/share/fonts/type1/gsfonts/n019004l.afm which is part of
>> /usr/share/fonts/truetype/freefont/FreeSans.ttf from
>> My app has a local config file that holds things like database/user/pw
>> - great place to store path's to fonts
>> either the font's and dirs and fonts used:
>> or the full pathnames:
>> Then my app can have some generic code that registers those fonts. I
>> am guessing most apps that use reportlab need this, so it would be
>> great if I could just pass those lists into some reporlab code.
>> So, does anything like this exist? If not, I'll be happy to code it
>> up and submit a patch - anything I should know?
> There is generic font embedding stuff in rst2pdf
> (http://rst2pdf.googlecode.com), where it will try to find a font by
> name using a variety of mechanisms.
> Can't give you more details right now because I'm at the beach but look
> for font stuff it should be easy to find :-)
if not f:
if not f:
Any objections to this code being rolled into Reportlab?
Reportlab, any objections to this code being used in
reportlab/pdfbase/pdfmetrics.py? (guessing the MIT thing may require
something... no clue.)
More information about the reportlab-users