Changeset 5366


Ignore:
Timestamp:
09/06/09 09:15:58 (10 years ago)
Author:
domlowe
Message:

Adding config option for legend font.

Location:
cows/trunk/cows
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/pylons/project_templates/cows_server/development.ini_tmpl

    r5066 r5366  
    3636cows.csml.publish_dir = %(here)s/publish 
    3737cows.csml.wfsconfig = %(here)s/wfs.cfg 
     38cows.csml.legendfont= /usr/share/fonts/truetype/msttcorefonts/arial.ttf  #modify this path to render the legend 
    3839 
    3940############################################################################## 
  • cows/trunk/cows/service/imps/csmlbackend/config.py

    r4912 r5366  
    2626    # Location of WFS config file 
    2727    wfsconfig = None, 
     28    # Location of legend font 
     29    legendfont = '/usr/share/fonts/truetype/msttcorefonts/arial.ttf', 
    2830    ) 
  • cows/trunk/cows/service/imps/csmlbackend/wms_csmllayer.py

    r5365 r5366  
    2727from MA import array 
    2828import Image, ImageFont, ImageDraw 
    29  
    3029from cows.service.wms_iface import IwmsLayer, IwmsDimension, IwmsLayerSlab 
    3130from cows.service.imps.csmlbackend.csmlcommon import CSMLLayerMapper, CSMLConnector 
     
    315314    def _simpletxt2image(self, text, size): 
    316315        image = Image.new('RGBA',size,"white") 
    317         ifo = ImageFont.truetype("/usr/share/fonts/truetype/msttcorefonts/arial.ttf",16) 
     316        fontfullpath = config['legendfont'] 
     317        ifo = ImageFont.truetype(fontfullpath,16) 
    318318        draw = ImageDraw.Draw(image) 
    319319        draw.text((0, 0), text, font=ifo,fill=(100, 123, 165)) 
Note: See TracChangeset for help on using the changeset viewer.