Esempio n. 1
0
  def _setPyartFont(self, fontInstance):
    # accounts for "None" option
    # does not act on self.defaultFont at all

    fontsize = fontInstance.size
    self._pycan.gstate.font_size = fontsize
    # map pid name for font to Pyart name
    pyartname = Fontmapping.getPyartName(fontInstance)
    self._pycan.gstate.setfont(pyartname)
Esempio n. 2
0
    def _setPyartFont(self, fontInstance):
        # accounts for "None" option
        # does not act on self.defaultFont at all

        fontsize = fontInstance.size
        self._pycan.gstate.font_size = fontsize
        # map pid name for font to Pyart name
        pyartname = Fontmapping.getPyartName(fontInstance)
        self._pycan.gstate.setfont(pyartname)
Esempio n. 3
0
 def fontDescent(self, font=None):
   if not font:
     font = self.defaultFont
   fontname = Fontmapping.getPdfName(font)
   return -pdfmetrics.ascent_descent[fontname][1] * 0.001 * font.size
Esempio n. 4
0
 def stringWidth(self, s, font=None):
   if not font:
     font = self.defaultFont
   fontname = Fontmapping.getPdfName(font)
   return pdfmetrics.stringwidth(s, fontname) * font.size * 0.001
Esempio n. 5
0
 def fontDescent(self, font=None):
     if not font:
         font = self.defaultFont
     fontname = Fontmapping.getPdfName(font)
     return -pdfmetrics.ascent_descent[fontname][1] * 0.001 * font.size
Esempio n. 6
0
 def stringWidth(self, s, font=None):
     if not font:
         font = self.defaultFont
     fontname = Fontmapping.getPdfName(font)
     return pdfmetrics.stringwidth(s, fontname) * font.size * 0.001