Ejemplo n.º 1
0
 def stringWidth(self, s, font=None):
     "Return the logical width of the string if it were drawn \
     in the current font (defaults to self.font)."
     if not font:
         font = self.defaultFont
     fontname = self._findPostScriptFontName(font)
     return pdfmetrics.stringwidth(s, fontname) * font.size * 0.001
Ejemplo n.º 2
0
 def stringWidth(self, s, font=None):
     "Return the logical width of the string if it were drawn \
     in the current font (defaults to self.font)."
     if not font:
         font = self.defaultFont
     fontname = self._findPostScriptFontName(font)
     return pdfmetrics.stringwidth(s, fontname) * font.size * 0.001
Ejemplo n.º 3
0
 def stringWidth(self, text, fontname, fontsize):
     "gets width of a string in the given font and size"
     return pdfmetrics.stringwidth(text, fontname) * 0.001 * fontsize
Ejemplo n.º 4
0
 def stringWidth(self, text, fontname, fontsize):
     "gets width of a string in the given font and size"
     return pdfmetrics.stringwidth(text, fontname) * 0.001 * fontsize