Ticket #26: tick_font.diff

File tick_font.diff, 1.7 kB (added by ged@…, 3 years ago)

Here is a patch to add such support (including font face). Patch based on trunk r143

  • pie.py

     
    129129        if self.options.axis.x.hide or not self.xticks: 
    130130            return 
    131131 
     132        cx.select_font_face(self.options.axis.tickFont, 
     133                            cairo.FONT_SLANT_NORMAL, 
     134                            cairo.FONT_WEIGHT_NORMAL) 
     135        cx.set_font_size(self.options.axis.tickFontSize) 
     136 
    132137        self.xlabels = [] 
    133138        lookup = dict([(slice.xval, slice) for slice in self.slices]) 
    134139 
  • chart.py

     
    327327        cx.close_path() 
    328328        cx.stroke() 
    329329 
     330        cx.select_font_face(self.options.axis.tickFont, 
     331                            cairo.FONT_SLANT_NORMAL, 
     332                            cairo.FONT_WEIGHT_NORMAL) 
     333        cx.set_font_size(self.options.axis.tickFontSize) 
     334 
    330335        label = unicode(tick[1]) 
    331336        extents = cx.text_extents(label) 
    332337        labelWidth = extents[2] 
     
    362367        cx.close_path() 
    363368        cx.stroke() 
    364369 
     370        cx.select_font_face(self.options.axis.tickFont, 
     371                            cairo.FONT_SLANT_NORMAL, 
     372                            cairo.FONT_WEIGHT_NORMAL) 
     373        cx.set_font_size(self.options.axis.tickFontSize) 
     374 
    365375        label = unicode(tick[1]) 
    366376        extents = cx.text_extents(label) 
    367377        labelWidth = extents[2] 
     
    614624        labelColor='#666666', 
    615625        labelFont='Tahoma', 
    616626        labelFontSize=9, 
     627        tickFont='Tahoma', 
     628        tickFontSize=9, 
    617629        labelWidth=50.0, 
    618630        x=Option( 
    619631            hide=False,